当前位置: 首页>>代码示例>>PHP>>正文


PHP t3lib_BEfunc::wsMapId方法代码示例

本文整理汇总了PHP中t3lib_BEfunc::wsMapId方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::wsMapId方法的具体用法?PHP t3lib_BEfunc::wsMapId怎么用?PHP t3lib_BEfunc::wsMapId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在t3lib_BEfunc的用法示例。


在下文中一共展示了t3lib_BEfunc::wsMapId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderTO_editProcessing


//.........这里部分代码省略.........
                // Adding data structure to session data so that the PREVIEW window can access the DS easily...
                $GLOBALS['BE_USER']->setAndSaveSessionData($this->MCONF['name'] . '_mappingInfo', $sesDat);
            }
        }
        // SAVE to template object
        if ($cmd == 'save_to') {
            $dataArr = array();
            // Set content, either for header or body:
            $templatemapping['MappingInfo_head'] = $currentMappingInfo_head;
            $templatemapping['MappingInfo'] = $currentMappingInfo;
            // Getting cached data:
            reset($dataStruct);
            // Init; read file, init objects:
            $fileContent = t3lib_div::getUrl($theFile);
            $htmlParse = t3lib_div::makeInstance('t3lib_parsehtml');
            $this->markupObj = t3lib_div::makeInstance('tx_templavoila_htmlmarkup');
            // Fix relative paths in source:
            $relPathFix = dirname(substr($theFile, strlen(PATH_site))) . '/';
            $uniqueMarker = uniqid('###') . '###';
            $fileContent = $htmlParse->prefixResourcePath($relPathFix, $fileContent, array('A' => $uniqueMarker));
            $fileContent = $this->fixPrefixForLinks($relPathFix, $fileContent, $uniqueMarker);
            // Get BODY content for caching:
            $contentSplittedByMapping = $this->markupObj->splitContentToMappingInfo($fileContent, $currentMappingInfo);
            $templatemapping['MappingData_cached'] = $contentSplittedByMapping['sub']['ROOT'];
            // Get HEAD content for caching:
            list($html_header) = $this->markupObj->htmlParse->getAllParts($htmlParse->splitIntoBlock('head', $fileContent), 1, 0);
            $this->markupObj->tags = $this->head_markUpTags;
            // Set up the markupObject to process only header-section tags:
            $h_currentMappingInfo = array();
            if (is_array($currentMappingInfo_head['headElementPaths'])) {
                foreach ($currentMappingInfo_head['headElementPaths'] as $kk => $vv) {
                    $h_currentMappingInfo['el_' . $kk]['MAP_EL'] = $vv;
                }
            }
            $contentSplittedByMapping = $this->markupObj->splitContentToMappingInfo($html_header, $h_currentMappingInfo);
            $templatemapping['MappingData_head_cached'] = $contentSplittedByMapping;
            // Get <body> tag:
            $reg = '';
            //#
            //### Mansoor Ahmad - change because of PHP5.3
            //#
            //eregi('<body[^>]*>',$fileContent,$reg);
            preg_match('/<body[^>]*>/i', $fileContent, $reg);
            $templatemapping['BodyTag_cached'] = $currentMappingInfo_head['addBodyTag'] ? $reg[0] : '';
            $TOuid = t3lib_BEfunc::wsMapId('tx_templavoila_tmplobj', $row['uid']);
            $dataArr['tx_templavoila_tmplobj'][$TOuid]['templatemapping'] = serialize($templatemapping);
            $dataArr['tx_templavoila_tmplobj'][$TOuid]['fileref_mtime'] = @filemtime($theFile);
            $dataArr['tx_templavoila_tmplobj'][$TOuid]['fileref_md5'] = @md5_file($theFile);
            $tce = t3lib_div::makeInstance('t3lib_TCEmain');
            $tce->stripslashes_values = 0;
            $tce->start($dataArr, array());
            $tce->process_datamap();
            unset($tce);
            $msg[] = $GLOBALS['LANG']->getLL('msgMappingSaved');
            $row = t3lib_BEfunc::getRecordWSOL('tx_templavoila_tmplobj', $this->displayUid);
            $templatemapping = unserialize($row['templatemapping']);
            if (t3lib_div::GPvar('_save_to_return')) {
                header('Location: ' . t3lib_div::locationHeaderUrl($this->returnUrl));
                exit;
            }
        }
        // Making the menu
        $menuItems = array();
        $menuItems[] = '<input type="submit" name="_clear" value="Clear all" title="Clears all mapping information currently set." />';
        // Make either "Preview" button (body) or "Set" button (header)
        if ($headerPart) {
            // Header:
            $menuItems[] = '<input type="submit" name="_save_data_mapping" value="Set" title="Will update session data with current settings." />';
        } else {
            // Body:
            $menuItems[] = '<input type="submit" name="_preview" value="Preview" title="Will merge sample content into the template according to the current mapping information." />';
        }
        $menuItems[] = '<input type="submit" name="_save_to" value="Save" title="Saving all mapping data into the Template Object." />';
        if ($this->returnUrl) {
            $menuItems[] = '<input type="submit" name="_save_to_return" value="Save and Return" title="Saving all mapping data into the Template Object and return." />';
        }
        // If a difference is detected...:
        if (serialize($templatemapping['MappingInfo_head']) != serialize($currentMappingInfo_head) || serialize($templatemapping['MappingInfo']) != serialize($currentMappingInfo)) {
            $menuItems[] = '<input type="submit" name="_reload_from" value="Revert" title="' . sprintf('Reverting %s mapping data to original data in the Template Object.', $headerPart ? 'HEAD' : 'BODY') . '" />';
            $msg[] = 'The current mapping information is different from the mapping information in the Template Object';
        }
        $content = '

			<!--
				Menu for saving Template Objects
			-->
			<table border="0" cellpadding="2" cellspacing="2" id="c-toMenu">
				<tr class="bgColor5">
					<td>' . implode('</td>
					<td>', $menuItems) . '</td>
				</tr>
			</table>
		';
        // Making messages:
        foreach ($msg as $msgStr) {
            $content .= '
			<p><img src="' . $GLOBALS['BACK_PATH'] . 'gfx/icon_note.gif" width="18" height="16" border="0" align="top" class="absmiddle" alt="" /><strong>' . htmlspecialchars($msgStr) . '</strong></p>';
        }
        return array($content, $headerPart ? $currentMappingInfo_head : $currentMappingInfo);
    }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:101,代码来源:index.php

示例2: processSoftReferences_substTokens

 /**
  * Substition of softreference tokens
  *
  * @param	string		Content of field with soft reference tokens in.
  * @param	array		Soft reference configurations
  * @param	string		Table for which the processing occurs
  * @param	string		UID of record from table
  * @return	string		The input content with tokens substituted according to entries in softRefCfgs
  */
 function processSoftReferences_substTokens($tokenizedContent, $softRefCfgs, $table, $uid)
 {
     // traverse each softref type for this field:
     foreach ($softRefCfgs as $cfg) {
         // Get token ID:
         $tokenID = $cfg['subst']['tokenID'];
         // Default is current token value:
         $insertValue = $cfg['subst']['tokenValue'];
         // Based on mode:
         switch ((string) $this->softrefCfg[$tokenID]['mode']) {
             case 'exclude':
                 // Exclude is a simple passthrough of the value
                 break;
             case 'editable':
                 // Editable always picks up the value from this input array:
                 $insertValue = $this->softrefInputValues[$tokenID];
                 break;
             default:
                 // Mapping IDs/creating files: Based on type, look up new value:
                 switch ((string) $cfg['subst']['type']) {
                     case 'db':
                     default:
                         // Trying to map database element if found in the mapID array:
                         list($tempTable, $tempUid) = explode(':', $cfg['subst']['recordRef']);
                         if (isset($this->import_mapId[$tempTable][$tempUid])) {
                             $insertValue = t3lib_BEfunc::wsMapId($tempTable, $this->import_mapId[$tempTable][$tempUid]);
                             // Look if reference is to a page and the original token value was NOT an integer - then we assume is was an alias and try to look up the new one!
                             if ($tempTable === 'pages' && !t3lib_div::testInt($cfg['subst']['tokenValue'])) {
                                 $recWithUniqueValue = t3lib_BEfunc::getRecord($tempTable, $insertValue, 'alias');
                                 if ($recWithUniqueValue['alias']) {
                                     $insertValue = $recWithUniqueValue['alias'];
                                 }
                             }
                         }
                         break;
                         break;
                     case 'file':
                         // Create / Overwrite file:
                         $insertValue = $this->processSoftReferences_saveFile($cfg['subst']['relFileName'], $cfg, $table, $uid);
                         break;
                 }
                 break;
         }
         // Finally, swap the soft reference token in tokenized content with the insert value:
         $tokenizedContent = str_replace('{softref:' . $tokenID . '}', $insertValue, $tokenizedContent);
     }
     return $tokenizedContent;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:57,代码来源:class.tx_impexp.php

示例3: dbAnalysisStoreExec

 /**
  * Executing dbAnalysisStore
  * This will save MM relations for new records but is executed after records are created because we need to know the ID of them
  *
  * @return	void
  */
 function dbAnalysisStoreExec()
 {
     foreach ($this->dbAnalysisStore as $action) {
         $id = t3lib_BEfunc::wsMapId($action[4], t3lib_div::testInt($action[2]) ? $action[2] : $this->substNEWwithIDs[$action[2]]);
         if ($id) {
             $action[0]->writeMM($action[1], $id, $action[3]);
         }
     }
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:15,代码来源:class.t3lib_tcemain.php

示例4: wizard_step3

	/**
	 * Step 3: Begin template mapping
	 *
	 * @return	void
	 */
	function wizard_step3()	{

			// Save session data with filename:
		$cfg = t3lib_div::_POST('CFG');
		if (isset($cfg['sitetitle']))	{
			$this->wizardData['sitetitle'] = trim($cfg['sitetitle']);
		}
		if (isset($cfg['siteurl']))	{
			$this->wizardData['siteurl'] = trim($cfg['siteurl']);
		}
		if (isset($cfg['username']))	{
			$this->wizardData['username'] = trim($cfg['username']);
		}

			// If the create-site button WAS clicked:
		if (t3lib_div::_POST('_create_site'))	{

				// Show selected template file:
			if ($this->wizardData['file'] && $this->wizardData['sitetitle'] && $this->wizardData['username'])	{

					// DO import:
				$import = $this->getImportObj();
				if (isset($this->modTSconfig['properties']['newTvSiteFile'])) {
					$inFile = t3lib_div::getFileAbsFileName($this->modTSconfig['properties']['newTVsiteTemplate']);
				} else {
					$inFile = t3lib_extMgm::extPath('templavoila') . 'mod2/new_tv_site.xml';
				}
				if (@is_file($inFile) && $import->loadFile($inFile,1))	{

					$import->importData($this->importPageUid);

						// Update various fields (the index values, eg. the "1" in "$import->import_mapId['pages'][1]]..." are the UIDs of the original records from the import file!)
					$data = array();
					$data['pages'][t3lib_BEfunc::wsMapId('pages',$import->import_mapId['pages'][1])]['title'] = $this->wizardData['sitetitle'];
					$data['sys_template'][t3lib_BEfunc::wsMapId('sys_template',$import->import_mapId['sys_template'][1])]['title'] = $GLOBALS['LANG']->getLL('newsitewizard_maintemplate', 1) . ' ' . $this->wizardData['sitetitle'];
					$data['sys_template'][t3lib_BEfunc::wsMapId('sys_template',$import->import_mapId['sys_template'][1])]['sitetitle'] = $this->wizardData['sitetitle'];
					$data['tx_templavoila_tmplobj'][t3lib_BEfunc::wsMapId('tx_templavoila_tmplobj',$import->import_mapId['tx_templavoila_tmplobj'][1])]['fileref'] = $this->wizardData['file'];
					$data['tx_templavoila_tmplobj'][t3lib_BEfunc::wsMapId('tx_templavoila_tmplobj',$import->import_mapId['tx_templavoila_tmplobj'][1])]['templatemapping'] = serialize(
						array(
							'MappingInfo' => array(
								'ROOT' => array(
									'MAP_EL' => 'body[1]/INNER'
								)
							),
							'MappingInfo_head' => array(
								'headElementPaths' => array('link[1]','link[2]','link[3]','style[1]','style[2]','style[3]'),
								'addBodyTag' => 1
							)
						)
					);

						// Update user settings
					$newUserID = t3lib_BEfunc::wsMapId('be_users',$import->import_mapId['be_users'][2]);
					$newGroupID = t3lib_BEfunc::wsMapId('be_groups',$import->import_mapId['be_groups'][1]);

					$data['be_users'][$newUserID]['username'] = $this->wizardData['username'];
					$data['be_groups'][$newGroupID]['title'] = $this->wizardData['username'];

					foreach($import->import_mapId['pages'] as $newID)	{
						$data['pages'][$newID]['perms_userid'] = $newUserID;
						$data['pages'][$newID]['perms_groupid'] = $newGroupID;
					}

						// Set URL if applicable:
					if (strlen($this->wizardData['siteurl']))	{
						$data['sys_domain']['NEW']['pid'] = t3lib_BEfunc::wsMapId('pages',$import->import_mapId['pages'][1]);
						$data['sys_domain']['NEW']['domainName'] = $this->wizardData['siteurl'];
					}

						// Execute changes:
					$tce = t3lib_div::makeInstance('t3lib_TCEmain');
					$tce->stripslashes_values = 0;
					$tce->dontProcessTransformations = 1;
					$tce->start($data,Array());
					$tce->process_datamap();

						// Setting environment:
					$this->wizardData['rootPageId'] = $import->import_mapId['pages'][1];
					$this->wizardData['templateObjectId'] = t3lib_BEfunc::wsMapId('tx_templavoila_tmplobj',$import->import_mapId['tx_templavoila_tmplobj'][1]);
					$this->wizardData['typoScriptTemplateID'] = t3lib_BEfunc::wsMapId('sys_template',$import->import_mapId['sys_template'][1]);

					t3lib_BEfunc::setUpdateSignal('updatePageTree');

					$outputString .= $GLOBALS['LANG']->getLL('newsitewizard_maintemplate', 1) . '<hr/>';
				}
			} else {
				$outputString .= $GLOBALS['LANG']->getLL('newsitewizard_maintemplate', 1);
			}
		}

			// If a template Object id was found, continue with mapping:
		if ($this->wizardData['templateObjectId'])	{
			$url = '../cm1/index.php?table=tx_templavoila_tmplobj&uid='.$this->wizardData['templateObjectId'].'&SET[selectHeaderContent]=0&_reload_from=1&id=' . $this->id . '&returnUrl='.rawurlencode('../mod2/index.php?SET[wiz_step]=4');

			$outputString.= $GLOBALS['LANG']->getLL('newsitewizard_step3ready') . '
//.........这里部分代码省略.........
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:101,代码来源:index.php

示例5: renderTO_editProcessing


//.........这里部分代码省略.........
			$htmlParse = t3lib_div::makeInstance('t3lib_parsehtml');
			$this->markupObj = t3lib_div::makeInstance('tx_templavoila_htmlmarkup');

				// Fix relative paths in source:
			$relPathFix=dirname(substr($theFile,strlen(PATH_site))).'/';
			$uniqueMarker = uniqid('###') . '###';
			$fileContent = $htmlParse->prefixResourcePath($relPathFix,$fileContent, array('A' => $uniqueMarker));
			$fileContent = $this->fixPrefixForLinks($relPathFix, $fileContent, $uniqueMarker);


				// Get BODY content for caching:
			$contentSplittedByMapping=$this->markupObj->splitContentToMappingInfo($fileContent,$currentMappingInfo);
			$templatemapping['MappingData_cached'] = $contentSplittedByMapping['sub']['ROOT'];

				// Get HEAD content for caching:
			list($html_header) =  $this->markupObj->htmlParse->getAllParts($htmlParse->splitIntoBlock('head',$fileContent),1,0);
			$this->markupObj->tags = $this->head_markUpTags;	// Set up the markupObject to process only header-section tags:

			$h_currentMappingInfo=array();
			if (is_array($currentMappingInfo_head['headElementPaths']))	{
				foreach($currentMappingInfo_head['headElementPaths'] as $kk => $vv)	{
					$h_currentMappingInfo['el_'.$kk]['MAP_EL'] = $vv;
				}
			}

			$contentSplittedByMapping = $this->markupObj->splitContentToMappingInfo($html_header,$h_currentMappingInfo);
			$templatemapping['MappingData_head_cached'] = $contentSplittedByMapping;

				// Get <body> tag:
			$reg='';
			preg_match('/<body[^>]*>/i',$fileContent,$reg);
			$templatemapping['BodyTag_cached'] = $currentMappingInfo_head['addBodyTag'] ? $reg[0] : '';

			$TOuid = t3lib_BEfunc::wsMapId('tx_templavoila_tmplobj',$row['uid']);
			$dataArr['tx_templavoila_tmplobj'][$TOuid]['templatemapping'] = serialize($templatemapping);
			$dataArr['tx_templavoila_tmplobj'][$TOuid]['fileref_mtime'] = @filemtime($theFile);
			$dataArr['tx_templavoila_tmplobj'][$TOuid]['fileref_md5'] = @md5_file($theFile);

			$tce = t3lib_div::makeInstance('t3lib_TCEmain');
			$tce->stripslashes_values=0;
			$tce->start($dataArr,array());
			$tce->process_datamap();
			unset($tce);
			$flashMessage = t3lib_div::makeInstance(
				't3lib_FlashMessage',
				$GLOBALS['LANG']->getLL('msgMappingSaved'),
				'',
				t3lib_FlashMessage::OK
			);
			$msg[] .= $flashMessage->render();
			$row = t3lib_BEfunc::getRecordWSOL('tx_templavoila_tmplobj',$this->displayUid);
			$templatemapping = unserialize($row['templatemapping']);

			if (t3lib_div::_GP('_save_to_return'))	{
				header('Location: '.t3lib_div::locationHeaderUrl($this->returnUrl));
				exit;
			}
		}

			// Making the menu
		$menuItems=array();
		$menuItems[]='<input type="submit" name="_clear" value="' . $GLOBALS['LANG']->getLL('buttonClearAll') . '" title="' . $GLOBALS['LANG']->getLL('buttonClearAllMappingTitle') . '" />';

			// Make either "Preview" button (body) or "Set" button (header)
		if ($headerPart)	{	// Header:
			$menuItems[] = '<input type="submit" name="_save_data_mapping" value="' . $GLOBALS['LANG']->getLL('buttonSet') . '" title="' . $GLOBALS['LANG']->getLL('buttonSetTitle') . '" />';
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:67,代码来源:index.php

示例6: _submitContentAsTranslatedLanguageAndGetFlexFormDiff

 /**
  * Submit incoming content as translated language to database. Must match what is available in $accum.
  *
  * @param array $accum Translation configuration
  * @param array $inputArray Array with incoming translation. Must match what is found in $accum
  * @return mixed False if error - else flexFormDiffArray (if $inputArray was an array and processing was performed.)
  */
 function _submitContentAsTranslatedLanguageAndGetFlexFormDiff($accum, $inputArray)
 {
     if (is_array($inputArray)) {
         // Initialize:
         /** @var $flexToolObj t3lib_flexformtools */
         $flexToolObj = t3lib_div::makeInstance('t3lib_flexformtools');
         $TCEmain_data = array();
         $TCEmain_cmd = array();
         $_flexFormDiffArray = array();
         // Traverse:
         foreach ($accum as $pId => $page) {
             foreach ($accum[$pId]['items'] as $table => $elements) {
                 foreach ($elements as $elementUid => $data) {
                     if (is_array($data['fields'])) {
                         foreach ($data['fields'] as $key => $tData) {
                             if (is_array($tData) && isset($inputArray[$table][$elementUid][$key])) {
                                 list($Ttable, $TuidString, $Tfield, $Tpath) = explode(':', $key);
                                 list($Tuid, $Tlang, $TdefRecord) = explode('/', $TuidString);
                                 if (!$this->createTranslationAlsoIfEmpty && $inputArray[$table][$elementUid][$key] == '' && $Tuid == 'NEW') {
                                     //if data is empty do not save it
                                     unset($inputArray[$table][$elementUid][$key]);
                                     continue;
                                 }
                                 // If new element is required, we prepare for localization
                                 if ($Tuid === 'NEW') {
                                     //print "\nNEW\n";
                                     $TCEmain_cmd[$table][$elementUid]['localize'] = $Tlang;
                                 }
                                 // If FlexForm, we set value in special way:
                                 if ($Tpath) {
                                     if (!is_array($TCEmain_data[$Ttable][$TuidString][$Tfield])) {
                                         $TCEmain_data[$Ttable][$TuidString][$Tfield] = array();
                                     }
                                     //TCEMAINDATA is passed as reference here:
                                     $flexToolObj->setArrayValueByPath($Tpath, $TCEmain_data[$Ttable][$TuidString][$Tfield], $inputArray[$table][$elementUid][$key]);
                                     $_flexFormDiffArray[$key] = array('translated' => $inputArray[$table][$elementUid][$key], 'default' => $tData['defaultValue']);
                                 } else {
                                     $TCEmain_data[$Ttable][$TuidString][$Tfield] = $inputArray[$table][$elementUid][$key];
                                 }
                                 unset($inputArray[$table][$elementUid][$key]);
                                 // Unsetting so in the end we can see if $inputArray was fully processed.
                             } else {
                                 //debug($tData,'fields not set for: '.$elementUid.'-'.$key);
                                 //debug($inputArray[$table],'inputarray');
                             }
                         }
                         if (is_array($inputArray[$table][$elementUid]) && !count($inputArray[$table][$elementUid])) {
                             unset($inputArray[$table][$elementUid]);
                             // Unsetting so in the end we can see if $inputArray was fully processed.
                         }
                     }
                 }
                 if (is_array($inputArray[$table]) && !count($inputArray[$table])) {
                     unset($inputArray[$table]);
                     // Unsetting so in the end we can see if $inputArray was fully processed.
                 }
             }
         }
         //debug($TCEmain_cmd,'$TCEmain_cmd');
         //debug($TCEmain_data,'$TCEmain_data');
         self::$targetLanguageID = $Tlang;
         // Execute CMD array: Localizing records:
         /** @var $tce t3lib_TCEmain */
         $tce = t3lib_div::makeInstance('t3lib_TCEmain');
         if ($this->extensionConfiguration['enable_neverHideAtCopy'] == 1) {
             $tce->neverHideAtCopy = TRUE;
         }
         $tce->stripslashes_values = FALSE;
         if (count($TCEmain_cmd)) {
             $tce->start(array(), $TCEmain_cmd);
             $tce->process_cmdmap();
             if (count($tce->errorLog)) {
                 debug($tce->errorLog, 'TCEmain localization errors:');
             }
         }
         // Before remapping
         if (TYPO3_DLOG) {
             t3lib_div::sysLog(__FILE__ . ': ' . __LINE__ . ': TCEmain_data before remapping: ' . t3lib_div::arrayToLogString($TCEmain_data), 'l10nmgr');
         }
         // Remapping those elements which are new:
         $this->lastTCEMAINCommandsCount = 0;
         foreach ($TCEmain_data as $table => $items) {
             foreach ($TCEmain_data[$table] as $TuidString => $fields) {
                 list($Tuid, $Tlang, $TdefRecord) = explode('/', $TuidString);
                 $this->lastTCEMAINCommandsCount++;
                 if ($Tuid === 'NEW') {
                     if ($tce->copyMappingArray_merged[$table][$TdefRecord]) {
                         $TCEmain_data[$table][t3lib_BEfunc::wsMapId($table, $tce->copyMappingArray_merged[$table][$TdefRecord])] = $fields;
                     } else {
                         t3lib_div::sysLog(__FILE__ . ': ' . __LINE__ . ': Record "' . $table . ':' . $TdefRecord . '" was NOT localized as it should have been!', 'l10nmgr');
                     }
                     unset($TCEmain_data[$table][$TuidString]);
                 }
//.........这里部分代码省略.........
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:101,代码来源:class.tx_l10nmgr_l10nBaseService.php

示例7: translationDetails_flexFormCallBack

 /**
  * FlexForm call back function, see translationDetails
  *
  * @param   array   $dsArr          Data Structure
  * @param   string  $dataValue      Data value
  * @param   array   $PA             Various stuff in an array
  * @param   string  $structurePath  Path to location in flexform
  * @param   object  $pObj           Reference to parent object
  * @return  void
  */
 function translationDetails_flexFormCallBack($dsArr, $dataValue, $PA, $structurePath, &$pObj)
 {
     // Only take lead from default values (since this is "Inheritance" localization we parse for)
     if (substr($structurePath, -5) == '/vDEF') {
         // So, find translated value:
         $baseStructPath = substr($structurePath, 0, -3);
         $structurePath = $baseStructPath . $this->detailsOutput['ISOcode'];
         $translValue = $pObj->getArrayValueByPath($structurePath, $pObj->traverseFlexFormXMLData_Data);
         // Generate preview values:
         $previewLanguageValues = array();
         foreach ($this->previewLanguages as $prevSysUid) {
             $previewLanguageValues[$prevSysUid] = $pObj->getArrayValueByPath($baseStructPath . $this->sysLanguages[$prevSysUid]['ISOcode'], $pObj->traverseFlexFormXMLData_Data);
         }
         $key = $ffKey = $PA['table'] . ':' . t3lib_BEfunc::wsMapId($PA['table'], $PA['uid']) . ':' . $PA['field'] . ':' . $structurePath;
         $ffKeyOrig = $PA['table'] . ':' . $PA['uid'] . ':' . $PA['field'] . ':' . $structurePath;
         // Now, in case this record has just been created in the workspace the diff-information is still found bound to the UID of the original record. So we will look for that until it has been created for the workspace record:
         if (!is_array($this->flexFormDiff[$ffKey]) && is_array($this->flexFormDiff[$ffKeyOrig])) {
             $ffKey = $ffKeyOrig;
             #	debug('orig...');
         }
         // Look for diff-value inside the XML (new way):
         if ($GLOBALS['TYPO3_CONF_VARS']['BE']['flexFormXMLincludeDiffBase']) {
             $diffDefaultValue = $pObj->getArrayValueByPath($structurePath . '.vDEFbase', $pObj->traverseFlexFormXMLData_Data);
         } else {
             // Set diff-value from l10n-cfg record (deprecated)
             if (is_array($this->flexFormDiff[$ffKey]) && trim($this->flexFormDiff[$ffKey]['translated']) === trim($translValue)) {
                 $diffDefaultValue = $this->flexFormDiff[$ffKey]['default'];
             } else {
                 $diffDefaultValue = '';
             }
         }
         // Add field:
         $this->translationDetails_addField($key, $dsArr['TCEforms'], $dataValue, $translValue, $diffDefaultValue, $previewLanguageValues);
     }
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:45,代码来源:class.tx_l10nmgr_tools.php

示例8: wizard_step3

    /**
     * Step 3: Begin template mapping
     *
     * @return	void
     */
    function wizard_step3()
    {
        // Save session data with filename:
        $cfg = t3lib_div::_POST('CFG');
        if (isset($cfg['sitetitle'])) {
            $this->wizardData['sitetitle'] = trim($cfg['sitetitle']);
        }
        if (isset($cfg['siteurl'])) {
            $this->wizardData['siteurl'] = trim($cfg['siteurl']);
        }
        if (isset($cfg['username'])) {
            $this->wizardData['username'] = trim($cfg['username']);
        }
        // If the create-site button WAS clicked:
        if (t3lib_div::_POST('_create_site')) {
            // Show selected template file:
            if ($this->wizardData['file'] && $this->wizardData['sitetitle'] && $this->wizardData['username']) {
                // DO import:
                $import = $this->getImportObj();
                $inFile = t3lib_extMgm::extPath('templavoila') . 'mod2/new_tv_site.xml';
                if (@is_file($inFile) && $import->loadFile($inFile, 1)) {
                    $import->importData($this->importPageUid);
                    // Update various fields (the index values, eg. the "1" in "$import->import_mapId['pages'][1]]..." are the UIDs of the original records from the import file!)
                    $data = array();
                    $data['pages'][t3lib_BEfunc::wsMapId('pages', $import->import_mapId['pages'][1])]['title'] = $this->wizardData['sitetitle'];
                    $data['sys_template'][t3lib_BEfunc::wsMapId('sys_template', $import->import_mapId['sys_template'][1])]['title'] = 'Main template: ' . $this->wizardData['sitetitle'];
                    $data['sys_template'][t3lib_BEfunc::wsMapId('sys_template', $import->import_mapId['sys_template'][1])]['sitetitle'] = $this->wizardData['sitetitle'];
                    $data['tx_templavoila_tmplobj'][t3lib_BEfunc::wsMapId('tx_templavoila_tmplobj', $import->import_mapId['tx_templavoila_tmplobj'][1])]['fileref'] = $this->wizardData['file'];
                    $data['tx_templavoila_tmplobj'][t3lib_BEfunc::wsMapId('tx_templavoila_tmplobj', $import->import_mapId['tx_templavoila_tmplobj'][1])]['templatemapping'] = serialize(array('MappingInfo' => array('ROOT' => array('MAP_EL' => 'body[1]/INNER')), 'MappingInfo_head' => array('headElementPaths' => array('link[1]', 'link[2]', 'link[3]', 'style[1]', 'style[2]', 'style[3]'), 'addBodyTag' => 1)));
                    // Update user settings
                    $newUserID = t3lib_BEfunc::wsMapId('be_users', $import->import_mapId['be_users'][2]);
                    $newGroupID = t3lib_BEfunc::wsMapId('be_groups', $import->import_mapId['be_groups'][1]);
                    $data['be_users'][$newUserID]['username'] = $this->wizardData['username'];
                    $data['be_groups'][$newGroupID]['title'] = $this->wizardData['username'];
                    foreach ($import->import_mapId['pages'] as $newID) {
                        $data['pages'][$newID]['perms_userid'] = $newUserID;
                        $data['pages'][$newID]['perms_groupid'] = $newGroupID;
                    }
                    // Set URL if applicable:
                    if (strlen($this->wizardData['siteurl'])) {
                        $data['sys_domain']['NEW']['pid'] = t3lib_BEfunc::wsMapId('pages', $import->import_mapId['pages'][1]);
                        $data['sys_domain']['NEW']['domainName'] = $this->wizardData['siteurl'];
                    }
                    // Execute changes:
                    $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                    $tce->stripslashes_values = 0;
                    $tce->dontProcessTransformations = 1;
                    $tce->start($data, array());
                    $tce->process_datamap();
                    // Setting environment:
                    $this->wizardData['rootPageId'] = $import->import_mapId['pages'][1];
                    $this->wizardData['templateObjectId'] = t3lib_BEfunc::wsMapId('tx_templavoila_tmplobj', $import->import_mapId['tx_templavoila_tmplobj'][1]);
                    $this->wizardData['typoScriptTemplateID'] = t3lib_BEfunc::wsMapId('sys_template', $import->import_mapId['sys_template'][1]);
                    t3lib_BEfunc::getSetUpdateSignal('updatePageTree');
                    $outputString .= 'New site has been created and adapted. <hr/>';
                }
            } else {
                $outputString .= 'Error happened: Either you did not specify a website name or username in the previous form!';
            }
        }
        // If a template Object id was found, continue with mapping:
        if ($this->wizardData['templateObjectId']) {
            $url = '../cm1/index.php?table=tx_templavoila_tmplobj&uid=' . $this->wizardData['templateObjectId'] . '&SET[selectHeaderContent]=0&_reload_from=1&returnUrl=' . rawurlencode('../mod2/index.php?SET[wiz_step]=4');
            $outputString .= '
				You are now ready to point out at which position in the HTML code to insert the TYPO3 generated page content and the main menu. This process is called "mapping".<br/>
				The process of mapping is shown with this little animation. Please study it closely to understand the flow, then click the button below to start the mapping process on your own. Complete the mapping process by pressing "Save and Return".<br/>
				<br/>
				<img src="mapbody_animation.gif" style="border: 2px black solid;" alt=""><br/>
				<br/>
				<br/><input type="submit" value="Start the mapping process" onclick="' . htmlspecialchars('document.location=\'' . $url . '\'; return false;') . '" />
			';
        }
        // Add output:
        $this->content .= $this->doc->section('Step 3: Begin mapping', $outputString, 0, 1);
    }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:80,代码来源:index.php


注:本文中的t3lib_BEfunc::wsMapId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。