/** * Returns array of system languages * @param integer page id (only used to get TSconfig configuration setting flag and label for default language) * @param string Backpath for flags * @return array */ function getSystemLanguages($page_id = 0, $backPath = '') { global $TCA, $LANG; // Icons and language titles: t3lib_div::loadTCA('sys_language'); $flagAbsPath = t3lib_div::getFileAbsFileName($TCA['sys_language']['columns']['flag']['config']['fileFolder']); $flagIconPath = $backPath . '../' . substr($flagAbsPath, strlen(PATH_site)); $modSharedTSconfig = t3lib_BEfunc::getModTSconfig($page_id, 'mod.SHARED'); $languageIconTitles = array(); // Set default: $languageIconTitles[0] = array('uid' => 0, 'title' => strlen($modSharedTSconfig['properties']['defaultLanguageLabel']) ? $modSharedTSconfig['properties']['defaultLanguageLabel'] . ' (' . $LANG->getLL('defaultLanguage') . ')' : $LANG->getLL('defaultLanguage'), 'ISOcode' => 'DEF', 'flagIcon' => strlen($modSharedTSconfig['properties']['defaultLanguageFlag']) && @is_file($flagAbsPath . $modSharedTSconfig['properties']['defaultLanguageFlag']) ? $flagIconPath . $modSharedTSconfig['properties']['defaultLanguageFlag'] : null); // Set "All" language: $languageIconTitles[-1] = array('uid' => -1, 'title' => $LANG->getLL('multipleLanguages'), 'ISOcode' => 'DEF', 'flagIcon' => $flagIconPath . 'multi-language.gif'); // Find all system languages: $sys_languages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_language', ''); foreach ($sys_languages as $row) { $languageIconTitles[$row['uid']] = $row; if ($row['static_lang_isocode'] && t3lib_extMgm::isLoaded('static_info_tables')) { $staticLangRow = t3lib_BEfunc::getRecord('static_languages', $row['static_lang_isocode'], 'lg_iso_2'); if ($staticLangRow['lg_iso_2']) { $languageIconTitles[$row['uid']]['ISOcode'] = $staticLangRow['lg_iso_2']; } } if (strlen($row['flag'])) { $languageIconTitles[$row['uid']]['flagIcon'] = @is_file($flagAbsPath . $row['flag']) ? $flagIconPath . $row['flag'] : ''; } } return $languageIconTitles; }
/** * Returns array of system languages * * Since TYPO3 4.5 the flagIcon is not returned as a filename in "gfx/flags/*" anymore, * but as a string <flags-xx>. The calling party should call * t3lib_iconWorks::getSpriteIcon(<flags-xx>) to get an HTML which will represent * the flag of this language. * * @param integer page id (only used to get TSconfig configuration setting flag and label for default language) * @param string Backpath for flags * @return array Array with languages (title, uid, flagIcon) */ function getSystemLanguages($page_id = 0, $backPath = '') { global $TCA, $LANG; $modSharedTSconfig = t3lib_BEfunc::getModTSconfig($page_id, 'mod.SHARED'); $languageIconTitles = array(); // fallback "old iconstyles" if (preg_match('/\\.gif$/', $modSharedTSconfig['properties']['defaultLanguageFlag'])) { $modSharedTSconfig['properties']['defaultLanguageFlag'] = str_replace('.gif', '', $modSharedTSconfig['properties']['defaultLanguageFlag']); } $languageIconTitles[0] = array('uid' => 0, 'title' => strlen($modSharedTSconfig['properties']['defaultLanguageLabel']) ? $modSharedTSconfig['properties']['defaultLanguageLabel'] . ' (' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_web_list.xml:defaultLanguage') . ')' : $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_web_list.xml:defaultLanguage'), 'ISOcode' => 'DEF', 'flagIcon' => strlen($modSharedTSconfig['properties']['defaultLanguageFlag']) ? 'flags-' . $modSharedTSconfig['properties']['defaultLanguageFlag'] : 'empty-empty'); // Set "All" language: $languageIconTitles[-1] = array('uid' => -1, 'title' => $LANG->getLL('multipleLanguages'), 'ISOcode' => 'DEF', 'flagIcon' => 'flags-multiple'); // Find all system languages: $sys_languages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_language', ''); foreach ($sys_languages as $row) { $languageIconTitles[$row['uid']] = $row; if ($row['static_lang_isocode'] && t3lib_extMgm::isLoaded('static_info_tables')) { $staticLangRow = t3lib_BEfunc::getRecord('static_languages', $row['static_lang_isocode'], 'lg_iso_2'); if ($staticLangRow['lg_iso_2']) { $languageIconTitles[$row['uid']]['ISOcode'] = $staticLangRow['lg_iso_2']; } } if (strlen($row['flag'])) { $languageIconTitles[$row['uid']]['flagIcon'] = t3lib_iconWorks::mapRecordTypeToSpriteIconName('sys_language', $row); } } return $languageIconTitles; }
/** * Initialization of module * * @return void */ function init() { global $BE_USER; $this->MCONF = $GLOBALS['MCONF']; $this->id = intval(t3lib_div::_GP('id')); $this->perms_clause = $BE_USER->getPagePermsClause(1); // page/be_user TSconfig settings and blinding of menu-items $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']); $this->type = intval($this->modTSconfig['properties']['type']); }
/** * Returns the configuration * * @param integer $id * * @return array */ public function getConfiguration($id) { if (!isset($this->configurationArray[$id])) { $modTsConfig = t3lib_BEfunc::getModTSconfig($id, 'mod.vcc'); $this->configurationArray[$id] = $modTsConfig['properties']; // Log debug information $logData = array('id' => $id, 'configuration' => $modTsConfig['properties']); $this->loggingService->debug('TsConfigService::getConfiguration id: ' . $id, $logData); } return $this->configurationArray[$id]; }
/** * Gets the list of available columns for a given page id * * @param int $id * @return array $tcaItems */ public function getColPosListItemsParsed($id) { $tsConfig = t3lib_BEfunc::getModTSconfig($id, 'TCEFORM.tt_content.colPos'); $tcaConfig = $GLOBALS['TCA']['tt_content']['columns']['colPos']['config']; $tceForms = t3lib_div::makeInstance('t3lib_TCEForms'); $tcaItems = $tcaConfig['items']; $tcaItems = $tceForms->addItems($tcaItems, $tsConfig['properties']['addItems.']); if (isset($tcaConfig['itemsProcFunc']) && $tcaConfig['itemsProcFunc']) { $tcaItems = $this->addColPosListLayoutItems($id, $tcaItems); } foreach (t3lib_div::trimExplode(',', $tsConfig['properties']['removeItems'], 1) as $removeId) { foreach ($tcaItems as $key => $item) { if ($item[1] == $removeId) { unset($tcaItems[$key]); } } } return $tcaItems; }
/** * Main function * * @return string Output HTML for the module. * @access public */ function main() { global $BACK_PATH, $LANG, $SOBE, $BE_USER, $TYPO3_DB; $this->modSharedTSconfig = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod.SHARED'); $this->allAvailableLanguages = $this->getAvailableLanguages(0, true, true, true); $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::getSpriteIconForRecord('pages', $treeStartingRecord); $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; }
/** * @param int $id Page uid * @param string $TSref An object string which determines the path of the TSconfig to return. * @return array */ public function getModTSconfig($id, $TSref) { /** @noinspection PhpDeprecationInspection PhpUndefinedClassInspection */ return t3lib_BEfunc::getModTSconfig($id, $TSref); }
/** * Initializes the internal MOD_MENU array setting and unsetting items based on various conditions. It also merges in external menu items from the global array TBE_MODULES_EXT (see mergeExternalItems()) * Then MOD_SETTINGS array is cleaned up (see t3lib_BEfunc::getModuleData()) so it contains only valid values. It's also updated with any SET[] values submitted. * Also loads the modTSconfig internal variable. * * @return void * @see init(), $MOD_MENU, $MOD_SETTINGS, t3lib_BEfunc::getModuleData(), mergeExternalItems() */ function menuConfig() { // page/be_user TSconfig settings and blinding of menu-items $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']); $this->MOD_MENU['function'] = $this->mergeExternalItems($this->MCONF['name'], 'function', $this->MOD_MENU['function']); $this->MOD_MENU['function'] = t3lib_BEfunc::unsetMenuItems($this->modTSconfig['properties'], $this->MOD_MENU['function'], 'menu.function'); #debug($this->MOD_MENU['function'],$this->MCONF['name']); #debug($this->modTSconfig['properties']); $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList); }
/** * Initialize internal variables. * * @return void */ function init() { global $BE_USER, $BACK_PATH, $TBE_MODULES_EXT; // Setting class files to include: if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) { $this->include_once = array_merge($this->include_once, $TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']); } $this->extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['templavoila']); // Setting internal vars: $this->id = intval(t3lib_div::_GP('id')); $this->parentRecord = t3lib_div::_GP('parentRecord'); $this->altRoot = t3lib_div::_GP('altRoot'); $this->defVals = t3lib_div::_GP('defVals'); $this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl')); // Starting the document template object: $this->doc = t3lib_div::makeInstance('template'); $this->doc->docType = 'xhtml_trans'; $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('EXT:templavoila/resources/templates/mod1_new_content.html'); $this->doc->bodyTagId = 'typo3-mod-php'; $this->doc->divClass = ''; $this->doc->JScode = ''; $this->doc->getPageRenderer()->loadPrototype(); if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) { $this->doc->JScodeLibArray['dyntabmenu'] = $this->doc->getDynTabMenuJScode(); } else { $this->doc->loadJavascriptLib('js/tabmenu.js'); } $this->doc->form = '<form action="" name="editForm">'; $tsconfig = t3lib_BEfunc::getModTSconfig($this->id, 'templavoila.wizards.newContentElement'); $this->config = $tsconfig['properties']; // Getting the current page and receiving access information (used in main()) $perms_clause = $BE_USER->getPagePermsClause(1); $pageinfo = t3lib_BEfunc::readPageAccess($this->id, $perms_clause); $this->access = is_array($pageinfo) ? 1 : 0; $this->apiObj = t3lib_div::makeInstance('tx_templavoila_api'); // If no parent record was specified, find one: if (!$this->parentRecord) { $mainContentAreaFieldName = $this->apiObj->ds_getFieldNameByColumnPosition($this->id, 0); if ($mainContentAreaFieldName != FALSE) { $this->parentRecord = 'pages:' . $this->id . ':sDEF:lDEF:' . $mainContentAreaFieldName . ':vDEF:0'; } } }
/** * Initialize function menu array * * @return void */ function menuConfig() { // MENU-ITEMS: $this->MOD_MENU = array('bigControlPanel' => '', 'clipBoard' => '', 'localization' => ''); // Loading module configuration: $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']); // Clean up settings: $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); }
/** * Obtains amount of results per page for the given view. * * @param string $view * @return int */ protected function getResultsPerPage($view) { $tsConfig = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'tx_realurl.' . $view . '.pagebrowser.resultsPerPage'); $resultsPerPage = $tsConfig['value']; return tx_realurl::testInt($resultsPerPage) ? intval($resultsPerPage) : tx_realurl_pagebrowser::RESULTS_PER_PAGE_DEFAULT; }
/** * Returns sys_language records. * * @param integer $id Page id: If zero, the query will select all sys_language records from root level which are NOT hidden. If set to another value, the query will select all sys_language records that has a pages_language_overlay record on that page (and is not hidden, unless you are admin user) * @param string $mode TYPO3_MODE to be used: 'FE', 'BE'. Constant TYPO3_MODE is default. * @return array Language records including faked record for default language */ function getLanguages($id, $mode = TYPO3_MODE) { global $LANG; static $cache = array(); $mode = $mode ? $mode : 'NONE'; if (is_array($cache[$mode])) { return $cache[$mode]; } $modSharedTSconfig = t3lib_BEfunc::getModTSconfig($id, 'mod.SHARED'); $languages = array(0 => array('uid' => 0, 'pid' => 0, 'hidden' => 0, 'title' => strlen($modSharedTSconfig['properties']['defaultLanguageLabel']) ? $modSharedTSconfig['properties']['defaultLanguageLabel'] . ' (' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_web_list.xml:defaultLanguage') . ')' : $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_web_list.xml:defaultLanguage'), 'flag' => $modSharedTSconfig['properties']['defaultLanguageFlag'])); $exQ = ' AND sys_language.hidden=0'; if ($mode === 'BE' and $GLOBALS['BE_USER']->isAdmin()) { $exQ = ''; } if ($id) { $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('sys_language.*', 'pages_language_overlay,sys_language', 'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid=' . intval($id) . $exQ, 'pages_language_overlay.sys_language_uid,sys_language.uid,sys_language.pid,sys_language.tstamp,sys_language.hidden,sys_language.title,sys_language.static_lang_isocode,sys_language.flag', 'sys_language.title'); } else { $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('sys_language.*', 'sys_language', 'sys_language.hidden=0', '', 'sys_language.title'); } if ($rows) { if ($mode === 'BE') { foreach ($rows as $row) { if ($GLOBALS['BE_USER']->checkLanguageAccess($row['uid'])) { $languages[$row['uid']] = $row; } } } else { foreach ($rows as $row) { $languages[$row['uid']] = $row; } } } $cache[$mode] = $languages; return $languages; }
/** * Creates the screen for "new page wizard" * * @param integer $positionPid: Can be positive and negative depending of where the new page is going: Negative always points to a position AFTER the page having the abs. value of the positionId. Positive numbers means to create as the first subpage to another page. * @return string Content for the screen output. * @todo Check required field(s), support t3d */ function renderWizard_createNewPage($positionPid) { global $LANG, $BE_USER, $TYPO3_CONF_VARS; // The user already submitted the create page form: if (t3lib_div::_GP('doCreate')) { // Check if the HTTP_REFERER is valid $refInfo = parse_url(t3lib_div::getIndpEnv('HTTP_REFERER')); $httpHost = t3lib_div::getIndpEnv('TYPO3_HOST_ONLY'); if ($httpHost == $refInfo['host'] || t3lib_div::_GP('vC') == $BE_USER->veriCode() || $TYPO3_CONF_VARS['SYS']['doNotCheckReferer']) { // Create new page $newID = $this->createPage(t3lib_div::_GP('data'), $positionPid); if ($newID > 0) { // Get TSconfig for a different selection of fields in the editing form $TSconfig = t3lib_BEfunc::getModTSconfig($newID, 'mod.web_txtemplavoilaM1.createPageWizard.fieldNames'); $fieldNames = isset($TSconfig['value']) ? $TSconfig['value'] : 'hidden,title,alias'; // Create parameters and finally run the classic page module's edit form for the new page: $params = '&edit[pages][' . $newID . ']=edit&columnsOnly=' . rawurlencode($fieldNames); $returnUrl = rawurlencode(t3lib_div::getIndpEnv('SCRIPT_NAME') . '?id=' . $newID . '&updatePageTree=1'); header('Location: ' . t3lib_div::locationHeaderUrl($this->doc->backPath . 'alt_doc.php?returnUrl=' . $returnUrl . $params)); exit; } else { debug('Error: Could not create page!'); } } else { debug('Error: Referer host did not match with server host.'); } } // Based on t3d/xml templates: if (false != ($templateFile = t3lib_div::_GP('templateFile'))) { if (t3lib_div::getFileAbsFileName($templateFile) && @is_file($templateFile)) { // First, find positive PID for import of the page: $importPID = t3lib_BEfunc::getTSconfig_pidValue('pages', '', $positionPid); // Initialize the import object: $import = $this->getImportObject(); if ($import->loadFile($templateFile, 1)) { // Find the original page id: $origPageId = key($import->dat['header']['pagetree']); // Perform import of content $import->importData($importPID); // Find the new page id (root page): $newID = $import->import_mapId['pages'][$origPageId]; if ($newID) { // If the page was destined to be inserted after another page, move it now: if ($positionPid < 0) { $cmd = array(); $cmd['pages'][$newID]['move'] = $positionPid; $tceObject = $import->getNewTCE(); $tceObject->start(array(), $cmd); $tceObject->process_cmdmap(); } // PLAIN COPY FROM ABOVE - BEGIN // Get TSconfig for a different selection of fields in the editing form $TSconfig = t3lib_BEfunc::getModTSconfig($newID, 'tx_templavoila.mod1.createPageWizard.fieldNames'); $fieldNames = isset($TSconfig['value']) ? $TSconfig['value'] : 'hidden,title,alias'; // Create parameters and finally run the classic page module's edit form for the new page: $params = '&edit[pages][' . $newID . ']=edit&columnsOnly=' . rawurlencode($fieldNames); $returnUrl = rawurlencode(t3lib_div::getIndpEnv('SCRIPT_NAME') . '?id=' . $newID . '&updatePageTree=1'); header('Location: ' . t3lib_div::locationHeaderUrl($this->doc->backPath . 'alt_doc.php?returnUrl=' . $returnUrl . $params)); exit; // PLAIN COPY FROM ABOVE - END } else { debug('Error: Could not create page!'); } } } } // Start assembling the HTML output $this->doc->form = '<form action="' . htmlspecialchars('index.php?id=' . $this->pObj->id) . '" method="post" autocomplete="off" enctype="' . $TYPO3_CONF_VARS['SYS']['form_enctype'] . '" onsubmit="return TBE_EDITOR_checkSubmit(1);">'; $this->doc->divClass = ''; $this->doc->getTabMenu(0, '_', 0, array('' => '')); // init tceforms for javascript printing $tceforms = t3lib_div::makeInstance('t3lib_TCEforms'); $tceforms->initDefaultBEMode(); $tceforms->backPath = $GLOBALS['BACK_PATH']; $tceforms->doSaveFieldName = 'doSave'; // Setting up the context sensitive menu: $CMparts = $this->doc->getContextMenuCode(); $this->doc->JScode .= $CMparts[0] . $tceforms->printNeededJSFunctions_top(); $this->doc->bodyTagAdditions = $CMparts[1]; $this->doc->postCode .= $CMparts[2] . $tceforms->printNeededJSFunctions(); $content .= $this->doc->header($LANG->sL('LLL:EXT:lang/locallang_core.xml:db_new.php.pagetitle')); $content .= $this->doc->startPage($LANG->getLL('createnewpage_title')); // Add template selectors $tmplSelectorCode = ''; $tmplSelector = $this->renderTemplateSelector($positionPid, 'tmplobj'); if ($tmplSelector) { # $tmplSelectorCode.='<em>'.$LANG->getLL ('createnewpage_templateobject_createemptypage').'</em>'; $tmplSelectorCode .= $this->doc->spacer(5); $tmplSelectorCode .= $tmplSelector; $tmplSelectorCode .= $this->doc->spacer(10); } $tmplSelector = $this->renderTemplateSelector($positionPid, 't3d'); if ($tmplSelector) { #$tmplSelectorCode.='<em>'.$LANG->getLL ('createnewpage_templateobject_createpagewithdefaultcontent').'</em>'; $tmplSelectorCode .= $this->doc->spacer(5); $tmplSelectorCode .= $tmplSelector; $tmplSelectorCode .= $this->doc->spacer(10); } if ($tmplSelectorCode) { $content .= '<h3>' . htmlspecialchars($LANG->getLL('createnewpage_selecttemplate')) . '</h3>'; $content .= $LANG->getLL('createnewpage_templateobject_description'); $content .= $this->doc->spacer(10); $content .= $tmplSelectorCode; } $content .= '<input type="hidden" name="positionPid" value="' . $positionPid . '" />'; $content .= '<input type="hidden" name="doCreate" value="1" />'; $content .= '<input type="hidden" name="cmd" value="crPage" />'; return $content; }
/** * Extract the disallowed TCAFORM field values of $fieldName given field * * @param integer $parentPageId * @param string field name of TCAFORM * @access private * @return string comma seperated list of integer */ function getDisallowedTSconfigItemsByFieldName($positionPid, $fieldName) { $disallowPageTemplateItems = ''; $disallowPageTemplateList = array(); // Negative PID values is pointing to a page on the same level as the current. if ($positionPid < 0) { $pidRow = t3lib_BEfunc::getRecordWSOL('pages', abs($positionPid), 'pid'); $parentPageId = $pidRow['pid']; } else { $parentPageId = $positionPid; } // Get PageTSconfig for reduce the output of selectded template structs $disallowPageTemplateStruct = t3lib_BEfunc::getModTSconfig(abs($parentPageId), 'TCEFORM.pages.' . $fieldName); if (isset($disallowPageTemplateStruct['properties']['removeItems'])) { $disallowedPageTemplateList = $disallowPageTemplateStruct['properties']['removeItems']; } $tmp_disallowedPageTemplateItems = array_unique(t3lib_div::intExplode(',', t3lib_div::expandList($disallowedPageTemplateList), TRUE)); return count($tmp_disallowedPageTemplateItems) ? implode(',', $tmp_disallowedPageTemplateItems) : '0'; }
/** * Get the linkvalidator modTSconfig for a page. * * @param integer $page: uid of the page. * @return array $modTS: mod.linkvalidator TSconfig array. */ protected function loadModTSconfig($page) { $modTS = t3lib_BEfunc::getModTSconfig($page, 'mod.linkvalidator'); $parseObj = t3lib_div::makeInstance('t3lib_TSparser'); $parseObj->parse($this->configuration); if (count($parseObj->errors) > 0) { $parseErrorMessage = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidTSconfig') . '<br />'; foreach ($parseObj->errors as $errorInfo) { $parseErrorMessage .= $errorInfo[0] . '<br />'; } throw new Exception($parseErrorMessage, '1295476989'); } $TSconfig = $parseObj->setup; $modTS = $modTS['properties']; $overrideTs = $TSconfig['mod.']['tx_linkvalidator.']; if (is_array($overrideTs)) { $modTS = t3lib_div::array_merge_recursive_overrule($modTS, $overrideTs); } return $modTS; }
/** * Returns module configuration for a pid. * * @param integer Page id for which to get the module configuration. * @return array The properties of teh module configuration for the page id. * @see onClickEvent() */ function getModConfig($pid) { if (!isset($this->getModConfigCache[$pid])) { // Acquiring TSconfig for this PID: $this->getModConfigCache[$pid] = t3lib_BEfunc::getModTSconfig($pid, $this->modConfigStr); } return $this->getModConfigCache[$pid]['properties']; }
/** * Main processing, creating the list of new record tables to select from * * @return void */ function main() { global $BE_USER, $LANG; // If there was a page - or if the user is admin (admins has access to the root) we proceed: if ($this->pageinfo['uid'] || $BE_USER->isAdmin()) { // Acquiring TSconfig for this module/current page: $this->web_list_modTSconfig = t3lib_BEfunc::getModTSconfig($this->pageinfo['uid'], 'mod.web_list'); $this->allowedNewTables = t3lib_div::trimExplode(',', $this->web_list_modTSconfig['properties']['allowedNewTables'], 1); $this->deniedNewTables = t3lib_div::trimExplode(',', $this->web_list_modTSconfig['properties']['deniedNewTables'], 1); // Acquiring TSconfig for this module/parent page: $this->web_list_modTSconfig_pid = t3lib_BEfunc::getModTSconfig($this->pageinfo['pid'], 'mod.web_list'); $this->allowedNewTables_pid = t3lib_div::trimExplode(',', $this->web_list_modTSconfig_pid['properties']['allowedNewTables'], 1); $this->deniedNewTables_pid = t3lib_div::trimExplode(',', $this->web_list_modTSconfig_pid['properties']['deniedNewTables'], 1); // More init: if (!$this->showNewRecLink('pages')) { $this->newPagesInto = 0; } if (!$this->showNewRecLink('pages', $this->allowedNewTables_pid, $this->deniedNewTables_pid)) { $this->newPagesAfter = 0; } // Set header-HTML and return_url if (is_array($this->pageinfo) && $this->pageinfo['uid']) { $iconImgTag = t3lib_iconWorks::getSpriteIconForRecord('pages', $this->pageinfo, array('title' => htmlspecialchars($this->pageinfo['_thePath']))); $title = strip_tags($this->pageinfo[$GLOBALS['TCA']['pages']['ctrl']['label']]); } else { $iconImgTag = t3lib_iconWorks::getSpriteIcon('apps-pagetree-root', array('title' => htmlspecialchars($this->pageinfo['_thePath']))); $title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']; } $this->code = '<span class="typo3-moduleHeader">' . $this->doc->wrapClickMenuOnIcon($iconImgTag, 'pages', $this->pageinfo['uid']) . htmlspecialchars(t3lib_div::fixed_lgd_cs($title, 45)) . '</span><br />'; $this->R_URI = $this->returnUrl; // GENERATE the HTML-output depending on mode (pagesOnly is the page wizard) if (!$this->pagesOnly) { // Regular new element: $this->regularNew(); } elseif ($this->showNewRecLink('pages')) { // Pages only wizard $this->pagesOnly(); } // Add all the content to an output section $this->content .= $this->doc->section('', $this->code); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['CONTENT'] = $this->content; // Build the <body> for the module $this->content = $this->doc->startPage($LANG->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); } }
/** * Initializes the Module * * @return void */ function init() { // $s = microtime(TRUE); if (!$this->MCONF['name']) { $this->MCONF = $GLOBALS['MCONF']; if (!$this->MCONF['name']) { $MCONF = ''; require 'conf.php'; $this->MCONF = $MCONF; } } $this->isAdmin = $GLOBALS['BE_USER']->isAdmin(); $this->id = intval(t3lib_div::_GP('id')); // $this->CMD = t3lib_div::_GP('CMD'); $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']); $this->TSprop = $this->modTSconfig['properties']; $this->confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['tt_news']); $tceTSC = array(); if ($this->confArr['useStoragePid']) { $tceTSC = t3lib_BEfunc::getTCEFORM_TSconfig('tt_news_cat', array('pid' => $this->id)); } $this->storagePid = $tceTSC['_STORAGE_PID'] ? $tceTSC['_STORAGE_PID'] : $this->id; $newArticlePid = intval($this->TSprop['list.']['pidForNewArticles']); $this->newArticlePid = $newArticlePid ? $newArticlePid : $this->id; $this->script = 'mod.php?M=web_txttnewsM1'; if ($fieldList = $this->TSprop['list.']['fList']) { $this->fieldList = $fieldList; } // get pageinfo array for the current page $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause); $this->localCalcPerms = $GLOBALS['BE_USER']->calcPerms($this->pageinfo); // get pageinfo array for the GRSP $grspPI = t3lib_BEfunc::readPageAccess($this->storagePid, $this->perms_clause); $this->grspCalcPerms = $GLOBALS['BE_USER']->calcPerms($grspPI); $this->mayUserEditCategories = $this->grspCalcPerms & 16; // get pageinfo array for newArticlePid $newArticlePidPI = t3lib_BEfunc::readPageAccess($this->newArticlePid, $this->perms_clause); $this->newArticleCalcPerms = $GLOBALS['BE_USER']->calcPerms($newArticlePidPI); $this->mayUserEditArticles = $this->newArticleCalcPerms & 16; $pagesTSC = t3lib_BEfunc::getPagesTSconfig($this->id); if ($pagesTSC['tx_ttnews.']['singlePid']) { $this->singlePid = intval($pagesTSC['tx_ttnews.']['singlePid']); } $this->initCategories(); $this->setPidList(); $this->initPermsCache(); if ($this->pidList) { $this->setEditablePages($this->pidList); } $this->menuConfig(); $this->mData = $GLOBALS['BE_USER']->uc['moduleData']['web_txttnewsM1']; $this->current_sys_language = intval($this->MOD_SETTINGS['language']); $this->searchLevels = intval($this->MOD_SETTINGS['searchLevels']); $this->thumbs = intval($this->MOD_SETTINGS['showThumbs']); $limit = intval($this->MOD_SETTINGS['showLimit']); if ($limit) { $this->showLimit = $limit; } else { $this->showLimit = intval($this->TSprop['list.']['limit']); } $this->initGPvars(); // debug((microtime(TRUE)-$s), 'time ('.__CLASS__.'::'.__FUNCTION__.')', __LINE__, __FILE__, 3); }
/** * Find relevant removeItems blocks for a certain field with the given paramst * * @param array $params * @param string $field * @return array */ protected function getRemoveItems($params, $field) { $pid = $params['row'][$params['table'] == 'pages' ? 'uid' : 'pid']; $modTSConfig = t3lib_BEfunc::getModTSconfig($pid, 'TCEFORM.' . $params['table'] . '.' . $field . '.removeItems'); return t3lib_div::trimExplode(',', $modTSConfig['value'], TRUE); }
/** * Creating the module output. * * @return void */ function main() { global $LANG, $BACK_PATH; if ($this->id && $this->access) { // Init position map object: $posMap = t3lib_div::makeInstance('ext_posMap'); $posMap->cur_sys_language = $this->sys_language; $posMap->backPath = $BACK_PATH; if ((string) $this->colPos != '') { // If a column is pre-set: if ($this->uid_pid < 0) { $row = array(); $row['uid'] = abs($this->uid_pid); } else { $row = ''; } $this->onClickEvent = $posMap->onClickInsertRecord($row, $this->colPos, '', $this->uid_pid, $this->sys_language); } else { $this->onClickEvent = ''; } // *************************** // Creating content // *************************** // use a wrapper div $this->content .= '<div id="user-setup-wrapper">'; $this->content .= $this->doc->header($LANG->getLL('newContentElement')); $this->content .= $this->doc->spacer(5); // Wizard $code = ''; $wizardItems = $this->getWizardItems(); // Wrapper for wizards $this->elementWrapper['sectionHeader'] = array('<h3 class="divider">', '</h3>'); $this->elementWrapper['section'] = array('<table border="0" cellpadding="1" cellspacing="2">', '</table>'); $this->elementWrapper['wizard'] = array('<tr>', '</tr>'); $this->elementWrapper['wizardPart'] = array('<td>', '</td>'); // copy wrapper for tabs $this->elementWrapperForTabs = $this->elementWrapper; // Hook for manipulating wizardItems, wrapper, onClickEvent etc. if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'] as $classData) { $hookObject = t3lib_div::getUserObj($classData); if (!$hookObject instanceof cms_newContentElementWizardsHook) { throw new UnexpectedValueException('$hookObject must implement interface cms_newContentElementWizardItemsHook', 1227834741); } $hookObject->manipulateWizardItems($wizardItems, $this); } } if ($this->config['renderMode'] == 'tabs' && $this->elementWrapperForTabs != $this->elementWrapper) { // restore wrapper for tabs if they are overwritten in hook $this->elementWrapper = $this->elementWrapperForTabs; } // add document inline javascript $this->doc->JScode = $this->doc->wrapScriptTags(' function goToalt_doc() { // ' . $this->onClickEvent . ' } if(top.refreshMenu) { top.refreshMenu(); } else { top.TYPO3ModuleMenu.refreshMenu(); } '); // Traverse items for the wizard. // An item is either a header or an item rendered with a radio button and title/description and icon: $cc = $key = 0; $menuItems = array(); foreach ($wizardItems as $k => $wInfo) { if ($wInfo['header']) { $menuItems[] = array('label' => htmlspecialchars($wInfo['header']), 'content' => $this->elementWrapper['section'][0]); $key = count($menuItems) - 1; } else { $content = ''; // Radio button: $oC = "document.editForm.defValues.value=unescape('" . rawurlencode($wInfo['params']) . "');goToalt_doc();" . (!$this->onClickEvent ? "window.location.hash='#sel2';" : ''); $content .= $this->elementWrapper['wizardPart'][0] . '<input type="radio" name="tempB" value="' . htmlspecialchars($k) . '" onclick="' . htmlspecialchars($this->doc->thisBlur() . $oC) . '" />' . $this->elementWrapper['wizardPart'][1]; // Onclick action for icon/title: $aOnClick = 'document.getElementsByName(\'tempB\')[' . $cc . '].checked=1;' . $this->doc->thisBlur() . $oC . 'return false;'; // Icon: $iInfo = @getimagesize($wInfo['icon']); $content .= $this->elementWrapper['wizardPart'][0] . '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '"> <img' . t3lib_iconWorks::skinImg($this->doc->backPath, $wInfo['icon'], '') . ' alt="" /></a>' . $this->elementWrapper['wizardPart'][1]; // Title + description: $content .= $this->elementWrapper['wizardPart'][0] . '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '"><strong>' . htmlspecialchars($wInfo['title']) . '</strong><br />' . nl2br(htmlspecialchars(trim($wInfo['description']))) . '</a>' . $this->elementWrapper['wizardPart'][1]; // Finally, put it together in a container: $menuItems[$key]['content'] .= $this->elementWrapper['wizard'][0] . $content . $this->elementWrapper['wizard'][1]; $cc++; } } // add closing section-tag foreach ($menuItems as $key => $val) { $menuItems[$key]['content'] .= $this->elementWrapper['section'][1]; } // Add the wizard table to the content, wrapped in tabs: if ($this->config['renderMode'] == 'tabs') { $this->doc->inDocStylesArray[] = ' .typo3-dyntabmenu-divs { background-color: #fafafa; border: 1px solid #adadad; width: 680px; } .typo3-dyntabmenu-divs table { margin: 15px; } .typo3-dyntabmenu-divs table td { padding: 3px; } '; $code = $LANG->getLL('sel1', 1) . '<br /><br />' . $this->doc->getDynTabMenu($menuItems, 'new-content-element-wizard', false, false, 100); } else { $code = $LANG->getLL('sel1', 1) . '<br /><br />'; foreach ($menuItems as $section) { $code .= $this->elementWrapper['sectionHeader'][0] . $section['label'] . $this->elementWrapper['sectionHeader'][1] . $section['content']; } } $this->content .= $this->doc->section(!$this->onClickEvent ? $LANG->getLL('1_selectType') : '', $code, 0, 1); // If the user must also select a column: if (!$this->onClickEvent) { // Add anchor "sel2" $this->content .= $this->doc->section('', '<a name="sel2"></a>'); $this->content .= $this->doc->spacer(20); // Select position $code = $LANG->getLL('sel2', 1) . '<br /><br />'; // Load SHARED page-TSconfig settings and retrieve column list from there, if applicable: $modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->id, 'mod.SHARED'); $colPosList = strcmp(trim($modTSconfig_SHARED['properties']['colPos_list']), '') ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3'; $colPosList = implode(',', array_unique(t3lib_div::intExplode(',', $colPosList))); // Removing duplicates, if any // Finally, add the content of the column selector to the content: $code .= $posMap->printContentElementColumns($this->id, 0, $colPosList, 1, $this->R_URI); $this->content .= $this->doc->section($LANG->getLL('2_selectPosition'), $code, 0, 1); } // Close wrapper div $this->content .= '</div>'; } else { // In case of no access: $this->content = ''; $this->content .= $this->doc->header($LANG->getLL('newContentElement')); $this->content .= $this->doc->spacer(5); } // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['CONTENT'] = $this->content; // Build the <body> for the module $this->content = $this->doc->startPage($LANG->getLL('newContentElement')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->sectionEnd(); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Returns sys_language records. * * @param integer Page id: If zero, the query will select all sys_language records from root level which are NOT hidden. If set to another value, the query will select all sys_language records that has a pages_language_overlay record on that page (and is not hidden, unless you are admin user) * @return array Language records including faked record for default language */ function getLanguages($id) { global $LANG; $modSharedTSconfig = t3lib_BEfunc::getModTSconfig($id, 'mod.SHARED'); // fallback non sprite-configuration if (preg_match('/\\.gif$/', $modSharedTSconfig['properties']['defaultLanguageFlag'])) { $modSharedTSconfig['properties']['defaultLanguageFlag'] = str_replace('.gif', '', $modSharedTSconfig['properties']['defaultLanguageFlag']); } $languages = array(0 => array('uid' => 0, 'pid' => 0, 'hidden' => 0, 'title' => strlen($modSharedTSconfig['properties']['defaultLanguageLabel']) ? $modSharedTSconfig['properties']['defaultLanguageLabel'] . ' (' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_web_list.xml:defaultLanguage') . ')' : $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_web_list.xml:defaultLanguage'), 'flag' => $modSharedTSconfig['properties']['defaultLanguageFlag'])); $exQ = $GLOBALS['BE_USER']->isAdmin() ? '' : ' AND sys_language.hidden=0'; if ($id) { $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('sys_language.*', 'pages_language_overlay,sys_language', 'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid=' . intval($id) . $exQ, 'pages_language_overlay.sys_language_uid,sys_language.uid,sys_language.pid,sys_language.tstamp,sys_language.hidden,sys_language.title,sys_language.static_lang_isocode,sys_language.flag', 'sys_language.title'); } else { $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('sys_language.*', 'sys_language', 'sys_language.hidden=0', '', 'sys_language.title'); } if ($rows) { foreach ($rows as $row) { $languages[$row['uid']] = $row; } } return $languages; }
/** * Make selector box for creating new translation in a language * Displays only languages which are not yet present for the current page and * that are not disabled with page TS. * * @param integer Page id for which to create a new language (pages_language_overlay record) * @return string <select> HTML element (if there were items for the box anyways...) * @see getTable_tt_content() */ function languageSelector($id) { if ($GLOBALS['BE_USER']->check('tables_modify', 'pages_language_overlay')) { // First, select all $res = $GLOBALS['SOBE']->exec_languageQuery(0); $langSelItems = array(); $langSelItems[0] = ' <option value="0"></option>'; while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { if ($GLOBALS['BE_USER']->checkLanguageAccess($row['uid'])) { $langSelItems[$row['uid']] = ' <option value="' . $row['uid'] . '">' . htmlspecialchars($row['title']) . '</option>'; } } // Then, subtract the languages which are already on the page: $res = $GLOBALS['SOBE']->exec_languageQuery($id); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { unset($langSelItems[$row['uid']]); } // Remove disallowed languages if (count($langSelItems) > 1 && !$GLOBALS['BE_USER']->user['admin'] && strlen($GLOBALS['BE_USER']->groupData['allowed_languages'])) { $allowed_languages = array_flip(explode(',', $GLOBALS['BE_USER']->groupData['allowed_languages'])); if (count($allowed_languages)) { foreach ($langSelItems as $key => $value) { if (!isset($allowed_languages[$key]) && $key != 0) { unset($langSelItems[$key]); } } } } // Remove disabled languages $modSharedTSconfig = t3lib_BEfunc::getModTSconfig($id, 'mod.SHARED'); $disableLanguages = isset($modSharedTSconfig['properties']['disableLanguages']) ? t3lib_div::trimExplode(',', $modSharedTSconfig['properties']['disableLanguages'], 1) : array(); if (count($langSelItems) && count($disableLanguages)) { foreach ($disableLanguages as $language) { if ($language != 0 && isset($langSelItems[$language])) { unset($langSelItems[$language]); } } } // If any languages are left, make selector: if (count($langSelItems) > 1) { $onChangeContent = 'window.location.href=\'' . $this->backPath . 'alt_doc.php?&edit[pages_language_overlay][' . $id . ']=new&overrideVals[pages_language_overlay][doktype]=' . (int) $this->pageRecord['doktype'] . '&overrideVals[pages_language_overlay][sys_language_uid]=\'+this.options[this.selectedIndex].value+\'&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '\''; return $GLOBALS['LANG']->getLL('new_language', 1) . ': <select name="createNewLanguage" onchange="' . htmlspecialchars($onChangeContent) . '"> ' . implode('', $langSelItems) . ' </select><br /><br />'; } } }
/** * Initialisation of this backend module * * @return void * @access public */ function init() { parent::init(); $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']); $this->modSharedTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.SHARED'); $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); $tmpTSc = t3lib_BEfunc::getModTSconfig($this->id, 'mod.web_list'); $tmpTSc = $tmpTSc['properties']['newContentWiz.']['overrideWithExtension']; if ($tmpTSc != 'templavoila' && t3lib_extMgm::isLoaded($tmpTSc)) { $this->newContentWizScriptPath = $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath($tmpTSc) . 'mod1/db_new_content_el.php'; } $this->extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['templavoila']); $this->altRoot = t3lib_div::_GP('altRoot'); $this->versionId = t3lib_div::_GP('versionId'); if (isset($this->modTSconfig['properties']['previewTitleMaxLen'])) { $this->previewTitleMaxLen = intval($this->modTSconfig['properties']['previewTitleMaxLen']); } // enable debug for development if ($this->modTSconfig['properties']['debug']) { $this->debug = TRUE; } $this->blindIcons = isset($this->modTSconfig['properties']['blindIcons']) ? t3lib_div::trimExplode(',', $this->modTSconfig['properties']['blindIcons'], TRUE) : array(); $this->addToRecentElements(); // Fill array allAvailableLanguages and currently selected language (from language selector or from outside) $this->allAvailableLanguages = $this->getAvailableLanguages(0, true, true, true); $this->currentLanguageKey = $this->allAvailableLanguages[$this->MOD_SETTINGS['language']]['ISOcode']; $this->currentLanguageUid = $this->allAvailableLanguages[$this->MOD_SETTINGS['language']]['uid']; // If no translations exist for this page, set the current language to default (as there won't be a language selector) $this->translatedLanguagesArr = $this->getAvailableLanguages($this->id); if (count($this->translatedLanguagesArr) == 1) { // Only default language exists $this->currentLanguageKey = 'DEF'; } // Set translator mode if the default langauge is not accessible for the user: if (!$GLOBALS['BE_USER']->checkLanguageAccess(0) && !$GLOBALS['BE_USER']->isAdmin()) { $this->translatorMode = TRUE; } // Initialize side bar and wizards: $this->sideBarObj =& t3lib_div::getUserObj('&tx_templavoila_mod1_sidebar', ''); $this->sideBarObj->init($this); $this->sideBarObj->position = isset($this->modTSconfig['properties']['sideBarPosition']) ? $this->modTSconfig['properties']['sideBarPosition'] : 'toptabs'; $this->wizardsObj = t3lib_div::getUserObj('&tx_templavoila_mod1_wizards', ''); $this->wizardsObj->init($this); // Initialize TemplaVoila API class: $this->apiObj = t3lib_div::makeInstance('tx_templavoila_api', $this->altRoot ? $this->altRoot : 'pages'); if (isset($this->modSharedTSconfig['properties']['useLiveWorkspaceForReferenceListUpdates'])) { $this->apiObj->modifyReferencesInLiveWS(true); } // Initialize the clipboard $this->clipboardObj =& t3lib_div::getUserObj('&tx_templavoila_mod1_clipboard', ''); $this->clipboardObj->init($this); // Initialize the record module $this->recordsObj =& t3lib_div::getUserObj('&tx_templavoila_mod1_records', ''); $this->recordsObj->init($this); // Add the localization module if localization is enabled: if ($this->alternativeLanguagesDefined()) { $this->localizationObj =& t3lib_div::getUserObj('&tx_templavoila_mod1_localization', ''); $this->localizationObj->init($this); } }
/** * Generates $this->storageFolders with available sysFolders linked to as storageFolders for the user * * @return void Modification in $this->storageFolders array */ function findingStorageFolderIds() { global $TYPO3_DB; // Init: $readPerms = $GLOBALS['BE_USER']->getPagePermsClause(1); $this->storageFolders=array(); // Looking up all references to a storage folder: $res = $TYPO3_DB->exec_SELECTquery ( 'uid,storage_pid', 'pages', 'storage_pid>0'.t3lib_BEfunc::deleteClause('pages') ); while(false !== ($row = $TYPO3_DB->sql_fetch_assoc($res))) { if ($GLOBALS['BE_USER']->isInWebMount($row['storage_pid'],$readPerms)) { $storageFolder = t3lib_BEfunc::getRecord('pages',$row['storage_pid'],'uid,title'); if ($storageFolder['uid']) { $this->storageFolders[$storageFolder['uid']] = $storageFolder['title']; } } } // Looking up all root-pages and check if there's a tx_templavoila.storagePid setting present $res = $TYPO3_DB->exec_SELECTquery ( 'pid,root', 'sys_template', 'root=1' . t3lib_BEfunc::deleteClause('sys_template') ); while (false !== ($row = $TYPO3_DB->sql_fetch_assoc($res))) { $tsCconfig = t3lib_BEfunc::getModTSconfig($row['pid'],'tx_templavoila'); if ( isset($tsCconfig['properties']['storagePid']) && $GLOBALS['BE_USER']->isInWebMount($tsCconfig['properties']['storagePid'],$readPerms) ) { $storageFolder = t3lib_BEfunc::getRecord('pages',$tsCconfig['properties']['storagePid'],'uid,title'); if ($storageFolder['uid']) { $this->storageFolders[$storageFolder['uid']] = $storageFolder['title']; } } } // Compopsing select list: $sysFolderPIDs = array_keys($this->storageFolders); $sysFolderPIDs[]=0; $this->storageFolders_pidList = implode(',',$sysFolderPIDs); }
/** * Adding CM element for Create new wizard (either db_new.php or sysext/cms/layout/db_new_content_el.php or custom wizard) * * @param string Table name * @param integer UID for the current record. * @param array Record. * @return array Item array, element in $menuItems * @internal */ function DB_newWizard($table, $uid, $rec) { // If mod.web_list.newContentWiz.overrideWithExtension is set, use that extension's create new content wizard instead: $tmpTSc = t3lib_BEfunc::getModTSconfig($this->pageinfo['uid'], 'mod.web_list'); $tmpTSc = $tmpTSc['properties']['newContentWiz.']['overrideWithExtension']; $newContentWizScriptPath = t3lib_extMgm::isLoaded($tmpTSc) ? t3lib_extMgm::extRelPath($tmpTSc) . 'mod1/db_new_content_el.php' : 'sysext/cms/layout/db_new_content_el.php'; $url = $table == 'pages' || !t3lib_extMgm::isLoaded('cms') ? 'db_new.php?id=' . $uid . '&pagesOnly=1' : $newContentWizScriptPath . '?id=' . $rec['pid'] . '&sys_language_uid=' . intval($rec['sys_language_uid']); return $this->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_newWizard')), $this->excludeIcon(t3lib_iconWorks::getSpriteIcon('actions-' . ($table === 'pages' ? 'page' : 'document') . '-new')), $this->urlRefForCM($url, 'returnUrl'), 0); }
/** * Preparing menu content * * @return void */ function menuConfig() { $this->MOD_MENU = array( # 'set_showDSxml' => '', 'set_details' => '', 'set_unusedDs' => '', 'wiz_step' => '' ); // page/be_user TSconfig settings and blinding of menu-items $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.'.$this->MCONF['name']); // CLEANSE SETTINGS $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); }
/** * Creating the module output. * * @return void */ function main() { global $LANG, $BACK_PATH, $BE_USER; if ($this->page_id) { // Get record for element: $elRow = t3lib_BEfunc::getRecordWSOL($this->table, $this->moveUid); // Headerline: Icon, record title: $hline = t3lib_iconWorks::getSpriteIconForRecord($this->table, $elRow, array('id' => "c-recIcon", 'title' => htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($elRow, $this->table)))); $hline .= t3lib_BEfunc::getRecordTitle($this->table, $elRow, TRUE); // Make-copy checkbox (clicking this will reload the page with the GET var makeCopy set differently): $onClick = 'window.location.href=\'' . t3lib_div::linkThisScript(array('makeCopy' => !$this->makeCopy)) . '\';'; $hline .= '<br /><input type="hidden" name="makeCopy" value="0" /><input type="checkbox" name="makeCopy" id="makeCopy" value="1"' . ($this->makeCopy ? ' checked="checked"' : '') . ' onclick="' . htmlspecialchars($onClick) . '" /> <label for="makeCopy">' . $LANG->getLL('makeCopy', 1) . '</label>'; // Add the header-content to the module content: $this->content .= $this->doc->section($LANG->getLL('moveElement') . ':', $hline, 0, 1); $this->content .= $this->doc->spacer(20); // Reset variable to pick up the module content in: $code = ''; // IF the table is "pages": if ((string) $this->table == 'pages') { // Get page record (if accessible): $pageinfo = t3lib_BEfunc::readPageAccess($this->page_id, $this->perms_clause); if (is_array($pageinfo) && $BE_USER->isInWebMount($pageinfo['pid'], $this->perms_clause)) { // Initialize the position map: $posMap = t3lib_div::makeInstance('ext_posMap_pages'); $posMap->moveOrCopy = $this->makeCopy ? 'copy' : 'move'; // Print a "go-up" link IF there is a real parent page (and if the user has read-access to that page). if ($pageinfo['pid']) { $pidPageInfo = t3lib_BEfunc::readPageAccess($pageinfo['pid'], $this->perms_clause); if (is_array($pidPageInfo)) { if ($BE_USER->isInWebMount($pidPageInfo['pid'], $this->perms_clause)) { $code .= '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('uid' => intval($pageinfo['pid']), 'moveUid' => $this->moveUid))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-up') . t3lib_BEfunc::getRecordTitle('pages', $pidPageInfo, TRUE) . '</a><br />'; } else { $code .= t3lib_iconWorks::getSpriteIconForRecord('pages', $pidPageInfo) . t3lib_BEfunc::getRecordTitle('pages', $pidPageInfo, TRUE) . '<br />'; } } } // Create the position tree: $code .= $posMap->positionTree($this->page_id, $pageinfo, $this->perms_clause, $this->R_URI); } } // IF the table is "tt_content": if ((string) $this->table == 'tt_content') { // First, get the record: $tt_content_rec = t3lib_BEfunc::getRecord('tt_content', $this->moveUid); // ? if (!$this->input_moveUid) { $this->page_id = $tt_content_rec['pid']; } // Checking if the parent page is readable: $pageinfo = t3lib_BEfunc::readPageAccess($this->page_id, $this->perms_clause); if (is_array($pageinfo) && $BE_USER->isInWebMount($pageinfo['pid'], $this->perms_clause)) { // Initialize the position map: $posMap = t3lib_div::makeInstance('ext_posMap_tt_content'); $posMap->moveOrCopy = $this->makeCopy ? 'copy' : 'move'; $posMap->cur_sys_language = $this->sys_language; // Headerline for the parent page: Icon, record title: $hline = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageinfo, array('title' => htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($pageinfo, 'pages')))); $hline .= t3lib_BEfunc::getRecordTitle('pages', $pageinfo, TRUE); // Load SHARED page-TSconfig settings and retrieve column list from there, if applicable: $modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->page_id, 'mod.SHARED'); // SHARED page-TSconfig settings. $colPosList = strcmp(trim($modTSconfig_SHARED['properties']['colPos_list']), '') ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3'; $colPosList = implode(',', array_unique(t3lib_div::intExplode(',', $colPosList))); // Removing duplicates, if any // Adding parent page-header and the content element columns from position-map: $code = $hline . '<br />'; $code .= $posMap->printContentElementColumns($this->page_id, $this->moveUid, $colPosList, 1, $this->R_URI); // Print a "go-up" link IF there is a real parent page (and if the user has read-access to that page). $code .= '<br />'; $code .= '<br />'; if ($pageinfo['pid']) { $pidPageInfo = t3lib_BEfunc::readPageAccess($pageinfo['pid'], $this->perms_clause); if (is_array($pidPageInfo)) { if ($BE_USER->isInWebMount($pidPageInfo['pid'], $this->perms_clause)) { $code .= '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('uid' => intval($pageinfo['pid']), 'moveUid' => $this->moveUid))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-up') . t3lib_BEfunc::getRecordTitle('pages', $pidPageInfo, TRUE) . '</a><br />'; } else { $code .= t3lib_iconWorks::getSpriteIconForRecord('pages', $pidPageInfo) . t3lib_BEfunc::getRecordTitle('pages', $pidPageInfo, TRUE) . '<br />'; } } } // Create the position tree (for pages): $code .= $posMap->positionTree($this->page_id, $pageinfo, $this->perms_clause, $this->R_URI); } } // Add the $code content as a new section to the module: $this->content .= $this->doc->section($LANG->getLL('selectPositionOfElement') . ':', $code, 0, 1); } // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['CONTENT'] = $this->content; // Build the <body> for the module $this->content = $this->doc->startPage($LANG->getLL('movingElement')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * @param Optional the pid of the page. This can be used to get the correct flagpath for default language (which is set in tsconfig) **/ public function getFlagImgPath($pidForDefault = '', $BACK_PATH = '') { $flagAbsPath = t3lib_div::getFileAbsFileName($GLOBALS['TCA']['sys_language']['columns']['flag']['config']['fileFolder']); $flagIconPath = $BACK_PATH . '../' . substr($flagAbsPath, strlen(PATH_site)); if ($this->getUid() == '0') { if ($pidForDefault == '') { $pidForDefault = $this->_guessCurrentPid(); } $sharedTSconfig = t3lib_BEfunc::getModTSconfig($pidForDefault, 'mod.SHARED'); $path = strlen($sharedTSconfig['properties']['defaultLanguageFlag']) && @is_file($flagAbsPath . $sharedTSconfig['properties']['defaultLanguageFlag']) ? $flagIconPath . $sharedTSconfig['properties']['defaultLanguageFlag'] : null; } else { $path = $flagIconPath . $this->row['flag']; } return $path; }
/** * Main function of class * * @return string HTML output */ function main() { global $LANG; $menu = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[tsconf_parts]', $this->pObj->MOD_SETTINGS['tsconf_parts'], $this->pObj->MOD_MENU['tsconf_parts']); $menu .= '<br /><label for="checkTsconf_alphaSort">' . $GLOBALS['LANG']->getLL('sort_alphabetic', true) . '</label> ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[tsconf_alphaSort]', $this->pObj->MOD_SETTINGS['tsconf_alphaSort'], '', '', 'id="checkTsconf_alphaSort"'); $menu .= '<br /><br />'; if ($this->pObj->MOD_SETTINGS['tsconf_parts'] == 99) { $TSparts = t3lib_BEfunc::getPagesTSconfig($this->pObj->id, '', 1); $lines = array(); $pUids = array(); foreach ($TSparts as $k => $v) { if ($k != 'uid_0') { if ($k == 'defaultPageTSconfig') { $pTitle = '<strong>' . $GLOBALS['LANG']->getLL('editTSconfig_default', 1) . '</strong>'; $editIcon = ''; } else { $pUids[] = substr($k, 4); $row = t3lib_BEfunc::getRecordWSOL('pages', substr($k, 4)); $pTitle = $this->pObj->doc->getHeader('pages', $row, '', 0); $editIdList = substr($k, 4); $params = '&edit[pages][' . $editIdList . ']=edit&columnsOnly=TSconfig'; $onclickUrl = t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], ''); $editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $GLOBALS['LANG']->getLL('editTSconfig', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>'; } $TScontent = nl2br(htmlspecialchars(trim($v) . chr(10))); $tsparser = t3lib_div::makeInstance('t3lib_TSparser'); $tsparser->lineNumberOffset = 0; $TScontent = $tsparser->doSyntaxHighlight(trim($v) . LF, '', 0); $lines[] = ' <tr><td nowrap="nowrap" class="bgColor5">' . $pTitle . '</td></tr> <tr><td nowrap="nowrap" class="bgColor4">' . $TScontent . $editIcon . '</td></tr> <tr><td> </td></tr> '; } } if (count($pUids)) { $params = '&edit[pages][' . implode(',', $pUids) . ']=edit&columnsOnly=TSconfig'; $onclickUrl = t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], ''); $editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $GLOBALS['LANG']->getLL('editTSconfig_all', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '<strong>' . $GLOBALS['LANG']->getLL('editTSconfig_all', 1) . '</strong>' . '</a>'; } else { $editIcon = ''; } $theOutput .= $this->pObj->doc->section($LANG->getLL('tsconf_title'), t3lib_BEfunc::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'tsconfig_edit', $GLOBALS['BACK_PATH'], '|<br />') . $menu . ' <br /><br /> <!-- Edit fields: --> <table border="0" cellpadding="0" cellspacing="1">' . implode('', $lines) . '</table><br />' . $editIcon, 0, 1); } else { $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here! $tmpl->tt_track = 0; // Do not log time-performance information $tmpl->fixedLgd = 0; $tmpl->linkObjects = 0; $tmpl->bType = ''; $tmpl->ext_expandAllNotes = 1; $tmpl->ext_noPMicons = 1; switch ($this->pObj->MOD_SETTINGS['tsconf_parts']) { case '1': $modTSconfig = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod'); break; case '1a': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_layout', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1b': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_view', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1c': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_modules', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1d': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_list', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1e': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_info', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1f': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_func', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1g': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_ts', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '2': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '5': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEFORM', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '6': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '3': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TSFE', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '4': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('user', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; default: $modTSconfig['properties'] = t3lib_BEfunc::getPagesTSconfig($this->pObj->id); break; } $modTSconfig = $modTSconfig['properties']; if (!is_array($modTSconfig)) { $modTSconfig = array(); } $theOutput .= $this->pObj->doc->section($LANG->getLL('tsconf_title'), t3lib_BEfunc::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'tsconfig_hierarchy', $GLOBALS['BACK_PATH'], '|<br />') . $menu . ' <!-- Page TSconfig Tree: --> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td nowrap="nowrap">' . $tmpl->ext_getObjTree($modTSconfig, '', '', '', '', $this->pObj->MOD_SETTINGS['tsconf_alphaSort']) . '</td> </tr> </table>', 0, 1); } // Return output: return $theOutput; }
/** * Rendering the localization information table. * * @param array The Page tree data * @return string HTML for the localization information table. */ function renderL10nTable(&$tree) { global $LANG; // System languages retrieved: $languages = $this->getSystemLanguages(); // Title length: $titleLen = $GLOBALS['BE_USER']->uc['titleLen']; // Put together the TREE: $output = ''; $newOL_js = array(); $langRecUids = array(); foreach ($tree->tree as $data) { $tCells = array(); $langRecUids[0][] = $data['row']['uid']; // 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>'; // DEFAULT language: // "View page" link is created: $viewPageLink = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($data['row']['uid'], $GLOBALS['BACK_PATH'], '', '', '', '&L=###LANG_UID###')) . '" title="' . $LANG->getLL('lang_renderl10n_viewPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>'; $status = $data['row']['l18n_cfg'] & 1 ? 'c-blocked' : 'c-ok'; // Create links: $info = ''; $editUid = $data['row']['uid']; $params = '&edit[pages][' . $editUid . ']=edit'; $info .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '" title="' . $LANG->getLL('lang_renderl10n_editDefaultLanguagePage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>'; $info .= '<a href="#" onclick="' . htmlspecialchars('top.loadEditId(' . intval($data['row']['uid']) . ',"&SET[language]=0"); return false;') . '" title="' . $LANG->getLL('lang_renderl10n_editPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-open') . '</a>'; $info .= str_replace('###LANG_UID###', '0', $viewPageLink); $info .= ' '; $info .= $data['row']['l18n_cfg'] & 1 ? '<span title="' . $LANG->sL('LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg.I.1', '1') . '">D</span>' : ' '; $info .= t3lib_div::hideIfNotTranslated($data['row']['l18n_cfg']) ? '<span title="' . $LANG->sL('LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg.I.2', '1') . '">N</span>' : ' '; // Put into cell: $tCells[] = '<td class="' . $status . ' c-leftLine">' . $info . '</td>'; $tCells[] = '<td class="' . $status . '" title="' . $LANG->getLL('lang_renderl10n_CEcount', '1') . '" align="center">' . $this->getContentElementCount($data['row']['uid'], 0) . '</td>'; $modSharedTSconfig = t3lib_BEfunc::getModTSconfig($data['row']['uid'], 'mod.SHARED'); $disableLanguages = isset($modSharedTSconfig['properties']['disableLanguages']) ? t3lib_div::trimExplode(',', $modSharedTSconfig['properties']['disableLanguages'], 1) : array(); // Traverse system languages: foreach ($languages as $langRow) { if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int) $this->pObj->MOD_SETTINGS['lang'] === (int) $langRow['uid']) { $row = $this->getLangStatus($data['row']['uid'], $langRow['uid']); $info = ''; if (is_array($row)) { $langRecUids[$langRow['uid']][] = $row['uid']; $status = $row['_HIDDEN'] ? t3lib_div::hideIfNotTranslated($data['row']['l18n_cfg']) || $data['row']['l18n_cfg'] & 1 ? 'c-blocked' : 'c-fallback' : 'c-ok'; $icon = t3lib_iconWorks::getSpriteIconForRecord('pages_language_overlay', $row, array('class' => 'c-recIcon')); $info = $icon . htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'], $titleLen)) . (strcmp($row['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($row['nav_title'], $titleLen)) . '</em>]' : '') . ($row['_COUNT'] > 1 ? '<div>' . $LANG->getLL('lang_renderl10n_badThingThereAre', '1') . '</div>' : ''); $tCells[] = '<td class="' . $status . ' c-leftLine">' . $info . '</td>'; // Edit whole record: $info = ''; $editUid = $row['uid']; $params = '&edit[pages_language_overlay][' . $editUid . ']=edit'; $info .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '" title="' . $LANG->getLL('lang_renderl10n_editLanguageOverlayRecord', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>'; $info .= '<a href="#" onclick="' . htmlspecialchars('top.loadEditId(' . intval($data['row']['uid']) . ',"&SET[language]=' . $langRow['uid'] . '"); return false;') . '" title="' . $LANG->getLL('lang_renderl10n_editPageLang', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-open') . '</a>'; $info .= str_replace('###LANG_UID###', $langRow['uid'], $viewPageLink); $tCells[] = '<td class="' . $status . '">' . $info . '</td>'; $tCells[] = '<td class="' . $status . '" title="' . $LANG->getLL('lang_renderl10n_CEcount', '1') . '" align="center">' . $this->getContentElementCount($data['row']['uid'], $langRow['uid']) . '</td>'; } else { if (in_array($langRow['uid'], $disableLanguages)) { // Language has been disabled for this page $status = 'c-blocked'; $info = ''; } else { $status = t3lib_div::hideIfNotTranslated($data['row']['l18n_cfg']) || $data['row']['l18n_cfg'] & 1 ? 'c-blocked' : 'c-fallback'; $info = '<input type="checkbox" name="newOL[' . $langRow['uid'] . '][' . $data['row']['uid'] . ']" value="1" />'; $newOL_js[$langRow['uid']] .= ' +(document.webinfoForm[\'newOL[' . $langRow['uid'] . '][' . $data['row']['uid'] . ']\'].checked ? \'&edit[pages_language_overlay][' . $data['row']['uid'] . ']=new\' : \'\') '; } $tCells[] = '<td class="' . $status . ' c-leftLine"> </td>'; $tCells[] = '<td class="' . $status . '"> </td>'; $tCells[] = '<td class="' . $status . '">' . $info . '</td>'; } } } $output .= ' <tr class="bgColor4"> ' . implode(' ', $tCells) . ' </tr>'; } // Put together HEADER: $tCells = array(); $tCells[] = '<td>' . $LANG->getLL('lang_renderl10n_page', '1') . ':</td>'; if (is_array($langRecUids[0])) { $params = '&edit[pages][' . implode(',', $langRecUids[0]) . ']=edit&columnsOnly=title,nav_title,l18n_cfg,hidden'; $editIco = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '" title="' . $LANG->getLL('lang_renderl10n_editPageProperties', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-new') . '</a>'; } else { $editIco = ''; } $tCells[] = '<td class="c-leftLine" colspan="2">' . $LANG->getLL('lang_renderl10n_default', '1') . ':' . $editIco . '</td>'; foreach ($languages as $langRow) { if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int) $this->pObj->MOD_SETTINGS['lang'] === (int) $langRow['uid']) { // Title: $tCells[] = '<td class="c-leftLine">' . htmlspecialchars($langRow['title']) . '</td>'; // Edit language overlay records: if (is_array($langRecUids[$langRow['uid']])) { $params = '&edit[pages_language_overlay][' . implode(',', $langRecUids[$langRow['uid']]) . ']=edit&columnsOnly=title,nav_title,hidden'; $tCells[] = '<td><a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '" title="' . $LANG->getLL('lang_renderl10n_editLangOverlays', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a></td>'; } else { $tCells[] = '<td> </td>'; } // Create new overlay records: $params = "'" . $newOL_js[$langRow['uid']] . "+'&columnsOnly=title,hidden,sys_language_uid&defVals[pages_language_overlay][sys_language_uid]=" . $langRow['uid']; $tCells[] = '<td><a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '" title="' . $LANG->getLL('lang_getlangsta_createNewTranslationHeaders', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-new') . '</a></td>'; } } $output = ' <tr class="t3-row-header"> ' . implode(' ', $tCells) . ' </tr>' . $output; $output = ' <table border="0" cellspacing="0" cellpadding="0" id="langTable" class="typo3-dblist">' . $output . ' </table>'; return $output; }