/** * Get icon for the row. * If $this->iconPath and $this->iconName is set, try to get icon based on those values. * * @param array Item row. * @return string Image tag. */ function getIcon($row) { $lConf =& $this->tt_news_obj->conf['displayCatMenu.']; $catIconMode = intval($lConf['catmenuIconMode']); if ($this->iconPath && $this->iconName) { $icon = '<img' . t3lib_iconWorks::skinImg('', $this->iconPath . $this->iconName, 'width="18" height="16"') . ' alt="" />'; } else { switch ($catIconMode) { case 1: // icon from cat db-record if ($row['image']) { $iconConf['image.']['file'] = 'uploads/pics/' . $row['image']; } break; case 2: // own icons $iconConf['image.']['file'] = $lConf['catmenuIconPath'] . $lConf['catmenuIconFile']; break; case -1: // no icons $iconConf['image.']['file'] = ''; break; } if ($iconConf['image.']['file']) { $iconConf['image.']['file.'] = $lConf['catmenuIconFile.']; $icon = $GLOBALS['TSFE']->cObj->IMAGE($iconConf['image.']); } } if (!$icon && !$catIconMode) { $icon = t3lib_iconWorks::getIconImage($this->table, $row, $this->backPath, ' class="c-recIcon"'); } return $this->wrapIcon($icon, $row); }
/** * Generates a list of user names that has access to the workspace. * * @param array A list of user IDs separated by comma * @param string Access string * @return string Generated content */ function workspaceList_getUserListWithAccess(&$list, $access) { $content_array = array(); if ($list != '') { $userIDs = explode(',', $list); // get user names and sort $regExp = '/^(be_[^_]+)_(\\d+)$/'; $groups = false; foreach ($userIDs as $userUID) { $id = $userUID; if (preg_match($regExp, $userUID)) { $table = preg_replace($regExp, '\\1', $userUID); $id = intval(preg_replace($regExp, '\\2', $userUID)); if ($table == 'be_users') { // user $icon = $GLOBALS['TCA']['be_users']['typeicons'][$this->be_user_Array[$id]['admin']]; if ($id == $GLOBALS['BE_USER']->user['uid']) { // highlight current user $tag0 = '<span class="ver-wl-current-user">'; $tag1 = '</span>'; } else { $tag0 = $tag1 = ''; } $content_array[] = $this->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getIconImage($table, $this->be_user_Array[$id], $GLOBALS['BACK_PATH'], ' align="middle" alt="UID: ' . $id . '"'), $table, $id, 2) . $tag0 . htmlspecialchars($this->be_user_Array_full[$id]['username']) . $tag1; } else { // group if (false === $groups) { $groups = t3lib_BEfunc::getGroupNames(); } $content_array[] = $this->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getIconImage($table, $groups[$id], $GLOBALS['BACK_PATH'], ' align="middle" alt="UID: ' . $id . '"'), $table, $id, 2) . $groups[$id]['title']; } } else { // user id if ($userUID == $GLOBALS['BE_USER']->user['uid']) { // highlight current user $tag0 = '<span class="ver-wl-current-user">'; $tag1 = '</span>'; } else { $tag0 = $tag1 = ''; } $content_array[] = t3lib_iconWorks::getIconImage('be_users', $this->be_user_Array[$id], $GLOBALS['BACK_PATH'], ' align="middle" alt="UID: ' . $id . '"') . $tag0 . htmlspecialchars($this->be_user_Array_full[$userUID]['username']) . $tag1; } } sort($content_array); } else { $content_array[] = ' –'; } $content = '<tr><td class="ver-wl-details-label ver-wl-details-user-list-label">'; // TODO CSH lable explaining access here? $content .= '<strong>' . $access . '</strong></td>'; $content .= '<td class="ver-wl-details">' . implode('<br />', $content_array) . '</td></tr>'; return $content; }
/** * Factory method to create AccumulatedInformations Object (e.g. build tree etc...) (Factorys should have all dependencies passed as parameter) * * @param int $sysLang sys_language_uid * @param mixed $overrideStartingPoint optional override startingpoint TODO! * @return tx_l10nmgr_l10nAccumulatedInformations **/ function getL10nAccumulatedInformationsObjectForLanguage($sysLang, $overrideStartingPoint = '') { $l10ncfg = $this->l10ncfg; // Showing the tree: // Initialize starting point of page tree: $treeStartingPoint = intval($l10ncfg['depth'] == -1 ? t3lib_div::_GET('srcPID') : $l10ncfg['pid']); $treeStartingRecord = t3lib_BEfunc::getRecordWSOL('pages', $treeStartingPoint); $depth = $l10ncfg['depth']; // Initialize tree object: /** @var $tree t3lib_pageTree */ $tree = t3lib_div::makeInstance('t3lib_pageTree'); $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1)); $tree->addField('l18n_cfg'); // Creating top icon; the current page $HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align="top"'); $tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => $HTML); // Create the tree from starting point: if ($depth > 0) { $tree->getTree($treeStartingPoint, $depth, ''); } //now create and init accum Info object: /** @var $accumObj tx_l10nmgr_l10nAccumulatedInformations */ $accumObj = t3lib_div::makeInstance('tx_l10nmgr_l10nAccumulatedInformations', $tree, $l10ncfg, $sysLang); return $accumObj; }
/** * Render statistics about lostrecords * * @return array array($countTotal, $content) */ function statisticsLostRecords() { global $LANG, $TCA; $content = ''; $countTotal = 0; // init table layout $tableLayout = array('table' => array('<table border="0" cellspacing="1" cellpadding="2" style="width:auto;">', '</table>'), '0' => array('tr' => array('<tr class="bgColor2">', '</tr>'), 'defCol' => array('<td align="center">', '</td>')), 'defRow' => array('tr' => array('<tr class="bgColor3-20">', '</tr>'), '1' => array('<td align="center">', '</td>'), 'defCol' => array('<td>', '</td>'))); $tableOutput = array(); $tr = 0; // add header row $tableOutput[$tr][] = 'Table'; $tableOutput[$tr][] = 'Count'; $mediaTables = tx_dam::register_getEntries('mediaTable'); foreach ($mediaTables as $table) { $count = 0; $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('COUNT(uid) as count', $table, $table . '.pid NOT IN (' . tx_dam_db::getPidList() . ')'); if ($res) { $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); $count = $row['count']; $countTotal += $count; } $title = is_array($TCA[$table]) ? $GLOBALS['LANG']->sl($TCA[$table]['ctrl']['title']) : $table; $icon = t3lib_iconWorks::getIconImage($table, array(), $GLOBALS['BACK_PATH'], ' align="top"'); // add row to table $tr++; $tableOutput[$tr][] = $icon . $title . ' (' . $table . ')'; $tableOutput[$tr][] = $count; } $content .= $this->pObj->doc->table($tableOutput, $tableLayout); return array($countTotal, $content); }
/** * Returns an icon image tag, 18x16 pixels, based on input information. * This function is recommended to use in your backend modules. * Usage: 60 * * @param string The table name * @param array The table row ("enablefields" are at least needed for correct icon display and for pages records some more fields in addition!) * @param string The backpath to the main TYPO3 directory (relative path back to PATH_typo3) * @param string Additional attributes for the image tag * @param boolean If set, the icon will be grayed/shaded * @return string <img>-tag * @see getIcon() */ public function getIconImage($table, $row = array(), $backPath, $params = '', $shaded = FALSE) { /** @noinspection PhpDeprecationInspection PhpUndefinedClassInspection PhpUndefinedMethodInspection */ return t3lib_iconWorks::getIconImage($table, $row, $backPath, $params, $shaded); }
/** * Rendering the localization information table. * * @param array The Page tree data * @return string HTML for the localization information table. */ function renderL10nTable(&$tree) { global $LANG; // Title length: $titleLen = $GLOBALS['BE_USER']->uc['titleLen']; // Put together the TREE: $output = ''; $newOL_js = array(); $langRecUids = array(); //Init DDD $dao = t3lib_div::makeInstance('tx_languagevisibility_daocommon'); if (version_compare(TYPO3_version, '4.3.0', '<')) { $elementfactory = new tx_languagevisibility_elementFactory($dao); } else { $elementfactory = t3lib_div::makeInstance('tx_languagevisibility_elementFactory', $dao); } $languageRep = t3lib_div::makeInstance('tx_languagevisibility_languagerepository'); $languageList = $languageRep->getLanguages(); $visibility = t3lib_div::makeInstance('tx_languagevisibility_visibilityService'); //traverse Tree: foreach ($tree->tree as $data) { $tCells = array(); $element = $elementfactory->getElementForTable('pages', $data['row']['uid']); //first cell (tree): // Page icons / titles etc. $tCells[] = '<td' . ($data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '') . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $titleLen)) . (strcmp($data['row']['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['nav_title'], $titleLen)) . '</em>]' : '') . '</td>'; //language cells: foreach ($languageList as $language) { $info = ''; $editUid = $data['row']['uid']; $params = '&edit[pages][' . $editUid . ']=edit'; $langId = $language->getUid(); if ($visibility->isVisible($language, $element)) { $isVisible = TRUE; $statusVis = 'c-visible'; } else { $isVisible = FALSE; $statusVis = 'c-notvisible'; } if ($element->hasTranslation($langId)) { $statusTrans = 'c-translated'; } else { $statusTrans = 'c-nottranslated'; } if ($language->getUid() == 0) { //Default //"View page" link is created: $viewPageLink = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($data['row']['uid'], $GLOBALS['BACK_PATH'], '', '', '', '&L=###LANG_UID###')) . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_viewPage', '1') . '" border="0" alt="" />' . '</a>'; $info .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editDefaultLanguagePage', '1') . '" border="0" alt="" />' . '</a>'; $info .= '<a href="#" onclick="' . htmlspecialchars('top.loadEditId(' . intval($data['row']['uid']) . ',"&SET[language]=0"); return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit_page.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editPage', '1') . '" border="0" alt="" />' . '</a>'; $info .= str_replace('###LANG_UID###', '0', $viewPageLink); $info .= $data['row']['l18n_cfg'] & 1 ? '<span title="' . $LANG->sL('LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg.I.1', '1') . '">D</span>' : ' '; // Put into cell: $tCells[] = '<td class="' . $statusTrans . ' c-leftLine">' . $info . '</td>'; $tCells[] = '<td class="' . $statusTrans . '" title="' . $LANG->getLL('lang_renderl10n_CEcount', '1') . '" align="center">' . $this->getContentElementCount($data['row']['uid'], 0) . '</td>'; } else { //Normal Language: if ($element->hasTranslation($langId)) { $status = 'c-ok'; $overLayRow = $element->getOverLayRecordForCertainLanguage($langId); //add uid of overlay to list of editable records: $langRecUids[$langId][] = $overLayRow['uid']; $icon = t3lib_iconWorks::getIconImage('pages_language_overlay', $overLayRow, $GLOBALS['BACK_PATH'], 'align="top" class="c-recIcon"'); $info = $icon . htmlspecialchars(t3lib_div::fixed_lgd_cs($overLayRow['title'], $titleLen)) . (strcmp($overLayRow['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($overLayRow['nav_title'], $titleLen)) . '</em>]' : '') . ($row['_COUNT'] > 1 ? '<div>' . $LANG->getLL('lang_renderl10n_badThingThereAre', '1') . '</div>' : ''); $tCells[] = '<td class="' . $statusTrans . ' c-leftLine">' . $info . '</td>'; // Edit whole record: $info = ''; $editUid = $overLayRow['uid']; $params = '&edit[pages_language_overlay][' . $editUid . ']=edit'; $info .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editLanguageOverlayRecord', '1') . '" border="0" alt="" />' . '</a>'; $info .= '<a href="#" onclick="' . htmlspecialchars('top.loadEditId(' . intval($data['row']['uid']) . ',"&SET[language]=' . $langId . '"); return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit_page.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editPageLang', '1') . '" border="0" alt="" />' . '</a>'; $info .= str_replace('###LANG_UID###', $langId, $viewPageLink); $tCells[] = '<td class="' . $statusTrans . '">' . $info . '</td>'; $tCells[] = '<td class="' . $statusTrans . '" title="' . $LANG->getLL('lang_renderl10n_CEcount', '1') . '" align="center">' . $this->getContentElementCount($data['row']['uid'], $langId) . '</td>'; } else { $status = t3lib_div::hideIfNotTranslated($data['row']['l18n_cfg']) || $data['row']['l18n_cfg'] & 1 ? 'c-blocked' : 'c-fallback'; $tCells[] = '<td class="' . $statusTrans . ' c-leftLine"> </td>'; $tCells[] = '<td class="' . $statusTrans . '"> </td>'; //add to JS $infoCell = '<input type="checkbox" name="newOL[' . $langId . '][' . $data['row']['uid'] . ']" value="1" />'; $newOL_js[$langId] .= ' +(document.webinfoForm[\'newOL[' . $langId . '][' . $data['row']['uid'] . ']\'].checked ? \'&edit[pages_language_overlay][' . $data['row']['uid'] . ']=new\' : \'\') '; $tCells[] = '<td class="' . $statusTrans . '">' . $infoCell . '</td>'; } } //last cell show status $tCells[] = '<td class="' . $statusVis . '">' . $this->_getStatusImage($isVisible) . '</td>'; } $output .= ' <tr class="bgColor5"> ' . implode(' ', $tCells) . ' </tr>'; } //first ROW: //**************** $firstRowCells[] = '<td>' . $LANG->getLL('lang_renderl10n_page', '1') . ':</td>'; foreach ($languageList as $language) { $langId = $language->getUid(); if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int) $this->pObj->MOD_SETTINGS['lang'] === (int) $langId) { $firstRowCells[] = '<td class="c-leftLine">' . $language->getTitle() . $language->getFlagImg() . '</td>'; if ($langId == 0) { $firstRowCells[] = '<td></td>'; $firstRowCells[] = '<td></td>'; } else { // Title: // Edit language overlay records: if (is_array($langRecUids[$langId])) { $params = '&edit[pages_language_overlay][' . implode(',', $langRecUids[$langId]) . ']=edit&columnsOnly=title,nav_title,hidden'; $firstRowCells[] = '<td><a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '"> <img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editLangOverlays', '1') . '" border="0" alt="" /> </a></td>'; } else { $firstRowCells[] = '<td> </td>'; } // Create new overlay records: $params = "'" . $newOL_js[$langId] . "+'&columnsOnly=title,hidden,sys_language_uid&defVals[pages_language_overlay][sys_language_uid]=" . $langId; $firstRowCells[] = '<td><a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '"> <img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_el.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_getlangsta_createNewTranslationHeaders', '1') . '" border="0" alt="" /> </a></td>'; $firstRowCells[] = '<td></td>'; } } } $output = ' <tr class="bgColor4"> ' . implode(' ', $firstRowCells) . ' </tr>' . $output; $output = ' <table border="0" cellspacing="0" cellpadding="0" id="langTable">' . $output . ' </table>'; return $output; }
/** * Main function, adding items to the click menu array. * * @param object Reference to the parent object of the clickmenu class which calls this function * @param array The current array of menu items - you have to add or remove items to this array in this function. Thats the point... * @param string The database table OR filename * @param integer For database tables, the UID * @return array The modified menu array. */ function main(&$backRef, $menuItems, $table, $uid) { global $BE_USER, $LANG, $TYPO3_DB; $localItems = array(); if (!$backRef->cmLevel) { $LL = $LANG->includeLLFile(t3lib_extMgm::extPath('templavoila') . 'locallang.xml', 0); // Adding link for Mapping tool: if (@is_file($table)) { if ($BE_USER->isAdmin()) { if (function_exists('finfo_open')) { $fi = finfo_open(FILEINFO_MIME); $enabled = @finfo_file($fi, $table) == 'text/html'; finfo_close($fi); } else { $pi = @pathinfo($table); $enabled = preg_match('/(html?|tmpl)/', $pi['extension']); } if ($enabled) { $url = t3lib_extMgm::extRelPath('templavoila') . 'cm1/index.php?file=' . rawurlencode($table); $localItems[] = $backRef->linkItem($LANG->getLLL('cm1_title', $LL, 1), $backRef->excludeIcon('<img src="' . $backRef->backPath . t3lib_extMgm::extRelPath('templavoila') . 'cm1/cm_icon.gif" width="15" height="12" border="0" align="top" alt="" />'), $backRef->urlRefForCM($url), 1); } } } elseif (t3lib_div::inList('tx_templavoila_tmplobj,tx_templavoila_datastructure,tx_templavoila_content', $table)) { $url = t3lib_extMgm::extRelPath('templavoila') . 'cm1/index.php?table=' . rawurlencode($table) . '&uid=' . $uid . '&_reload_from=1'; $localItems[] = $backRef->linkItem($LANG->getLLL('cm1_title', $LL, 1), $backRef->excludeIcon('<img src="' . $backRef->backPath . t3lib_extMgm::extRelPath('templavoila') . 'cm1/cm_icon.gif" width="15" height="12" border="0" align="top" alt="" />'), $backRef->urlRefForCM($url), 1); } $isTVelement = ('tt_content' == $table && $backRef->rec['CType'] == 'templavoila_pi1' || 'pages' == $table) && $backRef->rec['tx_templavoila_flex']; // Adding link for "View: Sub elements": if ($table == 'tt_content' && $isTVelement) { $localItems = array(); $url = t3lib_extMgm::extRelPath('templavoila') . 'mod1/index.php?id=' . intval($backRef->rec['pid']) . '&altRoot[table]=' . rawurlencode($table) . '&altRoot[uid]=' . $uid . '&altRoot[field_flex]=tx_templavoila_flex'; $localItems[] = $backRef->linkItem($LANG->getLLL('cm1_viewsubelements', $LL, 1), $backRef->excludeIcon('<img src="' . $backRef->backPath . t3lib_extMgm::extRelPath('templavoila') . 'cm1/cm_icon.gif" width="15" height="12" border="0" align="top" alt="" />'), $backRef->urlRefForCM($url), 1); } // Adding link for "View: Flexform XML" (admin only): if ($BE_USER->isAdmin() && $isTVelement) { $url = t3lib_extMgm::extRelPath('templavoila') . 'cm2/index.php?' . '&viewRec[table]=' . rawurlencode($table) . '&viewRec[uid]=' . $uid . '&viewRec[field_flex]=tx_templavoila_flex'; $localItems[] = $backRef->linkItem($LANG->getLLL('cm1_viewflexformxml', $LL, 1), $backRef->excludeIcon('<img src="' . $backRef->backPath . t3lib_extMgm::extRelPath('templavoila') . 'cm2/cm_icon.gif" width="15" height="12" border="0" align="top" alt="" />'), $backRef->urlRefForCM($url), 1); } // Adding link for "View: DS/TO" (admin only): if ($BE_USER->isAdmin() && $isTVelement) { if (t3lib_div::testInt($backRef->rec['tx_templavoila_ds'])) { $url = t3lib_extMgm::extRelPath('templavoila') . 'cm1/index.php?' . 'table=tx_templavoila_datastructure&uid=' . $backRef->rec['tx_templavoila_ds']; $localItems[] = $backRef->linkItem($LANG->getLLL('cm_viewdsto', $LL, 1) . ' [' . $backRef->rec['tx_templavoila_ds'] . '/' . $backRef->rec['tx_templavoila_to'] . ']', $backRef->excludeIcon('<img src="' . $backRef->backPath . t3lib_extMgm::extRelPath('templavoila') . 'cm2/cm_icon.gif" width="15" height="12" border="0" align="top" alt="" />'), $backRef->urlRefForCM($url), 1); } } # if ($table=='tt_content') { # // Adding link for "Pages using this element": # $localItems[] = $backRef->linkItem( # $LANG->getLLL('cm1_pagesusingthiselement',$LL), # $backRef->excludeIcon('<img src="'.t3lib_extMgm::extRelPath('templavoila').'cm1/cm_icon_activate.gif" width="15" height="12" border=0 align=top>'), # "top.loadTopMenu('".t3lib_div::linkThisScript()."&cmLevel=1&subname=tx_templavoila_cm1_pagesusingthiselement');return false;", # 0, # 1 # ); # } } else { if (t3lib_div::GPvar('subname') == 'tx_templavoila_cm1_pagesusingthiselement') { $menuItems = array(); $url = t3lib_extMgm::extRelPath('templavoila') . 'mod1/index.php?id='; // Generate a list of pages where this element is also being used: $res = $TYPO3_DB->exec_SELECTquery('*', 'tx_templavoila_elementreferences', 'uid=' . $backRef->rec['uid']); if ($res) { while (false != ($referenceRecord = $TYPO3_DB->sql_fetch_assoc($res))) { $pageRecord = t3lib_beFunc::getRecord('pages', $referenceRecord['pid']); $icon = t3lib_iconWorks::getIconImage('pages', $pageRecord, $backRef->backPath); // To do: Display language flag icon and jump to correct language # if ($referenceRecord['lkey'] != 'lDEF') { # $icon .= ' lKey:'.$referenceRecord['lkey']; # } elseif ($referenceRecord['vkey'] != 'vDEF') { # $icon .= ' vKey:'.$referenceRecord['vkey']; # } if (is_array($pageRecord)) { $menuItems[] = $backRef->linkItem($icon, t3lib_beFunc::getRecordTitle('pages', $pageRecord, 1), $backRef->urlRefForCM($url . $pageRecord['uid']), 1); } } } } } // Simply merges the two arrays together and returns ... if (count($localItems)) { $menuItems = array_merge($menuItems, $localItems); } return $menuItems; }
/** * 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; }
/** * Creating the module output. * * @return void * @todo provide position mapping if no position is given already. Like the columns selector but for our cascading element style ... */ function main() { global $LANG, $BACK_PATH, $BE_USER; if ($this->id && $this->access) { // Creating content $this->content = ''; $this->content .= $this->doc->startPage($LANG->getLL('newContentElement')); $this->content .= $this->doc->header($LANG->getLL('newContentElement')); $this->content .= $this->doc->spacer(5); $elRow = t3lib_BEfunc::getRecordWSOL('pages', $this->id); $header = t3lib_iconWorks::getIconImage('pages', $elRow, $BACK_PATH, ' title="' . htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($elRow, 'pages')) . '" align="top"'); $header .= t3lib_BEfunc::getRecordTitle('pages', $elRow, 1); $this->content .= $this->doc->section('', $header, 0, 1); $this->content .= $this->doc->spacer(10); // Wizard $wizardCode = ''; $tableRows = array(); $wizardItems = $this->getWizardItems(); // Traverse items for the wizard. // An item is either a header or an item rendered with a title/description and icon: $counter = 0; // # // ### Mansoor Ahmad @ Gosign media. GmbH - Set it for ... // # $ignoreList = 'list,templavoila_pi1'; foreach ($wizardItems as $key => $wizardItem) { if ($wizardItem['header']) { if ($counter > 0) { $tableRows[] = ' <tr> <td colspan="3"><br /></td> </tr>'; } $tableRows[] = ' <tr class="bgColor5"> <td colspan="3"><strong>' . htmlspecialchars($wizardItem['header']) . '</strong></td> </tr>'; } else { $tableLinks = array(); // href URI for icon/title: $newRecordLink = 'index.php?' . $this->linkParams() . '&createNewRecord=' . rawurlencode($this->parentRecord) . $wizardItem['params']; // Icon: $iInfo = @getimagesize($wizardItem['icon']); $tableLinks[] = '<a href="' . $newRecordLink . '"><img' . t3lib_iconWorks::skinImg($this->doc->backPath, $wizardItem['icon'], '') . ' alt="" /></a>'; // Title + description: $tableLinks[] = '<a href="' . $newRecordLink . '"><strong>' . htmlspecialchars($wizardItem['title']) . '</strong><br />' . nl2br(htmlspecialchars(trim($wizardItem['description']))) . '</a>'; // Finally, put it together in a table row: // # // ### Mansoor Ahmad @ Gosign media. GmbH - start // # //print_r($wizardItems); $actionForm = 'db_new_content_el.php?' . $this->linkParams() . '&parentRecord=' . t3lib_div::GPvar('parentRecord'); if (t3lib_div::GPvar('count') == $counter && t3lib_div::GPvar('go_backend_layout_edit') == 1) { $tableRows[] = ' <tr> <td valign="top" colspan="3">' . $this->getEditTable($wizardItem, $actionForm) . ' <a name="' . $wizardItem['tt_content_defValues']['CType'] . '" /> </td> </tr>'; } else { $tableRows[] = ' <tr> <td valign="top"><a name="' . $wizardItem['tt_content_defValues']['CType'] . '" />' . implode('</td> <td valign="top">', $tableLinks) . '</td> <td valign="top">' . ($BE_USER->isAdmin() && !in_array($wizardItem['tt_content_defValues']['CType'], explode(',', $ignoreList)) ? '<a href="db_new_content_el.php?' . $this->linkParams() . '&parentRecord=' . t3lib_div::GPvar('parentRecord') . '&go_backend_layout_edit=1&count=' . $counter . '#' . $wizardItem['tt_content_defValues']['CType'] . '"><img src="../../../../typo3/sysext/t3skin/icons/gfx/edit2.gif" /></a>' : '') . '</td> </tr>'; $editData = array('CType' => t3lib_div::GPvar('CType'), 'title' => t3lib_div::GPvar('title'), 'desc' => t3lib_div::GPvar('desc')); if ($editData['CType'] == $wizardItem['tt_content_defValues']['CType']) { $this->saveEditTableData($editData, $wizardItem); } elseif (t3lib_div::GPvar('submit')) { header('location:' . $actionForm . '#' . t3lib_div::GPvar('CType')); } } // # // ### Mansoor Ahmad @ Gosign media. GmbH - end // # $counter++; } } // Add the wizard table to the content: $wizardCode .= $LANG->getLL('sel1', 1) . '<br /><br /> <!-- Content Element wizard table: --> <table border="0" cellpadding="1" cellspacing="2" id="typo3-ceWizardTable" style="float:left;"> ' . implode('', $tableRows) . ' </table> '; $this->content .= $this->doc->section($LANG->getLL('1_selectType'), $wizardCode, 0, 1); } else { // In case of no access: $this->content = ''; $this->content .= $this->doc->startPage($LANG->getLL('newContentElement')); $this->content .= $this->doc->header($LANG->getLL('newContentElement')); $this->content .= $this->doc->spacer(5); } }
/** * Main function * * @return string Output HTML for the module. * @access public */ function main() { global $BACK_PATH, $LANG, $SOBE, $BE_USER, $TYPO3_DB; $output = ''; $this->templavoilaAPIObj = t3lib_div::makeInstance('tx_templavoila_api'); // Showing the tree: // Initialize starting point of page tree: $treeStartingPoint = intval($this->pObj->id); $treeStartingRecord = t3lib_BEfunc::getRecord('pages', $treeStartingPoint); $depth = $this->pObj->MOD_SETTINGS['depth']; // Initialize tree object: $tree = t3lib_div::makeInstance('t3lib_pageTree'); $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1)); // Creating top icon; the current page $HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align="top"'); $tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => $HTML); // Create the tree from starting point: if ($depth > 0) { $tree->getTree($treeStartingPoint, $depth, ''); } // Set CSS styles specific for this document: $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/', ' TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; } ', $this->pObj->content); // Process commands: if (t3lib_div::_GP('createReferencesForPage')) { $this->createReferencesForPage(t3lib_div::_GP('createReferencesForPage')); } if (t3lib_div::_GP('createReferencesForTree')) { $this->createReferencesForTree($tree); } // Traverse tree: $output = ''; $counter = 0; foreach ($tree->tree as $row) { $unreferencedElementRecordsArr = $this->getUnreferencedElementsRecords($row['row']['uid']); if (count($unreferencedElementRecordsArr)) { $createReferencesLink = '<a href="index.php?id=' . $this->pObj->id . '&createReferencesForPage=' . $row['row']['uid'] . '">Reference elements</a>'; } else { $createReferencesLink = ''; } $rowTitle = $row['HTML'] . t3lib_BEfunc::getRecordTitle('pages', $row['row'], TRUE); $cellAttrib = $row['row']['_CSSCLASS'] ? ' class="' . $row['row']['_CSSCLASS'] . '"' : ''; $tCells = array(); $tCells[] = '<td nowrap="nowrap"' . $cellAttrib . '>' . $rowTitle . '</td>'; $tCells[] = '<td>' . count($unreferencedElementRecordsArr) . '</td>'; $tCells[] = '<td nowrap="nowrap">' . $createReferencesLink . '</td>'; $output .= ' <tr class="bgColor' . ($counter % 2 ? '-20' : '-10') . '"> ' . implode(' ', $tCells) . ' </tr>'; $counter++; } // Create header: $tCells = array(); $tCells[] = '<td>Page:</td>'; $tCells[] = '<td>No. of unreferenced elements:</td>'; $tCells[] = '<td> </td>'; // Depth selector: $depthSelectorBox = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php'); $finalOutput = ' <br /> ' . $depthSelectorBox . ' <a href="index.php?id=' . $this->pObj->id . '&createReferencesForTree=1">Reference elements for whole tree</a><br /> <br /> <table border="0" cellspacing="1" cellpadding="0" class="lrPadding c-list"> <tr class="bgColor5 tableheader"> ' . implode(' ', $tCells) . ' </tr>' . $output . ' </table> '; return $finalOutput; }
/** * Return a page tree * * @param integer $pageUid page to start with * @param integer $treeLevel count of levels * @return t3lib_pageTree * @throws Exception */ public static function pageTree($pageUid, $treeLevel) { if (TYPO3_MODE !== 'BE') { throw new Exception('Page::pageTree does only work in the backend!'); } /* @var $tree t3lib_pageTree */ $tree = t3lib_div::makeInstance('t3lib_pageTree'); $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1)); $treeStartingRecord = t3lib_BEfunc::getRecord('pages', $pageUid); t3lib_BEfunc::workspaceOL('pages', $treeStartingRecord); // Creating top icon; the current page $tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align="top"')); $tree->getTree($pageUid, $treeLevel, ''); return $tree; }
/** * MAIN function for cache information * * @return string Output HTML for the module. */ function main() { $content = ''; // specific language selection from form $depth = $this->pObj->MOD_SETTINGS['depth']; $langOnly = $this->pObj->MOD_SETTINGS['lang']; if ($langOnly != '' && $langOnly != '-1') { $this->langOnly = intval($langOnly); } $id = intval($this->pObj->id); if ($id) { // Add CSS $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/', ' TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; } TABLE#tx-seobasics TD { vertical-align: top; } ', $this->pObj->content); // Add Javascript $this->pObj->doc->JScode .= '<script type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath($this->extKey) . 'modfunc1/js/mootools.v1.11.js"></script>'; $this->pObj->doc->JScode .= '<script type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath($this->extKey) . 'modfunc1/js/seobasics.js"></script>'; // render depth selector $content = t3lib_BEfunc::getFuncMenu($id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php'); // if there are multiple languages, show dropdown to narrow it down. if ($this->sysHasLangs) { $content .= 'Display only language: '; $content .= t3lib_BEfunc::getFuncMenu($id, 'SET[lang]', $this->pObj->MOD_SETTINGS['lang'], $this->pObj->MOD_MENU['lang'], 'index.php') . '<br/>'; } $content .= t3lib_BEfunc::getFuncCheck($id, 'SET[hideShortcuts]', $this->pObj->MOD_SETTINGS['hideShortcuts'], 'index.php', '', 'id="SET[hideShortcuts]"'); $content .= '<label for="SET[hideShortcuts]">Hide Shortcuts</label> '; $content .= t3lib_BEfunc::getFuncCheck($id, 'SET[hideDisabled]', $this->pObj->MOD_SETTINGS['hideDisabled'], 'index.php', '', 'id="SET[hideDisabled]"'); $content .= '<label for="SET[hideDisabled]">Hide Disabled Pages</label> <br/>'; $content .= t3lib_BEfunc::getFuncCheck($id, 'SET[hideSysFolders]', $this->pObj->MOD_SETTINGS['hideSysFolders'], 'index.php', '', 'id="SET[hideSysFolders]"'); $content .= '<label for="SET[hideSysfolders]">Hide System Folders</label> <br/>'; $content .= t3lib_BEfunc::getFuncCheck($id, 'SET[hideNotInMenu]', $this->pObj->MOD_SETTINGS['hideNotInMenu'], 'index.php', '', 'id="SET[hideNotInMenu]"'); $content .= '<label for="SET[hideNotInMenu]">Hide Not in menu</label> <br/>'; // Save previous editing when submit was hit $this->saveChanges(); // == Showing the tree == // Initialize starting point (= $id) of page tree: $treeStartingRecord = t3lib_BEfunc::getRecord('pages', $id); t3lib_BEfunc::workspaceOL('pages', $treeStartingRecord); // Initialize tree object: $tree = t3lib_div::makeInstance('t3lib_pageTree'); $tree->addField('tx_seo_titletag', 1); $tree->addField('keywords', 1); $tree->addField('description', 1); if (t3lib_extMgm::isLoaded('realurl')) { $tree->addField('tx_realurl_pathsegment', 1); } $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1)); // Creating top icon; the current page $HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align="top"'); $tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => $HTML); // Create the tree from starting point if ($depth > 0) { $tree->getTree($id, $depth, ''); } // get all page IDs that will be displayed $pages = array(); foreach ($tree->tree as $row) { $pages[] = $row['row']['uid']; } // load language overlays and path cache for all pages shown $uidList = $GLOBALS['TYPO3_DB']->cleanIntList(implode(',', $pages)); $this->loadLanguageOverlays($uidList); if (t3lib_extMgm::isLoaded('realurl')) { $this->loadPathCache($uidList); } // Render information table $content .= $this->renderSaveButtons(); $content .= $this->renderSEOTable($tree); $content .= $this->renderSaveButtons(); } return $content; }
/** * Render display of a Template Object * * @param array Template Object record to render * @param array Array of all Template Objects (passed by reference. From here records are unset) * @param integer Scope of DS * @param boolean If set, the function is asked to render children to template objects (and should not call it self recursively again). * @return string HTML content */ function renderTODisplay($toObj, &$toRecords, $scope, $children = 0) { // Put together the records icon including content sensitive menu link wrapped around it: $recordIcon = t3lib_iconWorks::getIconImage('tx_templavoila_tmplobj', $toObj, $this->doc->backPath, 'class="absmiddle"'); $recordIcon = $this->doc->wrapClickMenuOnIcon($recordIcon, 'tx_templavoila_tmplobj', $toObj['uid'], 1, '&callingScriptId=' . rawurlencode($this->doc->scriptID)); // Preview icon: if ($toObj['previewicon']) { $icon = '<img src="' . $this->doc->backPath . '../uploads/tx_templavoila/' . $toObj['previewicon'] . '" alt="" />'; } else { $icon = '[No icon]'; } // Mapping status / link: $linkUrl = '../cm1/index.php?table=tx_templavoila_tmplobj&uid=' . $toObj['uid'] . '&_reload_from=1&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); $fileReference = t3lib_div::getFileAbsFileName($toObj['fileref']); if (@is_file($fileReference)) { $this->tFileList[$fileReference]++; $fileRef = '<a href="' . htmlspecialchars($this->doc->backPath . '../' . substr($fileReference, strlen(PATH_site))) . '" target="_blank">' . htmlspecialchars($toObj['fileref']) . '</a>'; $fileMsg = ''; $fileMtime = filemtime($fileReference); } else { $fileRef = htmlspecialchars($toObj['fileref']); $fileMsg = '<div class="typo3-red">ERROR: File not found</div>'; $fileMtime = 0; } $mappingStatus = $mappingStatus_index = ''; if ($fileMtime && $toObj['fileref_mtime']) { if ($toObj['fileref_md5'] != '') { $modified = @md5_file($fileReference) != $toObj['fileref_md5']; } else { $modified = $toObj['fileref_mtime'] != $fileMtime; } if ($modified) { $mappingStatus = $mappingStatus_index = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/icon_warning2.gif', 'width="18" height="16"') . ' alt="" class="absmiddle" />'; $mappingStatus .= 'Template file was updated since last mapping (' . t3lib_BEfunc::datetime($toObj['tstamp']) . ') and you might need to remap the Template Object!'; $this->setErrorLog($scope, 'warning', $mappingStatus . ' (TO: "' . $toObj['title'] . '")'); } else { $mappingStatus = $mappingStatus_index = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/icon_ok2.gif', 'width="18" height="16"') . ' alt="" class="absmiddle" />'; $mappingStatus .= 'Mapping Up-to-date.'; } $mappingStatus .= '<br/><a href="' . htmlspecialchars($linkUrl) . '">[ Update mapping ]</a>'; } elseif (!$fileMtime) { $mappingStatus = $mappingStatus_index = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/icon_fatalerror.gif', 'width="18" height="16"') . ' alt="" class="absmiddle" />'; $mappingStatus .= 'Not mapped yet!'; $this->setErrorLog($scope, 'fatal', $mappingStatus . ' (TO: "' . $toObj['title'] . '")'); $mappingStatus .= ' - <em>(It might also mean that the TO was mapped with an older version of TemplaVoila - then just go and save the mapping again at this will be updated.)</em>'; $mappingStatus .= '<br/><a href="' . htmlspecialchars($linkUrl) . '">[ Map ]</a>'; } else { $mappingStatus = ''; $mappingStatus .= '<a href="' . htmlspecialchars($linkUrl) . '">[ Remap ]</a>'; $mappingStatus .= '<a href="' . htmlspecialchars($linkUrl . '&_preview=1') . '">[ Preview ]</a>'; } // Format XML if requested if ($this->MOD_SETTINGS['set_details']) { if ($toObj['localprocessing']) { require_once PATH_t3lib . 'class.t3lib_syntaxhl.php'; $hlObj = t3lib_div::makeInstance('t3lib_syntaxhl'); $lpXML = '<pre>' . str_replace(chr(9), ' ', $hlObj->highLight_DS($toObj['localprocessing'])) . '</pre>'; } else { $lpXML = ''; } } else { $lpXML = $toObj['localprocessing'] ? t3lib_div::formatSize(strlen($toObj['localprocessing'])) . 'bytes' : ''; } $lpXML .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick('&edit[tx_templavoila_tmplobj][' . $toObj['uid'] . ']=edit&columnsOnly=localprocessing', $this->doc->backPath)) . '"><img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/edit2.gif', 'width="11" height="12"') . ' alt="" class="absmiddle" /></a>'; // Compile info table: $tableAttribs = ' border="0" cellpadding="1" cellspacing="1" width="98%" style="margin-top: 3px;" class="lrPadding"'; // Links: $editLink = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick('&edit[tx_templavoila_tmplobj][' . $toObj['uid'] . ']=edit', $this->doc->backPath)) . '"><img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/edit2.gif', 'width="11" height="12"') . ' alt="" class="absmiddle" /></a>'; $toTitle = '<a href="' . htmlspecialchars($linkUrl) . '">' . htmlspecialchars($toObj['title']) . '</a>'; $fRWTOUres = array(); if (!$children) { if ($this->MOD_SETTINGS['set_details']) { $fRWTOUres = $this->findRecordsWhereTOUsed($toObj, $scope); } $content .= ' <table' . $tableAttribs . '> <tr class="bgColor4-20"> <td colspan="3">' . $recordIcon . $toTitle . $editLink . '</td> </tr> <tr class="bgColor4"> <td rowspan="' . ($this->MOD_SETTINGS['set_details'] ? 7 : 4) . '" style="width: 100px; text-align: center;">' . $icon . '</td> <td>File reference:</td> <td>' . $fileRef . $fileMsg . '</td> </tr> <tr class="bgColor4"> <td>Description:</td> <td>' . htmlspecialchars($toObj['description']) . '</td> </tr> <tr class="bgColor4"> <td>Mapping status:</td> <td>' . $mappingStatus . '</td> </tr> <tr class="bgColor4"> <td>Local Processing:</td> <td>' . $lpXML . '</td> </tr>' . ($this->MOD_SETTINGS['set_details'] ? ' <tr class="bgColor4"> <td>Used by:</td> <td>' . $fRWTOUres['HTML'] . '</td> </tr> <tr class="bgColor4"> <td>Created:</td> <td>' . t3lib_BEfunc::datetime($toObj['crdate']) . ' by user [' . $toObj['cruser_id'] . ']</td> </tr> <tr class="bgColor4"> <td>Updated:</td> <td>' . t3lib_BEfunc::datetime($toObj['tstamp']) . '</td> </tr>' : '') . ' </table> '; } else { $content .= ' <table' . $tableAttribs . '> <tr class="bgColor4-20"> <td colspan="3">' . $recordIcon . $toTitle . $editLink . '</td> </tr> <tr class="bgColor4"> <td>File reference:</td> <td>' . $fileRef . $fileMsg . '</td> </tr> <tr class="bgColor4"> <td>Mapping status:</td> <td>' . $mappingStatus . '</td> </tr> <tr class="bgColor4"> <td>Render Type:</td> <td>' . t3lib_BEfunc::getProcessedValue('tx_templavoila_tmplobj', 'rendertype', $toObj['rendertype']) . '</td> </tr> <tr class="bgColor4"> <td>Language:</td> <td>' . t3lib_BEfunc::getProcessedValue('tx_templavoila_tmplobj', 'sys_language_uid', $toObj['sys_language_uid']) . '</td> </tr> <tr class="bgColor4"> <td>Local Processing:</td> <td>' . $lpXML . '</td> </tr>' . ($this->MOD_SETTINGS['set_details'] ? ' <tr class="bgColor4"> <td>Created:</td> <td>' . t3lib_BEfunc::datetime($toObj['crdate']) . ' by user [' . $toObj['cruser_id'] . ']</td> </tr> <tr class="bgColor4"> <td>Updated:</td> <td>' . t3lib_BEfunc::datetime($toObj['tstamp']) . '</td> </tr>' : '') . ' </table> '; } // Traverse template objects which are not children of anything: if (!$children && is_array($toRecords[$toObj['uid']])) { $TOchildrenContent = ''; foreach ($toRecords[$toObj['uid']] as $toIndex => $childToObj) { $rTODres = $this->renderTODisplay($childToObj, $toRecords, $scope, 1); $TOchildrenContent .= $rTODres['HTML']; // Unset it so we can eventually see what is left: unset($toRecords[$toObj['uid']][$toIndex]); } $content .= '<div style="margin-left: 102px;">' . $TOchildrenContent . '</div>'; } // Return content return array('HTML' => $content, 'mappingStatus' => $mappingStatus_index, 'usage' => $fRWTOUres['usage']); }
/** * Create record header (includes teh record icon, record title etc.) * * @param array Record row. * @return string HTML */ function getRecordHeader($row) { $line = t3lib_iconWorks::getIconImage('tt_content', $row, $this->backPath, ' align="top" title="' . htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($row, 'tt_content')) . '"'); $line .= t3lib_BEfunc::getRecordTitle('tt_content', $row, 1); return $this->wrapRecordTitle($line, $row); }
/** * Renders localized elements of a record * * @param array $contentTreeArr: Part of the contentTreeArr for the element * @param array $entries: Entries accumulated in this array (passed by reference) * @param integer $indentLevel: Indentation level * @return string HTML * @access protected * @see render_framework_singleSheet() */ function render_outline_localizations($contentTreeArr, &$entries, $indentLevel) { global $LANG, $BE_USER; if ($contentTreeArr['el']['table'] == 'tt_content' && $contentTreeArr['el']['sys_language_uid'] <= 0) { // Traverse the available languages of the page (not default and [All]) foreach ($this->translatedLanguagesArr as $sys_language_uid => $sLInfo) { if ($sys_language_uid > 0 && $BE_USER->checkLanguageAccess($sys_language_uid)) { switch ((string) $contentTreeArr['localizationInfo'][$sys_language_uid]['mode']) { case 'exists': // Get localized record: $olrow = t3lib_BEfunc::getRecordWSOL('tt_content', $contentTreeArr['localizationInfo'][$sys_language_uid]['localization_uid']); // Put together the records icon including content sensitive menu link wrapped around it: $recordIcon_l10n = $this->getRecordStatHookValue('tt_content', $olrow['uid']) . t3lib_iconWorks::getIconImage('tt_content', $olrow, $this->doc->backPath, 'class="absmiddle" title="' . htmlspecialchars('[tt_content:' . $olrow['uid'] . ']') . '"'); if (!$this->translatorMode) { $recordIcon_l10n = $this->doc->wrapClickMenuOnIcon($recordIcon_l10n, 'tt_content', $olrow['uid'], 1, '&callingScriptId=' . rawurlencode($this->doc->scriptID), 'new,copy,cut,pasteinto,pasteafter'); } list($flagLink_begin, $flagLink_end) = explode('|*|', $this->link_edit('|*|', 'tt_content', $olrow['uid'], TRUE)); // Create entry for this element: $entries[] = array('indentLevel' => $indentLevel, 'icon' => $recordIcon_l10n, 'title' => t3lib_BEfunc::getRecordTitle('tt_content', $olrow), 'table' => 'tt_content', 'uid' => $olrow['uid'], 'flag' => $flagLink_begin . ($sLInfo['flagIcon'] ? '<img src="' . $sLInfo['flagIcon'] . '" style="text-align: center; vertical-align: middle;" alt="' . htmlspecialchars($sLInfo['title']) . '" title="' . htmlspecialchars($sLInfo['title']) . '" />' : $sLInfo['title']) . $flagLink_end, 'isNewVersion' => $olrow['_ORIG_uid'] ? TRUE : FALSE); break; } } } } }
/** * MAIN function for cache information * * @return string Output HTML for the module. */ function main() { global $BACK_PATH,$LANG,$SOBE; if ($this->pObj->id) { $theOutput = ''; // Depth selector: $h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[type]',$this->pObj->MOD_SETTINGS['type'],$this->pObj->MOD_MENU['type'],'index.php').'<br/>'; if (!t3lib_div::inList('uniqalias,log,redirects', $this->pObj->MOD_SETTINGS['type'])) { $h_func.= t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[depth]',$this->pObj->MOD_SETTINGS['depth'],$this->pObj->MOD_MENU['depth'],'index.php'); } $theOutput.= $h_func; if ($this->pObj->MOD_SETTINGS['type']!='uniqalias') { // Showing the tree: // Initialize starting point of page tree: $treeStartingPoint = intval($this->pObj->id); $treeStartingRecord = t3lib_BEfunc::getRecord('pages', $treeStartingPoint); t3lib_BEfunc::workspaceOL('pages',$treeStartingRecord); $depth = $this->pObj->MOD_SETTINGS['depth']; // Initialize tree object: $tree = t3lib_div::makeInstance('t3lib_pageTree'); $tree->addField('nav_title',1); $tree->addField('alias',1); $tree->addField('tx_realurl_pathsegment',1); $tree->init('AND '.$GLOBALS['BE_USER']->getPagePermsClause(1)); // Creating top icon; the current page $HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'],'align="top"'); $tree->tree[] = array( 'row' => $treeStartingRecord, 'HTML' => $HTML ); // Create the tree from starting point: if ($depth>0) { $tree->getTree($treeStartingPoint, $depth, ''); } } // Add CSS needed: $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/',' TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; } TABLE#tx-realurl-pathcacheTable TD { vertical-align: top; } ',$this->pObj->content); // Branching: switch($this->pObj->MOD_SETTINGS['type']) { case 'pathcache': // Save editing if any: $this->edit_save(); // Render information table: $treeHTML = $this->renderModule($tree); // Render Search Form: $theOutput.= $this->renderSearchForm(); // Add tree table: $theOutput.= $treeHTML; break; case 'encode': $theOutput.= $this->encodeView($tree); break; case 'decode': $theOutput.= $this->decodeView($tree); break; case 'uniqalias': $this->edit_save_uniqAlias(); $theOutput.= $this->uniqueAlias(); break; case 'config': $theOutput.= $this->configView(); break; case 'redirects': $theOutput.= $this->redirectView(); break; case 'log': $theOutput.= $this->logView(); break; } } return $theOutput; }
/** * [Describe function...] * * @param [type] $rec: ... * @return [type] ... */ function makeTableRow($rec) { //Render information for base record: $baseRecord = t3lib_BEfunc::getRecordWSOL($rec['tablename'], $rec['recuid']); $icon = t3lib_iconWorks::getIconImage($rec['tablename'], $baseRecord, $GLOBALS['BACK_PATH'], 'align="top" title="' . htmlspecialchars($rec['tablename'] . ':' . $rec['recuid']) . '"'); $title = t3lib_BEfunc::getRecordTitle($rec['tablename'], $baseRecord, 1); $baseRecordFlag = '<img src="' . htmlspecialchars($GLOBALS['BACK_PATH'] . $this->sysLanguages[$rec['sys_language_uid']]['flagIcon']) . '" alt="" title="" />'; $tFlag = '<img src="' . htmlspecialchars($GLOBALS['BACK_PATH'] . $this->sysLanguages[$rec['translation_lang']]['flagIcon']) . '" alt="' . htmlspecialchars($this->sysLanguages[$rec['translation_lang']]['title']) . '" title="' . htmlspecialchars($this->sysLanguages[$rec['translation_lang']]['title']) . '" />'; $baseRecordStr = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick('&edit[' . $rec['tablename'] . '][' . $rec['recuid'] . ']=edit', $this->doc->backPath)) . '">' . $icon . $title . '</a>'; // Render for translation if any: $translationRecord = FALSE; if ($rec['translation_recuid']) { $translationTable = $this->l10nMgrTools->t8Tools->getTranslationTable($rec['tablename']); $translationRecord = t3lib_BEfunc::getRecordWSOL($translationTable, $rec['translation_recuid']); $icon = t3lib_iconWorks::getIconImage($translationTable, $translationRecord, $GLOBALS['BACK_PATH'], 'align="top" title="' . htmlspecialchars($translationTable . ':' . $rec['translation_recuid']) . '"'); $title = t3lib_BEfunc::getRecordTitle($translationTable, $translationRecord, 1); $translationRecStr = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick('&edit[' . $translationTable . '][' . $translationRecord['uid'] . ']=edit', $this->doc->backPath)) . '">' . $icon . $title . '</a>'; } else { $translationRecStr = ''; } // Action: if (is_array($translationRecord)) { $action = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick('&edit[' . $translationTable . '][' . $translationRecord['uid'] . ']=edit', $this->doc->backPath)) . '"><em>[Edit]</em></a>'; } elseif ($rec['sys_language_uid'] == -1) { $action = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick('&edit[' . $rec['tablename'] . '][' . $rec['recuid'] . ']=edit', $this->doc->backPath)) . '"><em>[Edit]</em></a>'; } else { $action = '<a href="' . htmlspecialchars($this->doc->issueCommand('&cmd[' . $rec['tablename'] . '][' . $rec['recuid'] . '][localize]=' . $rec['translation_lang'])) . '"><em>[Localize]</em></a>'; } return '<tr class="bgColor4-20"> <td valign="top">' . $baseRecordFlag . '</td> <td valign="top" nowrap="nowrap">' . $baseRecordStr . '</td> <td valign="top">' . $tFlag . '</td> <td valign="top" nowrap="nowrap">' . $translationRecStr . '</td> <td valign="top">' . $action . '</td> <td align="center"' . ($rec['flag_new'] ? ' bgcolor="#91B5FF"' : '') . '>' . ($rec['flag_new'] ? $rec['flag_new'] : '') . '</td> <td align="center"' . ($rec['flag_unknown'] ? ' bgcolor="#FEFF5A"' : '') . '>' . ($rec['flag_unknown'] ? $rec['flag_unknown'] : '') . '</td> <td align="center"' . ($rec['flag_update'] ? ' bgcolor="#FF7161"' : '') . '>' . ($rec['flag_update'] ? $rec['flag_update'] : '') . '</td> <td align="center"' . ($rec['flag_noChange'] ? ' bgcolor="#78FF82"' : '') . '>' . ($rec['flag_noChange'] ? $rec['flag_noChange'] : '') . '</td> <td>' . implode('<br/>', unserialize($rec['serializedDiff'])) . '</td> </tr>'; }
/** * Render a single item in a subelement list into a table row: * * @param array Table rows, passed by reference * @param string Table name * @param integer Page uid for which the subelements are selected/shown * @param array Row of element in list * @param integer The uid of the online version of $uid. If zero it means we are drawing a row for the online version itself while a value means we are drawing display for an offline version. * @param integer Mode of icon display: 0=not the last, 1= is the last in list (make joinbottom icon then), 2=do not shown icons are all (for pages from the page tree already rendered) * @param string Prefix HTML data (icons for tree rendering) * @return void (Content accumulated in $tCell!) */ function subElements_renderItem(&$tCell, $tN, $uid, $rec, $origId, $iconMode, $HTMLdata) { global $TCA; // Initialize: $origUidFields = $TCA[$tN]['ctrl']['origUid']; $diffCode = ''; if ($origUidFields) { // If there is a field for this table with original uids we will use that to connect records: if (!$origId) { // In case we are displaying the online originals: $this->targets['orig_' . $uid . '_' . $tN . '_' . $rec['uid']] = $rec; // Build up target array (important that $tdParams = ' id="orig_' . $uid . '_' . $tN . '_' . $rec['uid'] . '" class="typo3-ver"'; // Setting ID of the table row } else { // Version branch: if ($this->targets['orig_' . $origId . '_' . $tN . '_' . $rec[$origUidFields]]) { // If there IS a corresponding original record...: // Prepare Table row parameters: $this->addHlSubelementsScript = true; $tdParams = ' onmouseover="hlSubelements(\'' . $origId . '_' . $tN . '_' . $rec[$origUidFields] . '\', \'' . $uid . '_' . $tN . '_' . $rec[$origUidFields] . '\', 1, ' . ($this->diff == 2 ? 1 : 0) . ');"' . ' onmouseout="hlSubelements(\'' . $origId . '_' . $tN . '_' . $rec[$origUidFields] . '\', \'' . $uid . '_' . $tN . '_' . $rec[$origUidFields] . '\', 0, ' . ($this->diff == 2 ? 1 : 0) . ');"' . ' id="ver_' . $uid . '_' . $tN . '_' . $rec[$origUidFields] . '" class="typo3-ver"'; // Create diff view: if ($this->diff) { list($diffHTML, $diffPct) = $this->createDiffView($tN, $rec, $this->targets['orig_' . $origId . '_' . $tN . '_' . $rec[$origUidFields]]); if ($this->diff == 2) { $diffCode = ($diffPct ? '<span class="nobr">' . $diffPct . '% change</span>' : '-') . '<div style="visibility: hidden; position: absolute;" id="diff_' . $uid . '_' . $tN . '_' . $rec[$origUidFields] . '" class="diffLayer">' . $diffHTML . '</div>'; } else { $diffCode = ($diffPct < 0 ? 'N/A' : ($diffPct ? $diffPct . '% change:' : '')) . $diffHTML; } } // Unsetting the target fields allows us to mark all originals without a version in the subtree (see ->markupNewOriginals()) unset($this->targets['orig_' . $origId . '_' . $tN . '_' . $rec[$origUidFields]]); } else { // No original record, so must be new: $tdParams = ' class="typo3-ver-new"'; } } } else { // If no original uid column is supported for this table we are forced NOT to display any diff or highlighting. $tdParams = ' class="typo3-ver-noComp"'; } // Compile the cell: $tCell[] = ' <tr' . $tdParams . '> <td class="iconTitle">' . $HTMLdata . ($iconMode < 2 ? '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/ol/join' . ($iconMode ? 'bottom' : '') . '.gif', 'width="18" height="16"') . ' alt="" />' . t3lib_iconWorks::getIconImage($tN, $rec, $this->doc->backPath, '') : '') . t3lib_BEfunc::getRecordTitle($tN, $rec, TRUE) . '</td> <td class="cmdCell">' . $this->displayWorkspaceOverview_commandLinksSub($tN, $rec, $origId) . '</td>' . ($origId ? '<td class="diffCell">' . $diffCode . '</td>' : '') . ' </tr>'; }
/** * For TYPO3 Element Browser: This lists all content elements from the given list of tables * * @param string Commalist of tables. Set to "*" if you want all tables. * @return string HTML output. */ function TBE_expandPage($tables) { global $TCA, $BE_USER, $BACK_PATH; $out = ''; if ($this->expandPage >= 0 && t3lib_div::testInt($this->expandPage) && $BE_USER->isInWebMount($this->expandPage)) { // Set array with table names to list: if (!strcmp(trim($tables), '*')) { $tablesArr = array_keys($TCA); } else { $tablesArr = t3lib_div::trimExplode(',', $tables, 1); } reset($tablesArr); // Headline for selecting records: $out .= $this->barheader($GLOBALS['LANG']->getLL('selectRecords') . ':'); // Create the header, showing the current page for which the listing is. Includes link to the page itself, if pages are amount allowed tables. $titleLen = intval($GLOBALS['BE_USER']->uc['titleLen']); $mainPageRec = t3lib_BEfunc::getRecord('pages', $this->expandPage); $ATag = ''; $ATag_e = ''; $ATag2 = ''; if (in_array('pages', $tablesArr)) { $ficon = $BACK_PATH . t3lib_iconWorks::getIcon('pages', $mainPageRec); $ATag = "<a href=\"#\" onclick=\"return insertElement('pages', '" . $mainPageRec['uid'] . "', 'db', unescape('" . rawurlencode($mainPageRec['title']) . "'), '', '', '" . $ficon . "','',1);\">"; $ATag2 = "<a href=\"#\" onclick=\"return insertElement('pages', '" . $mainPageRec['uid'] . "', 'db', unescape('" . rawurlencode($mainPageRec['title']) . "'), '', '', '" . $ficon . "','',0);\">"; $ATag_alt = substr($ATag, 0, -4) . ",'',1);\">"; $ATag_e = '</a>'; } $picon = $BACK_PATH . t3lib_iconWorks::getIconImage('pages', $mainPageRec, $BACK_PATH, ''); $pBicon = $ATag2 ? '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/plusbullet2.gif', 'width="18" height="16"') . ' alt="" />' : ''; $pText = htmlspecialchars(t3lib_div::fixed_lgd_cs($mainPageRec['title'], $titleLen)); $out .= $picon . $ATag2 . $pBicon . $ATag_e . $ATag . $pText . $ATag_e . '<br />'; // Initialize the record listing: $id = $this->expandPage; $pointer = t3lib_div::intInRange($this->pointer, 0, 100000); $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); $pageinfo = t3lib_BEfunc::readPageAccess($id, $perms_clause); $table = ''; // Generate the record list: $dblist = t3lib_div::makeInstance('TBE_browser_recordList'); $dblist->thisScript = $this->thisScript; $dblist->backPath = $GLOBALS['BACK_PATH']; $dblist->thumbs = 0; $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo); $dblist->noControlPanels = 1; $dblist->clickMenuEnabled = 0; $dblist->tableList = implode(',', $tablesArr); $dblist->start($id, t3lib_div::_GP('table'), $pointer, t3lib_div::_GP('search_field'), t3lib_div::_GP('search_levels'), t3lib_div::_GP('showLimit')); $dblist->setDispFields(); $dblist->generateList($id, $table); $dblist->writeBottom(); // Add the HTML for the record list to output variable: $out .= $dblist->HTMLcode; // Add support for fieldselectbox in singleTableMode if ($dblist->table) { $out .= $dblist->fieldSelectBox($dblist->table); } $out .= $dblist->getSearchBox(); } // Return accumulated content: return $out; }
/** * Rendering the table icons * * @return string HTML */ function renderTableIcons() { if (is_array($GLOBALS['TCA'][$this->tableName])) { // Set the default: $this->testRecords = array(); $this->testRecords[] = array(); $tableCols = array(); // Set hidden: if ($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['disabled'] && $this->optionsMatrix['Hidden']) { $this->addTestRecordFields(array($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['disabled'] => 1)); $tableCols['Hidden'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['disabled']; } // Set starttime: if ($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['starttime'] && $this->optionsMatrix['Starttime']) { $this->addTestRecordFields(array($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['starttime'] => time() + 60)); $tableCols['Starttime'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['starttime']; } // Set endtime: if ($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['endtime'] && $this->optionsMatrix['Endtime']) { $this->addTestRecordFields(array($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['endtime'] => time() + 60)); /* $this->addTestRecordFields(array( $GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['endtime'] => time() - 60 )); */ $tableCols['Endtime'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['endtime']; } // Set fe_group: if ($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['fe_group'] && $this->optionsMatrix['Access']) { $this->addTestRecordFields(array($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['fe_group'] => 1)); $tableCols['Access'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['fe_group']; } // If "pages" table, add "extendToSubpages" if ($this->tableName == 'pages' && $this->optionsMatrix['Incl.Sub']) { $this->addTestRecordFields(array('extendToSubpages' => 1)); $tableCols['Incl.Sub'] = 'extendToSubpages'; } // Set "delete" flag: if ($GLOBALS['TCA'][$this->tableName]['ctrl']['delete'] && $this->optionsMatrix['Del.']) { $this->testRecords[] = array($GLOBALS['TCA'][$this->tableName]['ctrl']['delete'] => 1); $tableCols['Del.'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['delete']; } // _NO_ICON_FOUND if ($this->optionsMatrix['_NO_ICON_FOUND']) { $this->testRecords[] = array('_NO_ICON_FOUND' => 1); } if ($this->tableName == 'pages') { $tempArray = array(); if ($this->optionsMatrix['Doktype']) { foreach ($GLOBALS['PAGES_TYPES'] as $doktype => $dat) { if ($dat['icon']) { foreach ($this->testRecords as $rec) { $tempArray[] = array_merge($rec, array('doktype' => $doktype)); } } } $tableCols['Doktype'] = 'doktype'; } if ($this->optionsMatrix['Module']) { foreach ($GLOBALS['ICON_TYPES'] as $module => $dat) { if ($dat['icon']) { foreach ($this->testRecords as $rec) { $tempArray[] = array_merge($rec, array('module' => $module)); } } } $tableCols['Module'] = 'module'; } $this->testRecords = array_merge($tempArray, $this->testRecords); } elseif (is_array($GLOBALS['TCA'][$this->tableName]['ctrl']['typeicons']) && $this->optionsMatrix['TypeIcon']) { $tempArray = array(); foreach ($GLOBALS['TCA'][$this->tableName]['ctrl']['typeicons'] as $typeVal => $dat) { foreach ($this->testRecords as $rec) { $tempArray[] = array_merge($rec, array($GLOBALS['TCA'][$this->tableName]['ctrl']['typeicon_column'] => $typeVal)); } } $tableCols['TypeIcon'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['typeicon_column']; $this->testRecords = array_merge($tempArray, $this->testRecords); } // Render table: $tRows = array(); $sortRows = array(); // Draw header: $tCells = array(); $tCells[] = 'Icon:'; $tCells[] = 'Name:'; foreach ($tableCols as $label => $field) { $tCells[] = $label . ':'; } $tRows[] = ' <tr class="bgColor5" style="font-weight: bold;"> <td>' . implode('</td> <td>', $tCells) . '</td> </tr>'; // Traverse fake records, render icons: foreach ($this->testRecords as $row) { $tCells = array(); $icon = t3lib_iconWorks::getIconImage($this->tableName, $row, $GLOBALS['BACK_PATH']); $tCells[] = $icon; $attrib = t3lib_div::get_tag_attributes($icon); $fileName = substr($attrib['src'], strlen($GLOBALS['BACK_PATH'])); $tCells[] = $fileName; $sortRows[] = $fileName; foreach ($tableCols as $label => $field) { switch ($label) { case 'Hidden': case 'Access': case 'Del.': case 'Incl.Sub': $tCells[] = $row[$field] ? 'YES' : ''; break; case 'Endtime': case 'Starttime': $tCells[] = $row[$field] ? t3lib_BEfunc::date($row[$field]) : ''; break; default: $tCells[] = $row[$field]; break; } } $tRows[] = ' <tr class="bgColor4"> <td>' . implode('</td> <td>', $tCells) . '</td> </tr>'; } // Create table with icons: $output = $this->tableName . ': <table border="0" cellpadding="0" cellspacing="1"> ' . implode('', $tRows) . ' </table>'; // Show unique filenames involved: sort($sortRows); $sortRows = array_unique($sortRows); $output .= '<br /><p><strong>Unique icons:</strong></p>' . count($sortRows); $output .= '<br/><br/>'; $output .= '<p><strong>Filenames:</strong></p>' . Tx_Extdeveval_Compatibility::viewArray($sortRows); // DEVELOPMENT purposes, do NOT rename if you don't know what you are doing! #$this->renameIconsInTypo3Temp(); } return $output; }
/** * Renders a little table containing previews of translated version of the current content element. * * @author: Mansoor Ahmad - I do some modifications * @param array $contentTreeArr: Part of the contentTreeArr for the element * @param string $parentPointer: Flexform pointer pointing to the current element (from the parent's perspective) * @param array $parentDsMeta: Meta array from parent DS (passing information about parent containers localization mode) * @return string HTML * @access protected * @see render_framework_singleSheet() */ function render_localizationInfoTable($contentTreeArr, $parentPointer, $parentDsMeta = array(), $elementBelongsToCurrentPage) { global $LANG, $BE_USER; // LOCALIZATION information for content elements (non Flexible Content Elements) $output = ''; if ($contentTreeArr['el']['table'] == 'tt_content' && $contentTreeArr['el']['sys_language_uid'] <= 0) { // Traverse the available languages of the page (not default and [All]) $tRows = array(); foreach ($this->translatedLanguagesArr as $sys_language_uid => $sLInfo) { if ($this->MOD_SETTINGS['langDisplayMode'] && $this->currentLanguageUid != $sys_language_uid) { continue; } if ($sys_language_uid > 0) { $l10nInfo = ''; $flagLink_begin = $flagLink_end = ''; switch ((string) $contentTreeArr['localizationInfo'][$sys_language_uid]['mode']) { case 'exists': $olrow = t3lib_BEfunc::getRecordWSOL('tt_content', $contentTreeArr['localizationInfo'][$sys_language_uid]['localization_uid']); $localizedRecordInfo = array('uid' => $olrow['uid'], 'row' => $olrow, 'content' => $this->render_previewContent($olrow)); // Put together the records icon including content sensitive menu link wrapped around it: $recordIcon_l10n = t3lib_iconWorks::getIconImage('tt_content', $localizedRecordInfo['row'], $this->doc->backPath, 'class="absmiddle" title="' . htmlspecialchars('[tt_content:' . $localizedRecordInfo['uid'] . ']') . '"'); if (!$this->translatorMode) { $recordIcon_l10n = $this->doc->wrapClickMenuOnIcon($recordIcon_l10n, 'tt_content', $localizedRecordInfo['uid'], 1, '&callingScriptId=' . rawurlencode($this->doc->scriptID), 'new,copy,cut,pasteinto,pasteafter'); } $l10nInfo = $this->getRecordStatHookValue('tt_content', $localizedRecordInfo['row']['uid']) . ($elementBelongsToCurrentPage ? $recordIcon_l10n : '') . ($l10nInfo .= '<br/>' . $localizedRecordInfo['content']); list($flagLink_begin, $flagLink_end) = explode('|*|', $this->link_edit('|*|', 'tt_content', $localizedRecordInfo['uid'], TRUE)); if ($this->translatorMode) { $l10nInfo .= '<br/>' . $flagLink_begin . '<em>' . $LANG->getLL('clickToEditTranslation') . '</em>' . $flagLink_end; } // Wrap workspace notification colors: if ($olrow['_ORIG_uid']) { $l10nInfo = '<div class="ver-element">' . $l10nInfo . '</div>'; } $this->global_localization_status[$sys_language_uid][] = array('status' => 'exist', 'parent_uid' => $contentTreeArr['el']['uid'], 'localized_uid' => $localizedRecordInfo['row']['uid'], 'sys_language' => $contentTreeArr['el']['sys_language_uid']); break; case 'localize': if ($this->rootElementLangParadigm == 'free') { $showLocalizationLinks = !$parentDsMeta['langDisable']; // For this paradigm, show localization links only if localization is enabled for DS (regardless of Inheritance and Separate) } else { $showLocalizationLinks = $parentDsMeta['langDisable'] || $parentDsMeta['langChildren']; // Adding $parentDsMeta['langDisable'] here means that the "Create a copy for translation" link is shown only if the parent container element has localization mode set to "Disabled" or "Inheritance" - and not "Separate"! } // Assuming that only elements which have the default language set are candidates for localization. In case the language is [ALL] then it is assumed that the element should stay "international". if ((int) $contentTreeArr['el']['sys_language_uid'] === 0 && $showLocalizationLinks) { // Copy for language: if ($this->rootElementLangParadigm == 'free') { $sourcePointerString = $this->apiObj->flexform_getStringFromPointer($parentPointer); $onClick = "document.location='index.php?" . $this->link_getParameters() . '&source=' . rawurlencode($sourcePointerString) . '&localizeElement=' . $sLInfo['ISOcode'] . "'; return false;"; } else { $params = '&cmd[tt_content][' . $contentTreeArr['el']['uid'] . '][localize]=' . $sys_language_uid; $onClick = "document.location='" . $GLOBALS['SOBE']->doc->issueCommand($params) . "'; return false;"; } $linkLabel = $LANG->getLL('createcopyfortranslation', 1) . ' (' . htmlspecialchars($sLInfo['title']) . ')'; $localizeIcon = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/clip_copy.gif', 'width="12" height="12"') . ' class="bottom" title="' . $linkLabel . '" alt="" />'; $l10nInfo = $elementBelongsToCurrentPage ? '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $localizeIcon . '</a>' : ''; $l10nInfo .= $elementBelongsToCurrentPage ? ' <em><a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $linkLabel . '</a></em>' : ''; $flagLink_begin = '<a href="#" onclick="' . htmlspecialchars($onClick) . '">'; $flagLink_end = '</a>'; $this->global_localization_status[$sys_language_uid][] = array('status' => 'localize', 'parent_uid' => $contentTreeArr['el']['uid'], 'sys_language' => $contentTreeArr['el']['sys_language_uid']); } break; case 'localizedFlexform': // Here we want to show the "Localized FlexForm" information (and link to edit record) _only_ if there are other fields than group-fields for content elements: It only makes sense for a translator to deal with the record if that is the case. // Change of strategy (27/11): Because there does not have to be content fields; could be in sections or arrays and if thats the case you still want to localize them! There has to be another way... // if (count($contentTreeArr['contentFields']['sDEF'])) { list($flagLink_begin, $flagLink_end) = explode('|*|', $this->link_edit('|*|', 'tt_content', $contentTreeArr['el']['uid'], TRUE)); $l10nInfo = $flagLink_begin . '<em>[Click to translate FlexForm]</em>' . $flagLink_end; $this->global_localization_status[$sys_language_uid][] = array('status' => 'flex', 'parent_uid' => $contentTreeArr['el']['uid'], 'sys_language' => $contentTreeArr['el']['sys_language_uid']); // } break; } // # // ### Mansoor Ahmad - clear links if shortcuts were parsed // # if (empty($elementBelongsToCurrentPage)) { $flagLink_begin = ''; $flagLink_end = ''; } if ($l10nInfo && $BE_USER->checkLanguageAccess($sys_language_uid)) { $tRows[] = ' <tr class="bgColor4"> <td width="1%">' . $flagLink_begin . ($sLInfo['flagIcon'] ? '<img src="' . $sLInfo['flagIcon'] . '" alt="' . htmlspecialchars($sLInfo['title']) . '" title="' . htmlspecialchars($sLInfo['title']) . '" />' : $sLInfo['title']) . $flagLink_end . '</td> <td width="99%">' . $l10nInfo . '</td> </tr>'; } } } $output = count($tRows) ? ' <table border="0" cellpadding="0" cellspacing="1" width="100%" class="lrPadding"> <tr class="bgColor4-20"> <td colspan="2">' . $LANG->getLL('element_localizations', 1) . ':</td> </tr> ' . implode('', $tRows) . ' </table> ' : ''; } return $output; }
/** * Initializes the page tree. * * @return t3lib_pageTree */ protected function initializeTree() { $tree = t3lib_div::makeInstance('t3lib_pageTree'); /** @var t3lib_pageTree $tree */ $tree->addField('nav_title', true); $tree->addField('alias', true); $tree->addField('tx_realurl_pathsegment', true); $tree->init('AND '.$GLOBALS['BE_USER']->getPagePermsClause(1)); $treeStartingPoint = intval($this->pObj->id); $treeStartingRecord = t3lib_BEfunc::getRecord('pages', $treeStartingPoint); t3lib_BEfunc::workspaceOL('pages',$treeStartingRecord); // Creating top icon; the current page $tree->tree[] = array( 'row' => $treeStartingRecord, 'HTML' => t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align="top"') ); // Create the tree from starting point: if ($this->pObj->MOD_SETTINGS['depth'] > 0) { $tree->getTree($treeStartingPoint, $this->pObj->MOD_SETTINGS['depth'], ''); } return $tree; }
/** * Creates the icon image tag for record from table and wraps it in a link which will trigger the click menu. * * @param string Table name * @param array Record array * @param string Record title (NOT USED) * @return string HTML for the icon */ function getIcon($table, $row, $noEdit) { // Initialization $alttext = t3lib_BEfunc::getRecordIconAltText($row, $table); $iconImg = t3lib_iconWorks::getIconImage($table, $row, $this->backPath, 'title="' . $alttext . '"'); $this->counter++; if ($noEdit) { $disableList = '+info,copy'; } // The icon with link $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, $table, $row['uid'], '', '', $disableList); return $theIcon; }
/** * Showing the permissions in a tree ($this->edit = false) * (Adding content to internal content variable) * * @return void */ function notEdit() { global $BE_USER, $LANG, $BACK_PATH; // get ACL configuration $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']); if ($beAclConfig['disableOldPermissionSystem']) { $disableOldPermissionSystem = 1; } else { $disableOldPermissionSystem = 0; } $LANG->includeLLFile('EXT:be_acl/res/locallang_perm.php'); // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of $groupArray = $BE_USER->userGroupsUID; $be_user_Array = t3lib_BEfunc::getUserNames(); if (!$GLOBALS['BE_USER']->isAdmin()) { $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array, $groupArray, 0); } $be_group_Array = t3lib_BEfunc::getGroupNames(); if (!$GLOBALS['BE_USER']->isAdmin()) { $be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array, $groupArray, 0); } // Length of strings: $tLen = $this->MOD_SETTINGS['mode'] == 'perms' ? 20 : 30; // Selector for depth: $code .= $LANG->getLL('Depth') . ': '; $code .= t3lib_BEfunc::getFuncMenu($this->id, 'SET[depth]', $this->MOD_SETTINGS['depth'], $this->MOD_MENU['depth']); $this->content .= $this->doc->section('', $code); $this->content .= $this->doc->spacer(5); // Initialize tree object: $tree = t3lib_div::makeInstance('t3lib_pageTree'); $tree->init('AND ' . $this->perms_clause); $tree->addField('perms_user', 1); $tree->addField('perms_group', 1); $tree->addField('perms_everybody', 1); $tree->addField('perms_userid', 1); $tree->addField('perms_groupid', 1); $tree->addField('hidden'); $tree->addField('fe_group'); $tree->addField('starttime'); $tree->addField('endtime'); $tree->addField('editlock'); // Creating top icon; the current page $HTML = t3lib_iconWorks::getIconImage('pages', $this->pageinfo, $BACK_PATH, 'align="top"'); $tree->tree[] = array('row' => $this->pageinfo, 'HTML' => $HTML); // Create the tree from $this->id: $tree->getTree($this->id, $this->MOD_SETTINGS['depth'], ''); // get list of ACL users and groups, and initialize ACLs $aclUsers = $this->acl_objectSelector(0, $displayUserSelector, $beAclConfig); $aclGroups = $this->acl_objectSelector(1, $displayGroupSelector, $beAclConfig); $this->buildACLtree($aclUsers, $aclGroups); $this->content .= $displayUserSelector; $this->content .= $displayGroupSelector; // Make header of table: $code = ''; if ($this->MOD_SETTINGS['mode'] == 'perms') { $code .= ' <tr> <td class="bgColor2" colspan="2"> </td>'; $code .= ' <td class="bgColor2"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>'; $tableCells = array(); if (!$disableOldPermissionSystem) { $tableCells[] = '<b>' . $LANG->getLL('Owner', 1) . '</b>'; $tableCells[] = '<b>' . $LANG->getLL('Group', 1) . '</b>'; $tableCells[] = '<b>' . $LANG->getLL('Everybody', 1) . '</b>'; } // $tableCells[] = '<b>'.$LANG->getLL('EditLock',1).'</b>'; // TODO: Editlock // ACL headers if (!empty($aclUsers)) { $tableCells[] = '<b>' . $GLOBALS['LANG']->getLL('aclUser') . '</b>'; foreach ($aclUsers as $uid) { $tableCells[] = $be_user_Array[$uid]['username']; } } if (!empty($aclGroups)) { $tableCells[] = '<b>' . $GLOBALS['LANG']->getLL('aclGroup') . '</b>'; foreach ($aclGroups as $uid) { $tableCells[] = $be_group_Array[$uid]['title']; } } $code .= $this->printTableHeader($tableCells); $code .= '</tr>'; } else { $code .= ' <tr> <td class="bgColor2" colspan="2"> </td> <td class="bgColor2"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td class="bgColor2" align="center" nowrap="nowrap"><b>' . $LANG->getLL('User', 1) . ':</b> ' . $BE_USER->user['username'] . '</td> ' . (!$BE_USER->isAdmin() ? '<td class="bgColor2"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td class="bgColor2" align="center"><b>' . $LANG->getLL('EditLock', 1) . '</b></td>' : '') . ' </tr>'; } // Traverse tree: foreach ($tree->tree as $data) { $cells = array(); // Background colors: //if ($this->lastEdited==$data['row']['uid']) {$bgCol = ' class="bgColor-20"';} else {$bgCol = '';} $bgCol = ''; $lE_bgCol = $bgCol; // User/Group names: $userN = $be_user_Array[$data['row']['perms_userid']] ? $be_user_Array[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? '<i>[' . $data['row']['perms_userid'] . ']!</i>' : ''); $groupN = $be_group_Array[$data['row']['perms_groupid']] ? $be_group_Array[$data['row']['perms_groupid']]['title'] : ($data['row']['perms_groupid'] ? '<i>[' . $data['row']['perms_groupid'] . ']!</i>' : ''); $groupN = t3lib_div::fixed_lgd_cs($groupN, 20); // Seeing if editing of permissions are allowed for that page: $editPermsAllowed = $data['row']['perms_userid'] == $BE_USER->user['uid'] || $BE_USER->isAdmin(); // First column: $cells[] = ' <td align="left" nowrap="nowrap"' . $bgCol . $this->generateTitleAttribute($data['row']['uid'], $be_user_Array, $be_group_Array) . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $tLen)) . ' </td>'; // "Edit permissions" -icon if ($editPermsAllowed && $data['row']['uid']) { $aHref = 'index.php?mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . $data['row']['uid'] . '&return_id=' . $this->id . '&edit=1'; $cells[] = ' <td' . $bgCol . '><a href="' . htmlspecialchars($aHref) . '"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/edit2.gif', 'width="11" height="12"') . ' border="0" title="' . $LANG->getLL('ch_permissions', 1) . '" align="top" alt="" /></a></td>'; } else { $cells[] = ' <td' . $bgCol . '></td>'; } // Rest of columns (depending on mode) if ($this->MOD_SETTINGS['mode'] == 'perms') { if (!$disableOldPermissionSystem) { $cells[] = ' <td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? $this->printPerms($data['row']['perms_user']) . ' ' . $userN : '') . '</td> <td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? $this->printPerms($data['row']['perms_group']) . ' ' . $groupN : '') . '</td> <td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($data['row']['perms_everybody']) : '') . '</td>'; } /*$cells[] =' <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td> <td'.$bgCol.' nowrap="nowrap">'.($data['row']['editlock']?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/recordlock_warning2.gif','width="22" height="16"').' title="'.$LANG->getLL('EditLock_descr',1).'" alt="" />':'').'</td> ';*/ // TODO: Editlock // ACL rows if (!empty($aclUsers)) { $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td><td' . $bgCol . '>' . $this->countAcls($this->aclList[$data['row']['uid']][0]) . '</td>'; foreach ($aclUsers as $uid) { $tmpBg = $bgCol; if (isset($this->aclList[$data['row']['uid']][0][$uid]['newAcl'])) { if ($this->aclList[$data['row']['uid']][0][$uid]['recursive']) { $tmpBg = ' class="bgColor5"'; } else { $tmpBg = ' class="bgColor6"'; } } $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $tmpBg . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($this->aclList[$data['row']['uid']][0][$uid]['permissions']) : '') . '</td>'; } } if (!empty($aclGroups)) { $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td><td' . $bgCol . '>' . $this->countAcls($this->aclList[$data['row']['uid']][1]) . '</td>'; foreach ($aclGroups as $uid) { $tmpBg = $bgCol; if (isset($this->aclList[$data['row']['uid']][1][$uid]['newAcl'])) { if ($this->aclList[$data['row']['uid']][1][$uid]['recursive']) { $tmpBg = ' class="bgColor5"'; } else { $tmpBg = ' class="bgColor6"'; } } $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $tmpBg . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($this->aclList[$data['row']['uid']][1][$uid]['permissions']) : '') . '</td>'; } } } else { $cells[] = ' <td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>'; if ($BE_USER->user['uid'] == $data['row']['perms_userid']) { $bgCol = ' class="bgColor-20"'; } else { $bgCol = $lE_bgCol; } $cells[] = ' <td' . $bgCol . ' nowrap="nowrap" align="center">' . ($data['row']['uid'] ? $owner . $this->printPerms($BE_USER->calcPerms($data['row'])) : '') . '</td> ' . (!$BE_USER->isAdmin() ? ' <td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td> <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/recordlock_warning2.gif', 'width="22" height="16"') . ' title="' . $LANG->getLL('EditLock_descr', 1) . '" alt="" />' : '') . '</td> ' : ''); $bgCol = $lE_bgCol; } // Compile table row: $code .= ' <tr> ' . implode(' ', $cells) . ' </tr>'; } // Wrap rows in table tags: $code = '<table border="0" cellspacing="0" cellpadding="0" id="typo3-permissionList">' . $code . '</table>'; // Adding the content as a section: $this->content .= $this->doc->section('', $code); // CSH for permissions setting $this->content .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH'], '<br/>|'); // Creating legend table: $legendText = '<b>' . $LANG->getLL('1', 1) . '</b>: ' . $LANG->getLL('1_t', 1); $legendText .= '<br /><b>' . $LANG->getLL('16', 1) . '</b>: ' . $LANG->getLL('16_t', 1); $legendText .= '<br /><b>' . $LANG->getLL('2', 1) . '</b>: ' . $LANG->getLL('2_t', 1); $legendText .= '<br /><b>' . $LANG->getLL('4', 1) . '</b>: ' . $LANG->getLL('4_t', 1); $legendText .= '<br /><b>' . $LANG->getLL('8', 1) . '</b>: ' . $LANG->getLL('8_t', 1); if (t3lib_div::int_from_ver(TYPO3_version) >= 4004000) { $icon = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/legend.gif', 'width="86" height="75"') . ' alt="" />'; } else { $icon = '<img src="legend.gif" width="86" height="75" alt="" />'; } $code = '<table border="0" id="typo3-legendTable"> <tr> <td valign="top">' . $icon . '</td> <td valign="top" nowrap="nowrap">' . $legendText . '</td> </tr> </table>'; $code .= '<br />' . $LANG->getLL('def', 1); if (t3lib_div::int_from_ver(TYPO3_version) >= 4004000) { // use sprites for Typo3 V4.4 or later $code .= '<br /><br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-granted') . ': ' . $LANG->getLL('A_Granted', 1); $code .= '<br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-denied') . ': ' . $LANG->getLL('A_Denied', 1); } else { $code .= '<br /><br /><span class="perm-allowed">*</span>: ' . $LANG->getLL('A_Granted', 1); $code .= '<br /> <span class="perm-denied" >x</span>: ' . $LANG->getLL('A_Denied', 1); } // Adding section with legend code: $this->content .= $this->doc->spacer(20); $this->content .= $this->doc->section($LANG->getLL('Legend') . ':', $code, 0, 1); }
/** * Creating the module output. * * @return void * @todo provide position mapping if no position is given already. Like the columns selector but for our cascading element style ... */ function main() { global $LANG, $BACK_PATH; if ($this->id && $this->access) { // Creating content $this->content = ''; $this->content .= $this->doc->startPage($LANG->getLL('newContentElement')); $this->content .= $this->doc->header($LANG->getLL('newContentElement')); $this->content .= $this->doc->spacer(5); $elRow = t3lib_BEfunc::getRecordWSOL('pages', $this->id); $header = t3lib_iconWorks::getIconImage('pages', $elRow, $BACK_PATH, ' title="' . htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($elRow, 'pages')) . '" align="top"'); $header .= t3lib_BEfunc::getRecordTitle('pages', $elRow, 1); $this->content .= $this->doc->section('', $header, 0, 1); $this->content .= $this->doc->spacer(10); // Wizard $wizardCode = ''; $tableRows = array(); $wizardItems = $this->getWizardItems(); // Traverse items for the wizard. // An item is either a header or an item rendered with a title/description and icon: $counter = 0; foreach ($wizardItems as $key => $wizardItem) { if ($wizardItem['header']) { if ($counter > 0) { $tableRows[] = ' <tr> <td colspan="3"><br /></td> </tr>'; } $tableRows[] = ' <tr class="bgColor5"> <td colspan="3"><strong>' . htmlspecialchars($wizardItem['header']) . '</strong></td> </tr>'; } else { $tableLinks = array(); // href URI for icon/title: $newRecordLink = 'index.php?' . $this->linkParams() . '&createNewRecord=' . rawurlencode($this->parentRecord) . $wizardItem['params']; // Icon: $iInfo = @getimagesize($wizardItem['icon']); $tableLinks[] = '<a href="' . $newRecordLink . '"><img' . t3lib_iconWorks::skinImg($this->doc->backPath, $wizardItem['icon'], '') . ' alt="" /></a>'; // Title + description: $tableLinks[] = '<a href="' . $newRecordLink . '"><strong>' . htmlspecialchars($wizardItem['title']) . '</strong><br />' . nl2br(htmlspecialchars(trim($wizardItem['description']))) . '</a>'; // Finally, put it together in a table row: $tableRows[] = ' <tr> <td valign="top">' . implode('</td> <td valign="top">', $tableLinks) . '</td> </tr>'; $counter++; } } // Add the wizard table to the content: $wizardCode .= $LANG->getLL('sel1', 1) . '<br /><br /> <!-- Content Element wizard table: --> <table border="0" cellpadding="1" cellspacing="2" id="typo3-ceWizardTable"> ' . implode('', $tableRows) . ' </table>'; $this->content .= $this->doc->section($LANG->getLL('1_selectType'), $wizardCode, 0, 1); } else { // In case of no access: $this->content = ''; $this->content .= $this->doc->startPage($LANG->getLL('newContentElement')); $this->content .= $this->doc->header($LANG->getLL('newContentElement')); $this->content .= $this->doc->spacer(5); } }
/** * Generation of TCEform element of the type "group" for media elements. * This is used to select media records in eg. tt_content. * * @param array $PA An array with additional configuration options. * @param object $fobj TCEForms object reference * @return string The HTML code for the TCEform field */ function getSingleField_typeMedia($PA, &$fObj) { global $TYPO3_CONF_VARS; $this->tceforms =& $PA['pObj']; if (!(($msg = $this->isMMForeignActive()) === true)) { return $this->tceforms->getSingleField_typeNone_render(array('rows' => 1), $msg); } $table = $PA['table']; $field = $PA['field']; $row = $PA['row']; $config = $PA['fieldConf']['config']; $disabled = ''; if ($this->tceforms->renderReadonly || $config['readOnly']) { $disabled = ' disabled="disabled"'; } $minitems = t3lib_div::intInRange($config['minitems'], 0); $maxitems = t3lib_div::intInRange($config['maxitems'], 0); if (!$maxitems) { $maxitems = 100000; } $this->tceforms->requiredElements[$PA['itemFormElName']] = array($minitems, $maxitems, 'imgName' => $table . '_' . $row['uid'] . '_' . $field); $item = ''; $item .= '<input type="hidden" name="' . $PA['itemFormElName'] . '_mul" value="' . ($config['multiple'] ? 1 : 0) . '"' . $disabled . ' />'; $info = ''; // Acting according to either "file" or "db" type: switch ((string) $config['internal_type']) { case 'db': // If the element is of the internal type "db": // Creating string showing allowed types: $tempFT_db = t3lib_div::trimExplode(',', $config['allowed'], true); while (list(, $theT) = each($tempFT_db)) { if ($theT) { $info .= '<span class="nobr"> ' . t3lib_iconWorks::getIconImage($theT, array(), $this->tceforms->backPath, 'align="top"') . $this->tceforms->sL($GLOBALS['TCA'][$theT]['ctrl']['title'], true) . '</span><br />'; } } // Creating string showing allowed types: $tempFT = t3lib_div::trimExplode(',', $config['allowed_types'], true); if (!count($tempFT)) { $info .= '*'; } foreach ($tempFT as $ext) { if ($ext) { $info .= strtoupper($ext) . ' '; } } // Creating string, showing disallowed types: $tempFT_dis = t3lib_div::trimExplode(',', $config['disallowed_types'], true); if (count($tempFT_dis)) { $info .= '<br />'; } foreach ($tempFT_dis as $ext) { if ($ext) { $info .= '-' . strtoupper($ext) . ' '; } } // Collectiong file items: $itemArray = array(); $filesArray = array(); if (intval($row['uid'])) { $filesArray = tx_dam_db::getReferencedFiles($table, $row['uid'], $config['MM_match_fields'], $config['MM'], 'tx_dam.*'); foreach ($filesArray['rows'] as $row) { $itemArray[] = array('table' => 'tx_dam', 'id' => $row['uid'], 'title' => $row['title'] ? $row['title'] : $row['file_name']); } } $thumbsnails = $this->renderFileList($filesArray, $config['show_thumbs']); /* // making thumbnails $thumbsnails = ''; if ($config['show_thumbs'] AND count($filesArray)) { foreach($filesArray['rows'] as $row) { // Icon $absFilePath = tx_dam::file_absolutePath($row); $fileExists = @file_exists($absFilePath); $addAttrib = 'class="absmiddle"'; $addAttrib .= tx_dam_guiFunc::icon_getTitleAttribute($row); $fileIcon = tx_dam::icon_getFileTypeImgTag($row, $addAttrib); // add clickmenu if ($fileExists AND !$disabled) { # $fileIcon = $this->tceforms->getClickMenu($fileIcon, $absFilePath); $fileIcon = $this->tceforms->getClickMenu($fileIcon, 'tx_dam', $row['uid']); } $title = t3lib_div::fixed_lgd_cs($this->tceforms->noTitle($row['title']), $this->tceforms->titleLen); $thumb = tx_dam_image::previewImgTag($row, '', 'align="middle"'); $thumbDescr = '<div class="nobr">'.$fileIcon.$title.'<br />'.$row['file_name'].'</div>'; $thumbsnails .= '<tr><td>'.$thumb.'</td><td>'.$thumbDescr.'</td></tr>'; } $thumbsnails = '<table border="0">'.$thumbsnails.'</table>'; } */ // Creating the element: $params = array('size' => intval($config['size']), 'dontShowMoveIcons' => $maxitems <= 1, 'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'], 0), 'maxitems' => $maxitems, 'style' => isset($config['selectedListStyle']) ? ' style="' . htmlspecialchars($config['selectedListStyle']) . '"' : ' style="' . $this->tceforms->defaultMultipleSelectorStyle . '"', 'info' => $info, 'thumbnails' => $thumbsnails, 'readOnly' => $disabled); // Extra parameter for DAM element browser $user_eb_param = $config['allowed_types']; $item .= $this->dbFileIcons($PA['itemFormElName'], 'db', implode(',', $tempFT_db), $itemArray, '', $params, $PA['onFocus'], $user_eb_param); break; } // Wizards: if (!$disabled) { $specConf = $this->tceforms->getSpecConfFromString($PA['extra'], $PA['fieldConf']['defaultExtras']); $altItem = '<input type="hidden" name="' . $PA['itemFormElName'] . '" value="' . htmlspecialchars($PA['itemFormElValue']) . '" />'; $item = $this->tceforms->renderWizards(array($item, $altItem), $config['wizards'], $table, $row, $field, $PA, $PA['itemFormElName'], $specConf); } return $item; }
function languageRows($languageList, $elementList) { // Initialization: $elements = $this->explodeElement($elementList); $firstEl = current($elements); $hookObj = t3lib_div::makeInstance('tx_l10nmgr_tcemain_hook'); $this->l10nMgrTools = t3lib_div::makeInstance('tx_l10nmgr_tools'); $this->l10nMgrTools->verbose = FALSE; // Otherwise it will show records which has fields but none editable. $inputRecord = t3lib_BEfunc::getRecord($firstEl[0], $firstEl[1], 'pid'); $this->sysLanguages = $this->l10nMgrTools->t8Tools->getSystemLanguages($firstEl[0] == 'pages' ? $firstEl[1] : $inputRecord['pid']); $languages = $this->getLanguages($languageList, $this->sysLanguages); if (count($languages)) { $tRows = array(); // Header: $cells = '<td class="bgColor2 tableheader">Element:</td>'; foreach ($languages as $l) { if ($l >= 1) { $baseRecordFlag = '<img src="' . htmlspecialchars($GLOBALS['BACK_PATH'] . $this->sysLanguages[$l]['flagIcon']) . '" alt="' . htmlspecialchars($this->sysLanguages[$l]['title']) . '" title="' . htmlspecialchars($this->sysLanguages[$l]['title']) . '" />'; $cells .= '<td class="bgColor2 tableheader">' . $baseRecordFlag . '</td>'; } } $tRows[] = $cells; foreach ($elements as $el) { $cells = ''; // Get CURRENT online record and icon based on "t3ver_oid": $rec_on = t3lib_BEfunc::getRecord($el[0], $el[1]); $icon = t3lib_iconWorks::getIconImage($el[0], $rec_on, $this->doc->backPath, ' align="top" title="' . t3lib_BEfunc::getRecordIconAltText($rec_on, $el[0]) . '"'); $icon = $this->doc->wrapClickMenuOnIcon($icon, $el[0], $rec_on['uid'], 2); $linkToIt = '<a href="#" onclick="' . htmlspecialchars('parent.list_frame.location.href="' . $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('l10nmgr') . 'cm2/index.php?table=' . $el[0] . '&uid=' . $el[1] . '"; return false;') . '" target="listframe"> ' . t3lib_BEfunc::getRecordTitle($el[0], $rec_on, TRUE) . ' </a>'; if ($el[0] == 'pages') { // If another page module was specified, replace the default Page module with the new one $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule')); $pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout'; $path_module_path = t3lib_div::resolveBackPath($GLOBALS['BACK_PATH'] . '../' . substr($GLOBALS['TBE_MODULES']['_PATHS'][$pageModule], strlen(PATH_site))); $onclick = 'parent.list_frame.location.href="' . $path_module_path . '?id=' . $el[1] . '"; return false;'; $pmLink = '<a href="#" onclick="' . htmlspecialchars($onclick) . '" target="listframe"><i>[Edit page]</i></a>'; } else { $pmLink = ''; } $cells = '<td>' . $icon . $linkToIt . $pmLink . '</td>'; foreach ($languages as $l) { if ($l >= 1) { $cells .= '<td align="center">' . $hookObj->calcStat(array($el[0], $el[1]), $l) . '</td>'; } } $tRows[] = $cells; } return '<table border="0" cellpadding="0" cellspacing="0"><tr>' . implode('</tr><tr>', $tRows) . '</tr></table>'; } }