/** * Main function * * @return void */ function main() { switch ((string) t3lib_div::_GET('cmd')) { case 'menuitem': echo ' <img src="gfx/x_t3logo.png" width="61" height="16" hspace="3" alt="" />'; $menuItems = array(array('title' => 'About TYPO3', 'xurl' => 'http://typo3.com/', 'subitems' => array(array('title' => 'License', 'xurl' => 'http://typo3.com/License.1625.0.html'), array('title' => 'Support', 'subitems' => array(array('title' => 'Mailing lists', 'xurl' => 'http://lists.netfielders.de/cgi-bin/mailman/listinfo'), array('title' => 'Documentation', 'xurl' => 'http://typo3.org/documentation/'), array('title' => 'Find consultancy', 'xurl' => 'http://typo3.com/Consultancies.1248.0.html'))), array('title' => 'Contribute', 'xurl' => 'http://typo3.org/community/participate/'), array('title' => 'Donate', 'xurl' => 'http://typo3.com/Donations.1261.0.html', 'icon' => '1'))), array('title' => 'Extensions', 'url' => 'mod/tools/em/index.php'), array('title' => 'Menu preferences and such things', 'onclick' => 'alert("A dialog is now shown which will allow user configuration of items in the menu");event.stopPropagation();', 'state' => 'checked'), array('title' => '--div--'), array('title' => 'Recent Items', 'id' => $this->id . '_recent', 'subitems' => array(), 'html' => $this->menuItemObject($this->id . '_recent', ' fetched: false, onActivate: function() { // if (!this.fetched) { //Element.update("' . $this->id . '_recent-layer","asdfasdf"); getElementContent("' . $this->id . '_recent-layer", 0, "logomenu.php?cmd=recent") this.fetched = true; // } } ')), array('title' => '--div--'), array('title' => 'View frontend', 'xurl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL')), array('title' => 'Log out', 'onclick' => "top.document.location='logout.php';")); echo $this->menuLayer($menuItems); break; case 'recent': $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('sys_log.*, MAX(sys_log.tstamp) AS tstamp_MAX', 'sys_log,pages', 'pages.uid=sys_log.event_pid AND sys_log.userid=' . intval($GLOBALS['BE_USER']->user['uid']) . ' AND sys_log.event_pid>0 AND sys_log.type=1 AND sys_log.action=2 AND sys_log.error=0', 'tablename,recuid', 'tstamp_MAX DESC', 20); $items = array(); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $elRow = t3lib_BEfunc::getRecord($row['tablename'], $row['recuid']); if (is_array($elRow)) { $items[] = array('title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($row['tablename'], $elRow), $GLOBALS['BE_USER']->uc['titleLen']) . ' - ' . t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $row['tstamp_MAX']), 'icon' => array(t3lib_iconworks::getIcon($row['tablename'], $elRow), 'width="18" height="16"'), 'onclick' => 'content.' . t3lib_BEfunc::editOnClick('&edit[' . $row['tablename'] . '][' . $row['recuid'] . ']=edit', '', 'dummy.php')); } } echo $this->menuItems($items); break; } }
/** * Renders the icon * * @param string $icon Icon to be used * @param string $title Optional title * @return strin Content rendered image */ public function render($icon, $title = '') { if (!empty($icon)) { $absIconPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFilename($icon); if (file_exists($absIconPath)) { $icon = $GLOBALS['BACK_PATH'] . '../' . str_replace(PATH_site, '', $absIconPath); } } else { $icon = \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath('reports') . 'Resources/Public/moduleicon.gif'; } $content = '<img' . \t3lib_iconworks::skinImg($GLOBALS['BACK_PATH'], $icon, 'width="16" height="16"') . ' title="' . htmlspecialchars($title) . '" alt="' . htmlspecialchars($title) . '" />'; return $content; }
/** * Gets the entries for the action menu * * @return array Array of action menu entries * @author Steffen Kamper <*****@*****.**> * @author Ingo Renner <*****@*****.**> */ protected function getActionEntries() { $actions = array(); if ($GLOBALS['BE_USER']->isAdmin()) { $queryResource = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_action', 'pid = 0 AND hidden=0', '', 'sys_action.sorting'); } else { $groupList = 0; if ($GLOBALS['BE_USER']->groupList) { $groupList = $GLOBALS['BE_USER']->groupList; } $queryResource = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('sys_action.*', 'sys_action', 'sys_action_asgr_mm', 'be_groups', ' AND be_groups.uid IN (' . $groupList . ') AND sys_action.pid = 0 AND sys_action.hidden = 0', 'sys_action.uid', 'sys_action.sorting'); } if ($queryResource) { while ($actionRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($queryResource)) { $actions[] = array($actionRow['title'], 'mod.php?M=user_task&SET[mode]=tasks&SET[function]=sys_action.TYPO3\\CMS\\SysAction\\ActionTask&show=' . $actionRow['uid'], \t3lib_iconworks::getSpriteIconForRecord('sys_action', $actionRow)); } $GLOBALS['TYPO3_DB']->sql_free_result($queryResource); } return $actions; }
/** * Add entries for a single record * * @param string $table Table name * @param integer $uid Record uid * @param array $lines Output lines array (is passed by reference and modified) * @param string $preCode Pre-HTML code * @param boolean $checkImportInPidRecord If you want import validation, you can set this so it checks if the import can take place on the specified page. * @return void * @todo Define visibility */ public function singleRecordLines($table, $uid, &$lines, $preCode, $checkImportInPidRecord = 0) { global $LANG; // Get record: $record = $this->dat['header']['records'][$table][$uid]; unset($this->remainHeader['records'][$table][$uid]); if (!is_array($record) && !($table === 'pages' && !$uid)) { $this->error('MISSING RECORD: ' . $table . ':' . $uid, 1); } // Begin to create the line arrays information record, pInfo: $pInfo = array(); $pInfo['ref'] = $table . ':' . $uid; // Unknown table name: if ($table === '_SOFTREF_') { $pInfo['preCode'] = $preCode; $pInfo['title'] = '<em>' . $GLOBALS['LANG']->getLL('impexpcore_singlereco_softReferencesFiles', 1) . '</em>'; } elseif (!isset($GLOBALS['TCA'][$table])) { // Unknown table name: $pInfo['preCode'] = $preCode; $pInfo['msg'] = 'UNKNOWN TABLE \'' . $pInfo['ref'] . '\''; $pInfo['title'] = '<em>' . htmlspecialchars($record['title']) . '</em>'; } else { // Otherwise, set table icon and title. // Import Validation (triggered by $this->display_import_pid_record) will show messages if import is not possible of various items. if (is_array($this->display_import_pid_record)) { if ($checkImportInPidRecord) { if (!$GLOBALS['BE_USER']->doesUserHaveAccess($this->display_import_pid_record, $table === 'pages' ? 8 : 16)) { $pInfo['msg'] .= '\'' . $pInfo['ref'] . '\' cannot be INSERTED on this page! '; } if (!$this->checkDokType($table, $this->display_import_pid_record['doktype']) && !$GLOBALS['TCA'][$table]['ctrl']['rootLevel']) { $pInfo['msg'] .= '\'' . $table . '\' cannot be INSERTED on this page type (change page type to \'Folder\'.) '; } } if (!$GLOBALS['BE_USER']->check('tables_modify', $table)) { $pInfo['msg'] .= 'You are not allowed to CREATE \'' . $table . '\' tables! '; } if ($GLOBALS['TCA'][$table]['ctrl']['readOnly']) { $pInfo['msg'] .= 'TABLE \'' . $table . '\' is READ ONLY! '; } if ($GLOBALS['TCA'][$table]['ctrl']['adminOnly'] && !$GLOBALS['BE_USER']->isAdmin()) { $pInfo['msg'] .= 'TABLE \'' . $table . '\' is ADMIN ONLY! '; } if ($GLOBALS['TCA'][$table]['ctrl']['is_static']) { $pInfo['msg'] .= 'TABLE \'' . $table . '\' is a STATIC TABLE! '; } if ($GLOBALS['TCA'][$table]['ctrl']['rootLevel']) { $pInfo['msg'] .= 'TABLE \'' . $table . '\' will be inserted on ROOT LEVEL! '; } $diffInverse = FALSE; if ($this->update) { // In case of update-PREVIEW we swap the diff-sources. $diffInverse = TRUE; $recInf = $this->doesRecordExist($table, $uid, $this->showDiff ? '*' : ''); $pInfo['updatePath'] = $recInf ? htmlspecialchars($this->getRecordPath($recInf['pid'])) : '<strong>NEW!</strong>'; // Mode selector: $optValues = array(); $optValues[] = $recInf ? $LANG->getLL('impexpcore_singlereco_update') : $LANG->getLL('impexpcore_singlereco_insert'); if ($recInf) { $optValues['as_new'] = $LANG->getLL('impexpcore_singlereco_importAsNew'); } if ($recInf) { if (!$this->global_ignore_pid) { $optValues['ignore_pid'] = $LANG->getLL('impexpcore_singlereco_ignorePid'); } else { $optValues['respect_pid'] = $LANG->getLL('impexpcore_singlereco_respectPid'); } } if (!$recInf && $GLOBALS['BE_USER']->isAdmin()) { $optValues['force_uid'] = sprintf($LANG->getLL('impexpcore_singlereco_forceUidSAdmin'), $uid); } $optValues['exclude'] = $LANG->getLL('impexpcore_singlereco_exclude'); $pInfo['updateMode'] = $this->renderSelectBox('tx_impexp[import_mode][' . $table . ':' . $uid . ']', $this->import_mode[$table . ':' . $uid], $optValues); } // Diff vieiw: if ($this->showDiff) { // For IMPORTS, get new id: if ($newUid = $this->import_mapId[$table][$uid]) { $diffInverse = FALSE; $recInf = $this->doesRecordExist($table, $newUid, '*'); \TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL($table, $recInf); } if (is_array($recInf)) { $pInfo['showDiffContent'] = $this->compareRecords($recInf, $this->dat['records'][$table . ':' . $uid]['data'], $table, $diffInverse); } } } $pInfo['preCode'] = $preCode . \t3lib_iconworks::getSpriteIconForRecord($table, (array) $this->dat['records'][$table . ':' . $uid]['data'], array('title' => htmlspecialchars($table . ':' . $uid))); $pInfo['title'] = htmlspecialchars($record['title']); // View page: if ($table === 'pages') { $viewID = $this->mode === 'export' ? $uid : ($this->doesImport ? $this->import_mapId['pages'][$uid] : 0); if ($viewID) { $pInfo['title'] = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($viewID, $GLOBALS['BACK_PATH'])) . 'return false;">' . $pInfo['title'] . '</a>'; } } } $pInfo['class'] = $table == 'pages' ? 'bgColor4-20' : 'bgColor4'; $pInfo['type'] = 'record'; $pInfo['size'] = $record['size']; $lines[] = $pInfo; // File relations: if (is_array($record['filerefs'])) { $this->addFiles($record['filerefs'], $lines, $preCode); } // DB relations if (is_array($record['rels'])) { $this->addRelations($record['rels'], $lines, $preCode); } // Soft ref if (count($record['softrefs'])) { $preCode_A = $preCode . ' '; $preCode_B = $preCode . ' '; foreach ($record['softrefs'] as $info) { $pInfo = array(); $pInfo['preCode'] = $preCode_A . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-status-reference-soft'); $pInfo['title'] = '<em>' . $info['field'] . ', "' . $info['spKey'] . '" </em>: <span title="' . htmlspecialchars($info['matchString']) . '">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($info['matchString'], 60)) . '</span>'; if ($info['subst']['type']) { if (strlen($info['subst']['title'])) { $pInfo['title'] .= '<br/>' . $preCode_B . '<strong>' . $LANG->getLL('impexpcore_singlereco_title', 1) . '</strong> ' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($info['subst']['title'], 60)); } if (strlen($info['subst']['description'])) { $pInfo['title'] .= '<br/>' . $preCode_B . '<strong>' . $LANG->getLL('impexpcore_singlereco_descr', 1) . '</strong> ' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($info['subst']['description'], 60)); } $pInfo['title'] .= '<br/>' . $preCode_B . ($info['subst']['type'] == 'file' ? $LANG->getLL('impexpcore_singlereco_filename', 1) . ' <strong>' . $info['subst']['relFileName'] . '</strong>' : '') . ($info['subst']['type'] == 'string' ? $LANG->getLL('impexpcore_singlereco_value', 1) . ' <strong>' . $info['subst']['tokenValue'] . '</strong>' : '') . ($info['subst']['type'] == 'db' ? $LANG->getLL('impexpcore_softrefsel_record', 1) . ' <strong>' . $info['subst']['recordRef'] . '</strong>' : ''); } $pInfo['ref'] = 'SOFTREF'; $pInfo['size'] = ''; $pInfo['class'] = 'bgColor3'; $pInfo['type'] = 'softref'; $pInfo['_softRefInfo'] = $info; $pInfo['type'] = 'softref'; if ($info['error'] && !\TYPO3\CMS\Core\Utility\GeneralUtility::inList('editable,exclude', $this->softrefCfg[$info['subst']['tokenID']]['mode'])) { $pInfo['msg'] .= $info['error']; } $lines[] = $pInfo; // Add relations: if ($info['subst']['type'] == 'db') { list($tempTable, $tempUid) = explode(':', $info['subst']['recordRef']); $this->addRelations(array(array('table' => $tempTable, 'id' => $tempUid, 'tokenID' => $info['subst']['tokenID'])), $lines, $preCode_B, array(), ''); } // Add files: if ($info['subst']['type'] == 'file') { $this->addFiles(array($info['file_ID']), $lines, $preCode_B, '', $info['subst']['tokenID']); } } } }
/** * Render a list of items as a nicely formated definition list including a * link, icon, title and description. * The keys of a single item are: * - title: Title of the item * - link: Link to the task * - icon: Path to the icon or Icon as HTML if it begins with <img * - description: Description of the task, using htmlspecialchars() * - descriptionHtml: Description allowing HTML tags which will override the * description * * @param array $items: List of items to be displayed in the definition list. * @param boolean $mainMenu: Set it to TRUE to render the main menu * @return string definition list */ public function renderListMenu($items, $mainMenu = FALSE) { $content = $section = ''; $count = 0; // change the sorting of items to the user's one if ($mainMenu) { $userSorting = unserialize($GLOBALS['BE_USER']->uc['taskcenter']['sorting']); if (is_array($userSorting)) { $newSorting = array(); foreach ($userSorting as $item) { if (isset($items[$item])) { $newSorting[] = $items[$item]; unset($items[$item]); } } $items = $newSorting + $items; } } if (is_array($items) && count($items) > 0) { foreach ($items as $item) { $title = htmlspecialchars($item['title']); $icon = $additionalClass = $collapsedStyle = ''; // Check for custom icon if (!empty($item['icon'])) { if (strpos($item['icon'], '<img ') === FALSE) { $absIconPath = t3lib_div::getFileAbsFilename($item['icon']); // If the file indeed exists, assemble relative path to it if (file_exists($absIconPath)) { $icon = $GLOBALS['BACK_PATH'] . '../' . str_replace(PATH_site, '', $absIconPath); $icon = '<img src="' . $icon . '" title="' . $title . '" alt="' . $title . '" />'; } if (@is_file($icon)) { $icon = '<img' . t3lib_iconworks::skinImg($GLOBALS['BACK_PATH'], $icon, 'width="16" height="16"') . ' title="' . $title . '" alt="' . $title . '" />'; } } else { $icon = $item['icon']; } } $description = !empty($item['descriptionHtml']) ? $item['descriptionHtml'] : '<p>' . nl2br(htmlspecialchars($item['description'])) . '</p>'; $id = $this->getUniqueKey($item['uid']); // collapsed & expanded menu items if ($mainMenu && isset($GLOBALS['BE_USER']->uc['taskcenter']['states'][$id]) && $GLOBALS['BE_USER']->uc['taskcenter']['states'][$id]) { $collapsedStyle = 'style="display:none"'; $additionalClass = 'collapsed'; } else { $additionalClass = 'expanded'; } // first & last menu item if ($count == 0) { $additionalClass .= ' first-item'; } elseif ($count + 1 === count($items)) { $additionalClass .= ' last-item'; } // active menu item $active = (string) $this->MOD_SETTINGS['function'] == $item['uid'] ? ' active-task' : ''; // Main menu: Render additional syntax to sort tasks if ($mainMenu) { $dragIcon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/move.gif', 'width="16" height="16" hspace="2"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.move', 1) . '" alt="" />'; $section = '<div class="down"> </div> <div class="drag">' . $dragIcon . '</div>'; $backgroundClass = 't3-row-header '; } $content .= '<li class="' . $additionalClass . $active . '" id="el_' . $id . '"> ' . $section . ' <div class="image">' . $icon . '</div> <div class="' . $backgroundClass . 'link"><a href="' . $item['link'] . '">' . $title . '</a></div> <div class="content " ' . $collapsedStyle . '>' . $description . '</div> </li>'; $count++; } $navigationId = $mainMenu ? 'id="task-list"' : ''; $content = '<ul ' . $navigationId . ' class="task-list">' . $content . '</ul>'; } return $content; }
/** * Returns a linked shortcut-icon which will call the shortcut frame and set a shortcut there back to the calling page/module * * @param string Is the list of GET variables to store (if any) * @param string Is the list of SET[] variables to store (if any) - SET[] variables a stored in $GLOBALS["SOBE"]->MOD_SETTINGS for backend modules * @param string Module name string * @param string Is used to enter the "parent module name" if the module is a submodule under eg. Web>* or File>*. You can also set this value to "1" in which case the currentLoadedModule is sent to the shortcut script (so - not a fixed value!) - that is used in file_edit.php and wizard_rte.php scripts where those scripts are really running as a part of another module. * @return string HTML content */ function makeShortcutIcon($gvList, $setList, $modName, $motherModName = "") { $backPath = $this->backPath; $storeUrl = $this->makeShortcutUrl($gvList, $setList); $pathInfo = parse_url(t3lib_div::getIndpEnv('REQUEST_URI')); // Add the module identifier automatically if typo3/mod.php is used: if (preg_match('/typo3\\/mod\\.php$/', $pathInfo['path']) && isset($GLOBALS['TBE_MODULES']['_PATHS'][$modName])) { $storeUrl = '&M=' . $modName . $storeUrl; } if (!strcmp($motherModName, '1')) { $mMN = "&motherModName='+top.currentModuleLoaded+'"; } elseif ($motherModName) { $mMN = '&motherModName=' . rawurlencode($motherModName); } else { $mMN = ''; } $onClick = 'top.ShortcutManager.createShortcut(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.makeShortcut')) . ', ' . '\'' . $backPath . '\', ' . '\'' . rawurlencode($modName) . '\', ' . '\'' . rawurlencode($pathInfo['path'] . "?" . $storeUrl) . $mMN . '\'' . ');return false;'; $sIcon = '<a href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.makeShortcut', TRUE) . '">' . t3lib_iconworks::getSpriteIcon('actions-system-shortcut-new') . '</a>'; return $sIcon; }
/** * Create configuration form * * @param array Form configurat data * @param array Table row accumulation variable. This is filled with table rows. * @return void Sets content in $this->content */ function makeConfigurationForm($inData, &$row) { global $LANG; $nameSuggestion = ''; // Page tree export options: if (isset($inData['pagetree']['id'])) { $nameSuggestion .= 'tree_PID' . $inData['pagetree']['id'] . '_L' . $inData['pagetree']['levels']; $row[] = ' <tr class="tableheader bgColor5"> <td colspan="2">' . $LANG->getLL('makeconfig_exportPagetreeConfiguration', 1) . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'pageTreeCfg', $GLOBALS['BACK_PATH'], '') . '</td> </tr>'; $row[] = ' <tr class="bgColor4"> <td><strong>' . $LANG->getLL('makeconfig_pageId', 1) . '</strong></td> <td>' . htmlspecialchars($inData['pagetree']['id']) . '<input type="hidden" value="' . htmlspecialchars($inData['pagetree']['id']) . '" name="tx_impexp[pagetree][id]" /></td> </tr>'; $row[] = ' <tr class="bgColor4"> <td><strong>' . $LANG->getLL('makeconfig_tree', 1) . '</strong>' . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'pageTreeDisplay', $GLOBALS['BACK_PATH'], '') . '</td> <td>' . ($this->treeHTML ? $this->treeHTML : $LANG->getLL('makeconfig_noTreeExportedOnly', 1)) . '</td> </tr>'; $opt = array('-2' => $LANG->getLL('makeconfig_tablesOnThisPage'), '-1' => $LANG->getLL('makeconfig_expandedTree'), '0' => $LANG->getLL('makeconfig_onlyThisPage'), '1' => $LANG->getLL('makeconfig_1Level'), '2' => $LANG->getLL('makeconfig_2Levels'), '3' => $LANG->getLL('makeconfig_3Levels'), '4' => $LANG->getLL('makeconfig_4Levels'), '999' => $LANG->getLL('makeconfig_infinite')); $row[] = ' <tr class="bgColor4"> <td><strong>' . $LANG->getLL('makeconfig_levels', 1) . '</strong>' . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'pageTreeMode', $GLOBALS['BACK_PATH'], '') . '</td> <td>' . $this->renderSelectBox('tx_impexp[pagetree][levels]', $inData['pagetree']['levels'], $opt) . '</td> </tr>'; $row[] = ' <tr class="bgColor4"> <td><strong>' . $LANG->getLL('makeconfig_includeTables', 1) . '</strong>' . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'pageTreeRecordLimit', $GLOBALS['BACK_PATH'], '') . '</td> <td>' . $this->tableSelector('tx_impexp[pagetree][tables]', $inData['pagetree']['tables'], 'pages') . '<br/> ' . $LANG->getLL('makeconfig_maxNumberOfRecords', 1) . '<br/> <input type="text" name="tx_impexp[pagetree][maxNumber]" value="' . htmlspecialchars($inData['pagetree']['maxNumber']) . '"' . $this->doc->formWidth(10) . ' /><br/> </td> </tr>'; } // Single record export: if (is_array($inData['record'])) { $row[] = ' <tr class="tableheader bgColor5"> <td colspan="2">' . $LANG->getLL('makeconfig_exportSingleRecord', 1) . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'singleRecord', $GLOBALS['BACK_PATH'], '') . '</td> </tr>'; foreach ($inData['record'] as $ref) { $rParts = explode(':', $ref); $tName = $rParts[0]; $rUid = $rParts[1]; $nameSuggestion .= $tName . '_' . $rUid; $rec = t3lib_BEfunc::getRecordWSOL($tName, $rUid); $row[] = ' <tr class="bgColor4"> <td><strong>' . $LANG->getLL('makeconfig_record', 1) . '</strong></td> <td>' . t3lib_iconworks::getSpriteIconForRecord($tName, $rec) . t3lib_BEfunc::getRecordTitle($tName, $rec, TRUE) . '<input type="hidden" name="tx_impexp[record][]" value="' . htmlspecialchars($tName . ':' . $rUid) . '" /></td> </tr>'; } } // Single tables/pids: if (is_array($inData['list'])) { $row[] = ' <tr class="tableheader bgColor5"> <td colspan="2">' . $LANG->getLL('makeconfig_exportTablesFromPages', 1) . '</td> </tr>'; $tblList = ''; foreach ($inData['list'] as $ref) { $rParts = explode(':', $ref); $tName = $rParts[0]; if ($GLOBALS['BE_USER']->check('tables_select', $tName)) { $rec = t3lib_BEfunc::getRecordWSOL('pages', $rParts[1]); $tblList .= 'Table "' . $tName . '" from ' . t3lib_iconworks::getSpriteIconForRecord('pages', $rec) . t3lib_BEfunc::getRecordTitle('pages', $rec, TRUE) . '<input type="hidden" name="tx_impexp[list][]" value="' . htmlspecialchars($ref) . '" /><br/>'; } } $row[] = ' <tr class="bgColor4"> <td><strong>' . $LANG->getLL('makeconfig_tablePids', 1) . '</strong>' . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'tableList', $GLOBALS['BACK_PATH'], '') . '</td> <td>' . $tblList . '</td> </tr>'; $row[] = ' <tr class="bgColor4"> <td><strong>' . $LANG->getLL('makeconfig_maxNumberOfRecords', 1) . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'tableListMaxNumber', $GLOBALS['BACK_PATH'], '') . '</strong></td> <td> <input type="text" name="tx_impexp[listCfg][maxNumber]" value="' . htmlspecialchars($inData['listCfg']['maxNumber']) . '"' . $this->doc->formWidth(10) . ' /><br/> </td> </tr>'; } $row[] = ' <tr class="tableheader bgColor5"> <td colspan="2">' . $LANG->getLL('makeconfig_relationsAndExclusions', 1) . '</td> </tr>'; // Add relation selector: $row[] = ' <tr class="bgColor4"> <td><strong>' . $LANG->getLL('makeconfig_includeRelationsToTables', 1) . '</strong>' . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'inclRelations', $GLOBALS['BACK_PATH'], '') . '</td> <td>' . $this->tableSelector('tx_impexp[external_ref][tables]', $inData['external_ref']['tables']) . '</td> </tr>'; // Add static relation selector: $row[] = ' <tr class="bgColor4"> <td><strong>' . $LANG->getLL('makeconfig_useStaticRelationsFor', 1) . '</strong>' . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'staticRelations', $GLOBALS['BACK_PATH'], '') . '</td> <td>' . $this->tableSelector('tx_impexp[external_static][tables]', $inData['external_static']['tables']) . '<br/> <label for="checkShowStaticRelations">' . $LANG->getLL('makeconfig_showStaticRelations', 1) . '</label> <input type="checkbox" name="tx_impexp[showStaticRelations]" id="checkShowStaticRelations" value="1"' . ($inData['showStaticRelations'] ? ' checked="checked"' : '') . ' /> </td> </tr>'; // Exclude: $excludeHiddenFields = ''; if (is_array($inData['exclude'])) { foreach ($inData['exclude'] as $key => $value) { $excludeHiddenFields .= '<input type="hidden" name="tx_impexp[exclude][' . $key . ']" value="1" />'; } } $row[] = ' <tr class="bgColor4"> <td><strong>' . $LANG->getLL('makeconfig_excludeElements', 1) . '</strong>' . t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'excludedElements', $GLOBALS['BACK_PATH'], '') . '</td> <td>' . $excludeHiddenFields . ' ' . (count($inData['exclude']) ? '<em>' . implode(', ', array_keys($inData['exclude'])) . '</em><hr/><label for="checkExclude">' . $LANG->getLL('makeconfig_clearAllExclusions', 1) . '</label> <input type="checkbox" name="tx_impexp[exclude]" id="checkExclude" value="1" />' : $LANG->getLL('makeconfig_noExcludedElementsYet', 1)) . ' </td> </tr>'; // Add buttons: $row[] = ' <tr class="bgColor4"> <td> </td> <td> <input type="submit" value="' . $LANG->getLL('makeadvanc_update', 1) . '" /> <input type="hidden" name="tx_impexp[download_export_name]" value="' . substr($nameSuggestion, 0, 30) . '" /> </td> </tr>'; }
/** * Returns a record icon with title and edit link * * @param string Table name (tt_content,...) * @param array Record array * @param boolean For pages records the rootline will be rendered * @return string Rendered icon */ function getRecordInfoEditLink($refTable, $row, $showRootline = FALSE) { global $BACK_PATH, $LANG, $TCA; // Create record title or rootline for pages if option is selected if ($refTable === 'pages' and $showRootline) { $elementTitle = t3lib_BEfunc::getRecordPath($row['uid'], '1=1', 0); $elementTitle = t3lib_div::fixed_lgd_cs($elementTitle, -$BE_USER->uc['titleLen']); } else { $elementTitle = t3lib_BEfunc::getRecordTitle($refTable, $row, 1); } // Create icon for record if ($refTable === 'tx_dam') { $elementIcon = tx_dam_guiFunc::icon_getFileTypeImgTag($row, 'class="c-recicon" align="top"'); } else { $iconAltText = t3lib_BEfunc::getRecordIconAltText($row, $refTable); // Prepend table description for non-pages tables if (!($refTable === 'pages')) { $iconAltText = htmlspecialchars($LANG->sl($TCA[$refTable]['ctrl']['title']) . ': ') . $iconAltText; } $elementIcon = t3lib_iconworks::getIconImage($refTable, $row, $BACK_PATH, 'class="c-recicon" align="top" title="' . $iconAltText . '"'); } // Return item with edit link return tx_dam_SCbase::wrapLink_edit($elementIcon . $elementTitle, $refTable, $row['uid']); }
/** * Renders the display of Template Objects. * * @return void */ function renderTO() { if (intval($this->displayUid) > 0) { $row = t3lib_BEfunc::getRecordWSOL('tx_templavoila_tmplobj', $this->displayUid); if (is_array($row)) { $tRows = array(); $tRows[] = ' <tr class="bgColor5"> <td colspan="2"><strong>Template Object Details:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_to', $this->doc->backPath, '') . '</td> </tr>'; // Get title and icon: $icon = t3lib_iconworks::getIconImage('tx_templavoila_tmplobj', $row, $GLOBALS['BACK_PATH'], ' align="top" title="UID: ' . $this->displayUid . '"'); $title = t3lib_BEfunc::getRecordTitle('tx_templavoila_tmplobj', $row, 1); $tRows[] = ' <tr class="bgColor4"> <td>' . $GLOBALS['LANG']->getLL('templateObject') . ':</td> <td>' . $this->doc->wrapClickMenuOnIcon($icon, 'tx_templavoila_tmplobj', $row['uid'], 1) . $title . '</td> </tr>'; // Find the file: $theFile = t3lib_div::getFileAbsFileName($row['fileref'], 1); if ($theFile && @is_file($theFile)) { $relFilePath = substr($theFile, strlen(PATH_site)); $onCl = 'return top.openUrlInWindow(\'' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $relFilePath . '\',\'FileView\');'; $tRows[] = ' <tr class="bgColor4"> <td>' . $GLOBALS['LANG']->getLL('templateFile') . ':</td> <td><a href="#" onclick="' . htmlspecialchars($onCl) . '">' . htmlspecialchars($relFilePath) . '</a></td> </tr>'; // Finding Data Structure Record: $DSOfile = ''; $dsValue = $row['datastructure']; if ($row['parent']) { $parentRec = t3lib_BEfunc::getRecordWSOL('tx_templavoila_tmplobj', $row['parent'], 'datastructure'); $dsValue = $parentRec['datastructure']; } if (t3lib_div::testInt($dsValue)) { $DS_row = t3lib_BEfunc::getRecordWSOL('tx_templavoila_datastructure', $dsValue); } else { $DSOfile = t3lib_div::getFileAbsFileName($dsValue); } if (is_array($DS_row) || @is_file($DSOfile)) { // Get main DS array: if (is_array($DS_row)) { // Get title and icon: $icon = t3lib_iconworks::getIconImage('tx_templavoila_datastructure', $DS_row, $GLOBALS['BACK_PATH'], ' align="top" title="UID: ' . $DS_row['uid'] . '"'); $title = t3lib_BEfunc::getRecordTitle('tx_templavoila_datastructure', $DS_row, 1); $tRows[] = ' <tr class="bgColor4"> <td>Data Structure Record:</td> <td>' . $this->doc->wrapClickMenuOnIcon($icon, 'tx_templavoila_datastructure', $DS_row['uid'], 1) . $title . '</td> </tr>'; // Link to updating DS/TO: $onCl = 'index.php?file=' . rawurlencode($theFile) . '&_load_ds_xml=1&_load_ds_xml_to=' . $row['uid']; $onClMsg = ' if (confirm(unescape(\'' . rawurlencode('Warning: You should only modify Data Structures and Template Objects which have not been manually edited.' . chr(10) . 'You risk that manual changes will be removed without further notice!') . '\'))) { document.location=\'' . $onCl . '\'; } return false; '; $tRows[] = ' <tr class="bgColor4"> <td> </td> <td><input type="submit" name="_" value="Modify DS / TO" onclick="' . htmlspecialchars($onClMsg) . '"/>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_to_modifyDSTO', $this->doc->backPath, '') . '</td> </tr>'; // Read Data Structure: $dataStruct = $this->getDataStructFromDSO($DS_row['dataprot']); } else { // Show filepath of external XML file: $relFilePath = substr($DSOfile, strlen(PATH_site)); $onCl = 'return top.openUrlInWindow(\'' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $relFilePath . '\',\'FileView\');'; $tRows[] = ' <tr class="bgColor4"> <td>Data Structure File:</td> <td><a href="#" onclick="' . htmlspecialchars($onCl) . '">' . htmlspecialchars($relFilePath) . '</a></td> </tr>'; // Read Data Structure: $dataStruct = $this->getDataStructFromDSO('', $DSOfile); } // Write header of page: $content .= ' <!-- Template Object Header: --> <h3>Template Object Information:</h3> <table border="0" cellpadding="2" cellspacing="1" id="c-toHeader"> ' . implode('', $tRows) . ' </table> '; // If there is a valid data structure, draw table: if (is_array($dataStruct)) { // Working on Header and Body of HTML source: // -- Processing the header editing -- list($editContent, $currentHeaderMappingInfo) = $this->renderTO_editProcessing($dataStruct, $row, $theFile, 1); // Determine if DS is a template record and if it is a page template: $showBodyTag = !is_array($DS_row) || $DS_row['scope'] == 1 ? TRUE : FALSE; $parts = array(); $parts[] = array('label' => $GLOBALS['LANG']->getLL('tabTODetails'), 'content' => $content); // -- Processing the head editing $headerContent .= ' <!-- HTML header parts selection: --> <h3>' . $GLOBALS['LANG']->getLL('mappingHeadParts') . ': ' . $this->cshItem('xMOD_tx_templavoila', 'mapping_to_headerParts', $this->doc->backPath, '') . '</h3> ' . $this->renderHeaderSelection($theFile, $currentHeaderMappingInfo, $showBodyTag, $editContent); $parts[] = array('label' => $GLOBALS['LANG']->getLL('tabHeadParts'), 'content' => $headerContent); // -- Processing the body editing -- list($editContent, $currentMappingInfo) = $this->renderTO_editProcessing($dataStruct, $row, $theFile, 0); $bodyContent .= ' <!-- Data Structure mapping table: --> <h3>' . $GLOBALS['LANG']->getLL('mappingBodyParts') . ':</h3> ' . $this->renderTemplateMapper($theFile, $this->displayPath, $dataStruct, $currentMappingInfo, $editContent); $parts[] = array('label' => $GLOBALS['LANG']->getLL('tabBodyParts'), 'content' => $bodyContent); } else { $content .= $GLOBALS['LANG']->getLL('error') . ': No Data Structure Record could be found with UID "' . $dsValue . '"'; } } else { $content .= $GLOBALS['LANG']->getLL('error') . ': No Data Structure Record could be found with UID "' . $dsValue . '"'; } } else { $content .= $GLOBALS['LANG']->getLL('error') . ': The file "' . $row['fileref'] . '" could not be found!'; } } else { $content .= $GLOBALS['LANG']->getLL('error') . ': No Template Object Record with the UID ' . $this->displayUid; } $parts[0]['content'] = $content; } else { $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('templateObject') . ' ' . $GLOBALS['LANG']->getLL('error'), $GLOBALS['LANG']->getLL('errorNoUidFound'), 0, 1, 3); } // show tab menu if (is_array($parts)) { $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('mappingTitle'), '' . $this->doc->getDynTabMenu($parts, 'TEMPLAVOILA:templateModule:' . $this->id, 0, 0, 300), 0, 1); } }
/** * Renders the data columns * * @param array $item item array * @return array */ function getItemColumns($item) { // Columns rendering $columns = array(); foreach ($this->columnList as $field => $descr) { switch ($field) { case 'page': // Create output item for pages record $pageRow = $item[$field]; $rootline = t3lib_BEfunc::BEgetRootLine($pageRow['uid']); $pageOnClick = t3lib_BEfunc::viewOnClick($pageRow['uid'], $GLOBALS['BACK_PATH'], $rootline); $iconAltText = t3lib_BEfunc::getRecordIconAltText($pageRow, 'pages'); $icon = t3lib_iconWorks::getIconImage('pages', $pageRow, $GLOBALS['BACK_PATH'], 'title="' . $iconAltText . '" align="top"'); if ($this->showRootline) { $title = t3lib_BEfunc::getRecordPath($pageRow['uid'], '1=1', 0); $title = t3lib_div::fixed_lgd_cs($title, -$GLOBALS['BE_USER']->uc['titleLen']); } else { $title = t3lib_BEfunc::getRecordTitle('pages', $pageRow, TRUE); } if ($pageRow['doktype'] == 1 || $pageRow['doktype'] == 6) { if ($this->enableContextMenus) { $columns[$field] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($icon, 'pages', $pageRow['uid'], 1, '', '+view,edit,info') . $title; } else { $columns[$field] = '<a href="#" onclick="' . htmlspecialchars($pageOnClick) . '">' . $icon . $title . '</a>'; } } else { if ($this->enableContextMenus) { $columns[$field] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($icon, 'pages', $pageRow['uid'], 1, '', '+edit,info') . $title; } else { $columns[$field] = $icon . $title; } } break; case 'content_element': // Create output item for content record $refTable = $item['tablenames']; $refRow = $item[$field]; if ($refTable == 'pages') { // The reference to the media is on a field of a page record if ($GLOBALS['BE_USER']->isInWebMount($refRow['uid']) && $GLOBALS['BE_USER']->doesUserHaveAccess($refRow, 1)) { $columns[$field] = tx_dam_SCbase::getRecordInfoEditLink($refTable, $refRow); } else { $pageRow = $refRow; $rootline = t3lib_BEfunc::BEgetRootLine($pageRow['uid']); $pageOnClick = t3lib_BEfunc::viewOnClick($pageRow['uid'], $GLOBALS['BACK_PATH'], $rootline); $iconAltText = t3lib_BEfunc::getRecordIconAltText($refRow, $refTable); $icon = t3lib_iconworks::getIconImage($refTable, $refRow, $GLOBALS['BACK_PATH'], 'class="c-recicon" align="top" title="' . $iconAltText . '"'); $title = t3lib_BEfunc::getRecordTitle($refTable, $refRow, 1); if ($pageRow['doktype'] == 1 || $pageRow['doktype'] == 6) { $columns[$field] = '<a href="#" onclick="' . htmlspecialchars($pageOnClick) . '">' . $icon . $title . '</a>'; } else { $columns[$field] = $icon . $title; } } } else { // The reference to the media is on a field of a content element record if ($GLOBALS['BE_USER']->isInWebMount($pageRow['uid']) && $GLOBALS['BE_USER']->doesUserHaveAccess($pageRow, 1)) { $columns[$field] = tx_dam_SCbase::getRecordInfoEditLink($refTable, $refRow); } else { $pageRow = $item['page']; $rootline = t3lib_BEfunc::BEgetRootLine($pageRow['uid']); $pageOnClick = t3lib_BEfunc::viewOnClick($pageRow['uid'], $GLOBALS['BACK_PATH'], $rootline); $iconAltText = t3lib_BEfunc::getRecordIconAltText($refRow, $refTable); $icon = t3lib_iconworks::getIconImage($refTable, $refRow, $GLOBALS['BACK_PATH'], 'class="c-recicon" align="top" title="' . $iconAltText . '"'); $title = t3lib_BEfunc::getRecordTitle($refTable, $refRow, 1); if ($pageRow['doktype'] == 1 || $pageRow['doktype'] == 6) { $columns[$field] = '<a href="#" onclick="' . htmlspecialchars($pageOnClick) . '">' . $icon . $title . '</a>'; } else { $columns[$field] = $icon . $title; } } } break; case 'content_field': // Create output item for reference field $columns[$field] = $item[$field]; break; case 'softref_key': // Create output item for reference key $columns[$field] = $item['softref_key'] ? $GLOBALS['LANG']->sl('LLL:EXT:dam/lib/locallang.xml:softref_key_' . $item['softref_key']) : $GLOBALS['LANG']->sl('LLL:EXT:dam/lib/locallang.xml:softref_key_media'); break; case 'content_age': // Create output text describing the age of the content element $columns[$field] = t3lib_BEfunc::dateTimeAge($item[$field], 1); break; case 'media_element': // Create output item for tx_dam record $columns[$field] = tx_dam_SCbase::getRecordInfoEditLink('tx_dam', $item); break; case 'media_element_age': // Create output text describing the tx_dam record age $columns[$field] = t3lib_BEfunc::dateTimeAge($item['tstamp'], 1); break; case '_CLIPBOARD_': $columns[$field] = $this->clipboard_getItemControl($item); break; case '_CONTROL_': $columns[$field] = $this->getItemControl($item); $this->columnTDAttr[$field] = ' nowrap="nowrap"'; break; default: $content = $item[$field]; $columns[$field] = htmlspecialchars(t3lib_div::fixed_lgd_cs($content, $this->titleLength)); break; } if ($columns[$field] === '') { $columns[$field] = ' '; } } // Thumbsnails? if ($this->showThumbs and $this->thumbnailPossible($item)) { $columns['media_element'] .= '<div style="margin:2px 0 2px 0;">' . $this->getThumbNail($item) . '</div>'; } return $columns; }
/** * Creates the overview menu. * * @return void */ protected function func_default() { $availableModFuncs = array('records', 'relations', 'search', 'filesearch', 'refindex'); $content = '<dl class="t3-overview-list">'; foreach ($availableModFuncs as $modFunc) { $functionUrl = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('tools_dbint') . '&SET[function]=' . $modFunc; $title = $GLOBALS['LANG']->getLL($modFunc); $description = $GLOBALS['LANG']->getLL($modFunc . '_description'); $icon = '<img src="' . \t3lib_iconworks::skinImg($GLOBALS['BACK_PATH'], 'MOD:tools_dbint/db.gif', '', 1) . '" width="16" height="16" title="' . $title . '" alt="' . $title . '" />'; $content .= ' <dt><a href="' . htmlspecialchars($functionUrl) . '">' . $icon . $title . '</a></dt> <dd>' . $description . '</dd> '; } $content .= '</dl>'; $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->section('', $content, FALSE, TRUE); }
/** * Shows an overview list of available reports. * * @return string list of available reports */ protected function indexAction() { $defaultIcon = t3lib_extMgm::extRelPath('reports') . 'mod/moduleicon.gif'; $content = '<dl class="report-list">'; $reports = array(); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'] as $extKey => $extensionReports) { foreach ($extensionReports as $reportName => $report) { $action = $extKey . '.' . $reportName; $link = 'mod.php?M=tools_txreportsM1' . htmlspecialchars('&SET[function]=') . $action; $reportTitle = $GLOBALS['LANG']->sL($report['title']); // Set default report icon $icon = $defaultIcon; // Check for custom icon if (!empty($report['icon'])) { $absIconPath = t3lib_div::getFileAbsFilename($report['icon']); // If the file indeed exists, assemble relative path to it if (file_exists($absIconPath)) { $icon = $GLOBALS['BACK_PATH'] . '../' . str_replace(PATH_site, '', $absIconPath); } } $icon = '<img' . t3lib_iconworks::skinImg($GLOBALS['BACK_PATH'], $icon, 'width="16" height="16"') . ' title="' . $reportTitle . '" alt="' . $reportTitle . '" />'; $reportContent = '<dt><a href="' . $link . '">' . $icon . $reportTitle . '</a></dt>'; $reportContent .= '<dd>' . $GLOBALS['LANG']->sL($report['description']) . '</dd>'; $reports[$reportTitle] = $reportContent; } } ksort($reports); foreach ($reports as $reportContent) { $content .= $reportContent; } return $content . '</dl>'; }
/** * Gets an HTML image tag with the URL of the icon file of the record as * configured in TCA. * * @return string our HTML image tag with the URL of the icon file of * the record or a "not found" icon if there's no icon * for this record */ public function getRecordIcon() { $iconProperties = array(); if (t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) < 6001000) { t3lib_div::loadTCA($this->tableName); } $tableConfiguration =& $GLOBALS['TCA'][$this->tableName]['ctrl']; $hiddenColumn = $tableConfiguration['enablecolumns']['disabled']; $startTimeColumn = $tableConfiguration['enablecolumns']['starttime']; $endTimeColumn = $tableConfiguration['enablecolumns']['endtime']; // Checks if there are enable columns configured in TCA and sends them // as parameter to t3lib_iconworks::getIcon(). if ($this->getRecordPropertyBoolean($hiddenColumn)) { $iconProperties[$hiddenColumn] = $this->getRecordPropertyInteger($hiddenColumn); } if ($this->hasRecordPropertyInteger($startTimeColumn)) { $iconProperties[$startTimeColumn] = $this->getRecordPropertyInteger($startTimeColumn); } if ($this->hasRecordPropertyInteger($endTimeColumn)) { $iconProperties[$endTimeColumn] = $this->getRecordPropertyInteger($endTimeColumn); } if (isset($tableConfiguration['typeicon_column'])) { $typeIconColumn = $tableConfiguration['typeicon_column']; $iconProperties[$typeIconColumn] = $this->getRecordPropertyInteger($typeIconColumn); } $imageURL = $GLOBALS['BACK_PATH'] . t3lib_iconworks::getIcon($this->tableName, $iconProperties); return '<img src="' . $imageURL . '" title="id=' . $this->getUid() . '" alt="' . $this->getUid() . '" />'; }
/** * Action to edit records * * @param array $record: sys_action record * @return string list of records */ protected function viewEditRecord($record) { $content = ''; $actionList = array(); $dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup'); $dbAnalysis->fromTC = 0; $dbAnalysis->start($record['t4_recordsToEdit'], '*'); $dbAnalysis->getFromDB(); // collect the records foreach ($dbAnalysis->itemArray as $el) { $path = t3lib_BEfunc::getRecordPath($el['id'], $this->taskObject->perms_clause, $GLOBALS['BE_USER']->uc['titleLen']); $record = t3lib_BEfunc::getRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']]); $title = t3lib_BEfunc::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]); $description = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$el['table']]['ctrl']['title'], 1); if (isset($record['crdate'])) { // @todo: which information could be needfull $description .= ' - ' . t3lib_BEfunc::dateTimeAge($record['crdate']); } $actionList[$el['id']] = array('title' => $title, 'description' => t3lib_BEfunc::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]), 'descriptionHtml' => $description, 'link' => $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")) . '&edit[' . $el['table'] . '][' . $el['id'] . ']=edit', 'icon' => t3lib_iconworks::getSpriteIconForRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']], array('title' => htmlspecialchars($path)))); } // render the record list $content .= $this->taskObject->renderListMenu($actionList); return $content; }
/** * This method gets the title and the icon for a given record of a given table * It returns these as a HTML string * * @param string $table: name of the table * @param integer $uid: primary key of the record * @return string HTML to display */ function getRecordDetails($table, $uid) { global $BACK_PATH; if (empty($table) || empty($uid)) { return ''; } else { $row = array(); if (isset($this->records[$table][$uid])) { $row = $this->records[$table][$uid]; } else { $row = t3lib_BEfunc::getRecord($table, $uid); } $iconAltText = t3lib_BEfunc::getRecordIconAltText($row, $table); $elementTitle = t3lib_BEfunc::getRecordTitle($table, $row, 1); $elementIcon = t3lib_iconworks::getIconImage($table, $row, $BACK_PATH, 'class="c-recicon" title="' . $iconAltText . '"'); return $elementIcon . $elementTitle; } }
/** * Creates the overview menu. * */ protected function func_default() { $availableModFuncs = array('records', 'relations', 'search', 'filesearch', 'refindex'); $moduleTitle = $GLOBALS['LANG']->getLL('title'); $content = '<dl class="t3-overview-list">'; foreach ($availableModFuncs as $modFunc) { $link = 'index.php?SET[function]=' . $modFunc; $title = $GLOBALS['LANG']->getLL($modFunc); $description = $GLOBALS['LANG']->getLL($modFunc . '_description'); $icon = '<img src="' . t3lib_iconworks::skinImg($GLOBALS['BACK_PATH'], 'MOD:tools_dbint/db.gif', '', 1) . '" width="16" height="16" title="' . $title . '" alt="' . $title . '" />'; $content .= ' <dt><a href="' . $link . '">' . $icon . $title . '</a></dt> <dd>' . $description . '</dd> '; } $content .= '</dl>'; $this->content .= $this->doc->section($moduleTitle, $content, false, true); }