/** * @param $params * @param $tsObj * @return string */ public function displayMessage(&$params, &$tsObj) { if (!$this->staticDsIsEnabled() || $this->datastructureDbCount() == 0) { return; } if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) { $link = 'index.php?&id=0&CMD[showExt]=templavoila&SET[singleDetails]=updateModule'; } else { $link = 'mod.php?&id=0&M=tools_em&CMD[showExt]=templavoila&SET[singleDetails]=updateModule'; } $out = ' <div style="position:absolute;top:10px;right:10px; width:300px;"> <div class="typo3-message message-information"> <div class="message-header">' . $GLOBALS['LANG']->sL('LLL:EXT:templavoila/locallang.xml:extconf.staticWizard.header') . '</div> <div class="message-body"> ' . $GLOBALS['LANG']->sL('LLL:EXT:templavoila/locallang.xml:extconf.staticWizard.message') . '<br /> <a style="text-decoration:underline;" href="' . $link . '"> ' . $GLOBALS['LANG']->sL('LLL:EXT:templavoila/locallang.xml:extconf.staticWizard.link') . '</a> </div> </div> </div> '; return $out; }
/** * * @param string $lang * @return string */ public static function getFlagIconFileForLanguage($flagName) { $flag = null; if (!strlen($flagName)) { $flagName = 'unknown'; } if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) { $flagAbsPath = t3lib_div::getFileAbsFileName($GLOBALS['TCA']['sys_language']['columns']['flag']['config']['fileFolder']); $flagIconPath = $GLOBALS['BACK_PATH'] . '../' . substr($flagAbsPath, strlen(PATH_site)); if (is_file($flagAbsPath . $flagName)) { $flag = $flagIconPath . $flagName; } } else { // same dirty trick as for #17286 in Core if(is_file(t3lib_div::getFileAbsFileName('EXT:t3skin/images/flags/'. $flagName . '.png', FALSE))) { // resolving extpath on its own because otherwise this might not return a relative path $flag = $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('t3skin') . '/images/flags/' . $flagName . '.png'; } } return $flag; }
/** * Displays the edit page screen if the currently selected page is of the doktype "Sysfolder" * * @param array $pageRecord: The current page record * @return mixed HTML output from this submodule or FALSE if this submodule doesn't feel responsible * @access public */ function renderDoktype_254($pageRecord) { global $LANG, $BE_USER, $TYPO3_CONF_VARS; // Prepare the record icon including a content sensitive menu link wrapped around it: $pageTitle = htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle('pages', $pageRecord), 50)); $recordIcon = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord); $iconEdit = t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => htmlspecialchars($LANG->sL('LLL:EXT:lang/locallang_mod_web_list.xml:editPage')))); $editButton = $this->pObj->link_edit($iconEdit, 'pages', $pageRecord['uid']); if ($this->userHasAccessToListModule()) { if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) { $listModuleURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'db_list.php?id=' . intval($this->pObj->id); } else { $listModuleURL = t3lib_BEfunc::getModuleUrl('web_list', array('id' => intval($this->pObj->id)), ''); } $onClick = "top.nextLoadModuleUrl='" . $listModuleURL . "';top.fsMod.recentIds['web']=" . intval($this->pObj->id) . ";top.goToModule('web_list',1);"; $listModuleLink = '<br /><br />' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open') . '<strong><a href="#" onClick="' . $onClick . '">' . $LANG->getLL('editpage_sysfolder_switchtolistview', '', 1) . '</a></strong> '; } else { $listModuleLink = $LANG->getLL('editpage_sysfolder_listview_noaccess', '', 1); } $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $LANG->getLL('editpage_sysfolder_intro', '', 1), '', t3lib_FlashMessage::INFO); $content = $flashMessage->render() . $listModuleLink; return $content; }
/** * 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'; } } }
if(tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) >= 4005000) { t3lib_extMgm::addToAllTCAtypes('pages', 'tx_templavoila_ds;;;;1-1-1,tx_templavoila_to', '', 'replace:backend_layout'); t3lib_extMgm::addToAllTCAtypes('pages', 'tx_templavoila_next_ds;;;;1-1-1,tx_templavoila_next_to', '', 'replace:backend_layout_next_level'); t3lib_extMgm::addToAllTCAtypes('pages', 'tx_templavoila_flex;;;;1-1-1', '', 'after:title'); } else { t3lib_extMgm::addToAllTCAtypes('pages','tx_templavoila_ds;;;;1-1-1,tx_templavoila_to,tx_templavoila_next_ds;;;;1-1-1,tx_templavoila_next_to,tx_templavoila_flex;;;;1-1-1'); } if ($TCA['pages']['ctrl']['requestUpdate'] != '') { $TCA['pages']['ctrl']['requestUpdate'] .= ','; } $TCA['pages']['ctrl']['requestUpdate'] .= 'tx_templavoila_ds,tx_templavoila_next_ds'; } else { if(tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) >= 4005000) { if (!$_EXTCONF['enable.']['oldPageModule']) { t3lib_extMgm::addToAllTCAtypes('pages', 'tx_templavoila_to;;;;1-1-1', '', 'replace:backend_layout'); t3lib_extMgm::addToAllTCAtypes('pages', 'tx_templavoila_next_to;;;;1-1-1', '', 'replace:backend_layout_next_level'); t3lib_extMgm::addToAllTCAtypes('pages', 'tx_templavoila_flex;;;;1-1-1', '', 'after:title'); } else { t3lib_extMgm::addFieldsToPalette('pages', 'layout', '--linebreak--, tx_templavoila_to;;;;1-1-1, tx_templavoila_next_to;;;;1-1-1', 'after:backend_layout_next_level'); t3lib_extMgm::addToAllTCAtypes('pages', 'tx_templavoila_flex;;;;1-1-1', '', 'after:title'); } } else { t3lib_extMgm::addToAllTCAtypes('pages','tx_templavoila_to;;;;1-1-1,tx_templavoila_next_to;;;;1-1-1,tx_templavoila_flex;;;;1-1-1'); } unset($TCA['pages']['columns']['tx_templavoila_to']['displayCond']); unset($TCA['pages']['columns']['tx_templavoila_next_to']['displayCond']); }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @param string Identifier for function of module * @return array all available buttons as an assoc. array */ protected function getDocHeaderButtons() { global $TCA, $LANG, $BACK_PATH, $BE_USER; $buttons = array('csh' => '', 'view' => '', 'history_page' => '', 'move_page' => '', 'move_record' => '', 'new_page' => '', 'edit_page' => '', 'record_list' => '', 'shortcut' => '', 'cache' => ''); // View page $viewAddGetVars = $this->currentLanguageUid ? '&L=' . $this->currentLanguageUid : ''; $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id, $BACK_PATH, t3lib_BEfunc::BEgetRootLine($this->id), '', '', $viewAddGetVars)) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1))) . '</a>'; // Shortcut if ($BE_USER->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); } // If access to Web>List for user, then link to that module. if ($BE_USER->check('modules', 'web_list')) { if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) { $href = $GLOBALS['BACK_PATH'] . 'db_list.php?id=' . $this->id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); } else { $href = t3lib_BEfunc::getModuleUrl('web_list', array('id' => $this->id, 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI'))); } $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1))) . '</a>'; } if (!$this->modTSconfig['properties']['disableIconToolbar']) { // Page history $buttons['history_page'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(\'' . $BACK_PATH . 'show_rechis.php?element=' . rawurlencode('pages:' . $this->id) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '#latest\');return false;') . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-history-open', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:recordHistory', 1))) . '</a>'; if (!$this->translatorMode && $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'new')) { // Create new page (wizard) $buttons['new_page'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(\'' . $BACK_PATH . 'db_new.php?id=' . $this->id . '&pagesOnly=1&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI') . '&updatePageTree=true') . '\');return false;') . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-new', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:newPage', 1))) . '</a>'; } if (!$this->translatorMode && $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'edit')) { // Edit page properties $params = '&edit[pages][' . $this->id . ']=edit'; $buttons['edit_page'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $BACK_PATH)) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:editPageProperties', 1))) . '</a>'; // Move page $buttons['move_page'] = '<a href="' . htmlspecialchars($BACK_PATH . 'move_el.php?table=pages&uid=' . $this->id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-move', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:move_page', 1))) . '</a>'; } $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'pagemodule', $BACK_PATH); if ($this->id) { $cacheUrl = $GLOBALS['BACK_PATH'] . 'tce_db.php?vC=' . $GLOBALS['BE_USER']->veriCode() . t3lib_BEfunc::getUrlToken('tceAction') . '&redirect=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '&cacheCmd=' . $this->id; $buttons['cache'] = '<a href="' . $cacheUrl . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.clear_cache', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-cache-clear') . '</a>'; } } return $buttons; }
/** * Show meta data part of Data Structure * * @param [type] $DSstring: ... * @return [type] ... */ function DSdetails($DSstring) { $DScontent = t3lib_div::xml2array($DSstring); $inputFields = 0; $referenceFields = 0; $rootelements = 0; if (is_array ($DScontent) && is_array($DScontent['ROOT']['el'])) { foreach($DScontent['ROOT']['el'] as $elKey => $elCfg) { $rootelements++; if (isset($elCfg['TCEforms'])) { // Assuming that a reference field for content elements is recognized like this, increment counter. Otherwise assume input field of some sort. if ($elCfg['TCEforms']['config']['type']==='group' && $elCfg['TCEforms']['config']['allowed']==='tt_content') { $referenceFields++; } else { $inputFields++; } } if (isset($elCfg['el'])) $elCfg['el'] = '...'; unset($elCfg['tx_templavoila']['sample_data']); unset($elCfg['tx_templavoila']['tags']); unset($elCfg['tx_templavoila']['eType']); if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000){ $rootElementsHTML.='<b>'.$elCfg['tx_templavoila']['title'].'</b>'.t3lib_div::view_array($elCfg); } else { $rootElementsHTML.='<b>'.$elCfg['tx_templavoila']['title'].'</b>'.t3lib_utility_Debug::viewArray($elCfg); } } } /* $DScontent = array('meta' => $DScontent['meta']); */ $languageMode = ''; if (is_array($DScontent['meta'])) { if ($DScontent['meta']['langDisable']) { $languageMode = 'Disabled'; } elseif ($DScontent['meta']['langChildren']) { $languageMode = 'Inheritance'; } else { $languageMode = 'Separate'; } } return array( 'HTML' => /*t3lib_div::view_array($DScontent).'Language Mode => "'.$languageMode.'"<hr/> Root Elements = '.$rootelements.', hereof ref/input fields = '.($referenceFields.'/'.$inputFields).'<hr/> '.$rootElementsHTML*/ $this->renderDSdetails($DScontent), 'languageMode' => $languageMode, 'rootelements' => $rootelements, 'inputFields' => $inputFields, 'referenceFields' => $referenceFields ); }
/** * Renders the hierarchical display for a Data Structure. * Calls itself recursively * * @param array Part of Data Structure (array of elements) * @param boolean If true, the Data Structure table will show links for mapping actions. Otherwise it will just layout the Data Structure visually. * @param array Part of Current mapping information corresponding to the $dataStruct array - used to evaluate the status of mapping for a certain point in the structure. * @param array Array of HTML paths * @param array Options for mapping mode control (INNER, OUTER etc...) * @param array Content from template file splitted by current mapping info - needed to evaluate whether mapping information for a certain level actually worked on live content! * @param integer Recursion level, counting up * @param array Accumulates the table rows containing the structure. This is the array returned from the function. * @param string Form field prefix. For each recursion of this function, two [] parts are added to this prefix * @param string HTML path. For each recursion a section (divided by "|") is added. * @param boolean If true, the "Map" link can be shown, otherwise not. Used internally in the recursions. * @return array Table rows as an array of <tr> tags, $tRows */ function drawDataStructureMap($dataStruct,$mappingMode=0,$currentMappingInfo=array(),$pathLevels=array(),$optDat=array(),$contentSplittedByMapping=array(),$level=0,$tRows=array(),$formPrefix='',$path='',$mapOK=1) { $bInfo = t3lib_div::clientInfo(); $multilineTooltips = ($bInfo['BROWSER'] == 'msie'); $rowIndex = -1; // Data Structure array must be ... and array of course... if (is_array($dataStruct)) { foreach($dataStruct as $key => $value) { $rowIndex++; if ($key == 'meta') { // Do not show <meta> information in mapping interface! continue; } if (is_array($value)) { // The value of each entry must be an array. // ******************** // Making the row: // ******************** $rowCells=array(); // Icon: $info = $this->dsTypeInfo($value); $icon = '<img'.$info[2].' alt="" title="'.$info[1].$key.'" class="absmiddle" />'; // Composing title-cell: if (preg_match('/^LLL:/', $value['tx_templavoila']['title'])) { $translatedTitle = $GLOBALS['LANG']->sL($value['tx_templavoila']['title']); $translateIcon = '<sup title="' . $GLOBALS['LANG']->getLL('displayDSTitleTranslated') . '">*</sup>'; } else { $translatedTitle = $value['tx_templavoila']['title']; $translateIcon = ''; } $this->elNames[$formPrefix.'['.$key.']']['tx_templavoila']['title'] = $icon.'<strong>'.htmlspecialchars(t3lib_div::fixed_lgd_cs($translatedTitle, 30)).'</strong>'.$translateIcon; $rowCells['title'] = '<img src="clear.gif" width="'.($level*16).'" height="1" alt="" />'.$this->elNames[$formPrefix.'['.$key.']']['tx_templavoila']['title']; // Description: $this->elNames[$formPrefix.'['.$key.']']['tx_templavoila']['description'] = $rowCells['description'] = htmlspecialchars($value['tx_templavoila']['description']); // In "mapping mode", render HTML page and Command links: if ($mappingMode) { // HTML-path + CMD links: $isMapOK = 0; if ($currentMappingInfo[$key]['MAP_EL']) { // If mapping information exists...: $mappingElement = str_replace('~~~', ' ', $currentMappingInfo[$key]['MAP_EL']); if (isset($contentSplittedByMapping['cArray'][$key])) { // If mapping of this information also succeeded...: $cF = implode(chr(10),t3lib_div::trimExplode(chr(10),$contentSplittedByMapping['cArray'][$key],1)); if (strlen($cF)>200) { $cF = t3lib_div::fixed_lgd_cs($cF,90).' '.t3lib_div::fixed_lgd_cs($cF,-90); } // Render HTML path: list($pI) = $this->markupObj->splitPath($currentMappingInfo[$key]['MAP_EL']); $tagIcon = t3lib_iconWorks::skinImg($this->doc->backPath, t3lib_extMgm::extRelPath('templavoila') . 'html_tags/' . $pI['el'] . '.gif', 'height="17"') . ' alt="" border="0"'; $okTitle = htmlspecialchars($cF ? sprintf($GLOBALS['LANG']->getLL('displayDSContentFound'), strlen($contentSplittedByMapping['cArray'][$key])) . ($multilineTooltips ? ':' . chr(10) . chr(10) . $cF : '') : $GLOBALS['LANG']->getLL('displayDSContentEmpty')); $rowCells['htmlPath'] = t3lib_iconWorks::getSpriteIcon('status-dialog-ok', array('title' => $okTitle)). tx_templavoila_htmlmarkup::getGnyfMarkup($pI['el'], '---' . htmlspecialchars(t3lib_div::fixed_lgd_cs($mappingElement, -80)) ). ($pI['modifier'] ? $pI['modifier'] . ($pI['modifier_value'] ? ':' . ($pI['modifier'] != 'RANGE' ? $pI['modifier_value'] : '...') : '') : ''); $rowCells['htmlPath'] = '<a href="'.$this->linkThisScript(array( 'htmlPath'=>$path.($path?'|':'').preg_replace('/\/[^ ]*$/','',$currentMappingInfo[$key]['MAP_EL']), 'showPathOnly'=>1, 'DS_element' => t3lib_div::_GP('DS_element') )).'">'.$rowCells['htmlPath'].'</a>'; // CMD links, default content: $rowCells['cmdLinks'] = '<span class="nobr"><input type="submit" value="Re-Map" name="_" onclick="document.location=\'' . $this->linkThisScript(array( 'mapElPath' => $formPrefix . '[' . $key . ']', 'htmlPath' => $path, 'mappingToTags' => $value['tx_templavoila']['tags'], 'DS_element' => t3lib_div::_GP('DS_element') )) . '\';return false;" title="' . $GLOBALS['LANG']->getLL('buttonRemapTitle') . '" />' . '<input type="submit" value="' . $GLOBALS['LANG']->getLL('buttonChangeMode') . '" name="_" onclick="document.location=\'' . $this->linkThisScript(array( 'mapElPath' => $formPrefix . '[' . $key . ']', 'htmlPath' => $path . ($path ? '|' :'') . $pI['path'], 'doMappingOfPath' => 1, 'DS_element' => t3lib_div::_GP('DS_element') )) . '\';return false;" title="' . $GLOBALS['LANG']->getLL('buttonChangeMode') . '" /></span>'; // If content mapped ok, set flag: $isMapOK=1; } else { // Issue warning if mapping was lost: $rowCells['htmlPath'] = t3lib_iconWorks::getSpriteIcon('status-dialog-warning', array('title' => $GLOBALS['LANG']->getLL('msgNoContentFound'))) . htmlspecialchars($mappingElement); } } else { // For non-mapped cases, just output a no-break-space: $rowCells['htmlPath'] = ' '; } // CMD links; Content when current element is under mapping, then display control panel or message: if ($this->mapElPath == $formPrefix.'['.$key.']') { if ($this->doMappingOfPath) { // Creating option tags: $lastLevel = end($pathLevels); $tagsMapping = $this->explodeMappingToTagsStr($value['tx_templavoila']['tags']); $mapDat = is_array($tagsMapping[$lastLevel['el']]) ? $tagsMapping[$lastLevel['el']] : $tagsMapping['*']; unset($mapDat['']); if (is_array($mapDat) && !count($mapDat)) unset($mapDat); // Create mapping options: $didSetSel=0; $opt=array(); foreach($optDat as $k => $v) { list($pI) = $this->markupObj->splitPath($k); if (($value['type']=='attr' && $pI['modifier']=='ATTR') || ($value['type']!='attr' && $pI['modifier']!='ATTR')) { if ( (!$this->markupObj->tags[$lastLevel['el']]['single'] || $pI['modifier']!='INNER') && (!is_array($mapDat) || ($pI['modifier']!='ATTR' && isset($mapDat[strtolower($pI['modifier']?$pI['modifier']:'outer')])) || ($pI['modifier']=='ATTR' && (isset($mapDat['attr']['*']) || isset($mapDat['attr'][$pI['modifier_value']])))) ) { if($k==$currentMappingInfo[$key]['MAP_EL']) { $sel = ' selected="selected"'; $didSetSel=1; } else { $sel = ''; } $opt[]='<option value="'.htmlspecialchars($k).'"'.$sel.'>'.htmlspecialchars($v).'</option>'; } } } // Finally, put together the selector box: $rowCells['cmdLinks'] = tx_templavoila_htmlmarkup::getGnyfMarkup($pI['el'], '---' . htmlspecialchars(t3lib_div::fixed_lgd_cs($lastLevel['path'], -80)) ). '<br /><select name="dataMappingForm'.$formPrefix.'['.$key.'][MAP_EL]"> '.implode(' ',$opt).' <option value=""></option> </select> <br /> <input type="submit" name="_save_data_mapping" value="' . $GLOBALS['LANG']->getLL('buttonSet') . '" /> <input type="submit" name="_" value="' . $GLOBALS['LANG']->getLL('buttonCancel') . '" />'; $rowCells['cmdLinks'].= $this->cshItem('xMOD_tx_templavoila','mapping_modeset',$this->doc->backPath,'',FALSE,'margin-bottom: 0px;'); } else { $rowCells['cmdLinks'] = t3lib_iconWorks::getSpriteIcon('status-dialog-notification') . ' <strong>' . $GLOBALS['LANG']->getLL('msgHowToMap') . '</strong>'; $rowCells['cmdLinks'].= '<br /> <input type="submit" value="' . $GLOBALS['LANG']->getLL('buttonCancel') . '" name="_" onclick="document.location=\'' . $this->linkThisScript(array( 'DS_element' => t3lib_div::_GP('DS_element') )) .'\';return false;" />'; } } elseif (!$rowCells['cmdLinks'] && $mapOK && $value['type']!='no_map') { $rowCells['cmdLinks'] = '<input type="submit" value="' . $GLOBALS['LANG']->getLL('buttonMap') . '" name="_" onclick="document.location=\'' . $this->linkThisScript(array( 'mapElPath' => $formPrefix . '[' . $key . ']', 'htmlPath' => $path, 'mappingToTags' => $value['tx_templavoila']['tags'], 'DS_element' => t3lib_div::_GP('DS_element') )) . '\';return false;" />'; } } // Display mapping rules: $rowCells['tagRules'] = implode('<br />', t3lib_div::trimExplode(',', strtolower($value['tx_templavoila']['tags']), 1)); if (!$rowCells['tagRules']) { $rowCells['tagRules'] = $GLOBALS['LANG']->getLL('all'); } // Display edit/delete icons: if ($this->editDataStruct) { $editAddCol = '<a href="' . $this->linkThisScript(array( 'DS_element' => $formPrefix . '[' . $key . ']' )) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => $GLOBALS['LANG']->getLL('editEntry'))). '</a> <a href="' . $this->linkThisScript(array( 'DS_element_DELETE' => $formPrefix . '[' . $key . ']' )) . '" onClick="return confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('confirmDeleteEntry')) . ');">' . t3lib_iconWorks::getSpriteIcon('actions-edit-delete', array('title' => $GLOBALS['LANG']->getLL('deleteEntry'))). '</a>'; $editAddCol = '<td nowrap="nowrap">' . $editAddCol . '</td>'; } else { $editAddCol = ''; } // Description: if ($this->_preview) { if (!is_array($value['tx_templavoila']['sample_data'])) { $rowCells['description'] = '[' . $GLOBALS['LANG']->getLL('noSampleData') . ']'; } elseif (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000){ $rowCells['description'] = t3lib_div::view_array($value['tx_templavoila']['sample_data']); } else { $rowCells['description'] = t3lib_utility_Debug::viewArray($value['tx_templavoila']['sample_data']); } } // Getting editing row, if applicable: list($addEditRows, $placeBefore) = $this->dsEdit->drawDataStructureMap_editItem($formPrefix, $key, $value, $level, $rowCells); // Add edit-row if found and destined to be set BEFORE: if ($addEditRows && $placeBefore) { $tRows[]= $addEditRows; } else // Put row together if (!$this->mapElPath || $this->mapElPath == $formPrefix.'['.$key.']') { $tRows[]=' <tr class="' . ($rowIndex % 2 ? 'bgColor4' : 'bgColor6') . '"> <td nowrap="nowrap" valign="top">'.$rowCells['title'].'</td> '.($this->editDataStruct ? '<td nowrap="nowrap">'.$key.'</td>' : '').' <td>'.$rowCells['description'].'</td> '.($mappingMode ? '<td nowrap="nowrap">'.$rowCells['htmlPath'].'</td> <td>'.$rowCells['cmdLinks'].'</td>' : '' ).' <td>'.$rowCells['tagRules'].'</td> '.$editAddCol.' </tr>'; } // Recursive call: if (($value['type']=='array') || ($value['type']=='section')) { $tRows = $this->drawDataStructureMap( $value['el'], $mappingMode, $currentMappingInfo[$key]['el'], $pathLevels, $optDat, $contentSplittedByMapping['sub'][$key], $level+1, $tRows, $formPrefix.'['.$key.'][el]', $path.($path?'|':'').$currentMappingInfo[$key]['MAP_EL'], $isMapOK ); } // Add edit-row if found and destined to be set AFTER: if ($addEditRows && !$placeBefore) { $tRows[]= $addEditRows; } } } } return $tRows; }