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


PHP t3lib_BEfunc::versioningPlaceholderClause方法代码示例

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


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

示例1: getUnreferencedElementsRecords

 /**
  * Returns an array of UIDs which are not referenced on
  * the page with the given uid (= parent id).
  *
  * @param	array		$allReferencedElementsArr: Array with UIDs of referenced elements
  * @return	array		Array with UIDs of tt_content records
  * @access	protected
  */
 function getUnreferencedElementsRecords($allReferencedElementsArr)
 {
     global $TYPO3_DB, $BE_USER;
     $elementRecordsArr = array();
     $res = $TYPO3_DB->exec_SELECTquery('uid', 'tt_content', 'uid NOT IN (' . implode(',', $allReferencedElementsArr) . ')' . ' AND t3ver_wsid=' . intval($BE_USER->workspace) . t3lib_BEfunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'sorting');
     if ($res) {
         while (($elementRecordArr = $TYPO3_DB->sql_fetch_assoc($res)) !== FALSE) {
             $elementRecordsArr[] = $elementRecordArr['uid'];
         }
     }
     return $elementRecordsArr;
 }
开发者ID:Gregor-Agnes,项目名称:sf_tv2fluidge,代码行数:20,代码来源:UnreferencedElementHelper.php

示例2: getRecursiveUidList

 /**
  * Generates a list of pids of all sub pages for the given depth.
  *
  * @param	integer		the pid of the page
  * @param	integer		the depth for the search
  * @return	string		the list of pids
  * @author	of method	Michael Oehlhof <typo3@oehlhof.de>
  * @access public
  */
 function getRecursiveUidList($parentUid, $depth)
 {
     global $TCA;
     if ($depth != -1) {
         $depth = $depth - 1;
         //decreasing depth
     }
     # Get ressource records:
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid IN (' . $GLOBALS['TYPO3_DB']->cleanIntList($parentUid) . ') ' . t3lib_BEfunc::deleteClause('pages') . t3lib_BEfunc::versioningPlaceholderClause('pages'));
     if ($depth > 0) {
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             $parentUid .= ',' . $this->getRecursiveUidList($row['uid'], $depth);
         }
     }
     return $parentUid;
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:25,代码来源:class.tx_kbeventboard_addCategoriesToFlexForm.php

示例3: exec_listQueryPid

 /**
  * Selects records from table / pid
  *
  * @param	string		Table to select from
  * @param	integer		Page ID to select from
  * @param	integer		Max number of records to select
  * @return	pointer		SQL resource pointer
  */
 function exec_listQueryPid($table, $pid, $limit)
 {
     global $TCA, $LANG;
     $orderBy = $TCA[$table]['ctrl']['sortby'] ? 'ORDER BY ' . $TCA[$table]['ctrl']['sortby'] : $TCA[$table]['ctrl']['default_sortby'];
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $table, 'pid=' . intval($pid) . t3lib_BEfunc::deleteClause($table) . t3lib_BEfunc::versioningPlaceholderClause($table), '', $GLOBALS['TYPO3_DB']->stripOrderBy($orderBy), $limit);
     // Warning about hitting limit:
     if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) == $limit) {
         $this->content .= $this->doc->section($LANG->getLL('execlistqu_maxNumberLimit'), sprintf($LANG->getLL('makeconfig_anSqlQueryReturned', 1), $limit), 0, 1, 2);
     }
     return $res;
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:19,代码来源:index.php

示例4: handleIncomingCommands

 /**
  * Checks various GET / POST parameters for submitted commands and handles them accordingly.
  * All commands will trigger a redirect by sending a location header after they work is done.
  *
  * Currently supported commands: 'createNewRecord', 'unlinkRecord', 'deleteRecord','pasteRecord',
  * 'makeLocalRecord', 'localizeElement', 'createNewPageTranslation' and 'editPageLanguageOverlay'
  *
  * @return	void
  * @access protected
  */
 function handleIncomingCommands()
 {
     $possibleCommands = array('createNewRecord', 'unlinkRecord', 'deleteRecord', 'pasteRecord', 'makeLocalRecord', 'localizeElement', 'createNewPageTranslation', 'editPageLanguageOverlay');
     $hooks = $this->hooks_prepareObjectsArray('handleIncomingCommands');
     foreach ($possibleCommands as $command) {
         if (($commandParameters = t3lib_div::_GP($command)) != '') {
             $redirectLocation = 'index.php?' . $this->link_getParameters();
             $skipCurrentCommand = false;
             foreach ($hooks as $hookObj) {
                 if (method_exists($hookObj, 'handleIncomingCommands_preProcess')) {
                     $skipCurrentCommand = $skipCurrentCommand || $hookObj->handleIncomingCommands_preProcess($command, $redirectLocation, $this);
                 }
             }
             if ($skipCurrentCommand) {
                 continue;
             }
             switch ($command) {
                 case 'createNewRecord':
                     // Historically "defVals" has been used for submitting the preset row data for the new element, so we still support it here:
                     $defVals = t3lib_div::_GP('defVals');
                     $newRow = is_array($defVals['tt_content']) ? $defVals['tt_content'] : array();
                     // Create new record and open it for editing
                     $destinationPointer = $this->apiObj->flexform_getPointerFromString($commandParameters);
                     $newUid = $this->apiObj->insertElement($destinationPointer, $newRow);
                     if ($this->editingOfNewElementIsEnabled($newRow['tx_templavoila_ds'], $newRow['tx_templavoila_to'])) {
                         // TODO If $newUid==0, than we could create new element. Need to handle it...
                         $redirectLocation = $GLOBALS['BACK_PATH'] . 'alt_doc.php?edit[tt_content][' . $newUid . ']=edit&returnUrl=' . rawurlencode(t3lib_extMgm::extRelPath('templavoila') . 'mod1/index.php?' . $this->link_getParameters());
                     }
                     break;
                 case 'unlinkRecord':
                     $unlinkDestinationPointer = $this->apiObj->flexform_getPointerFromString($commandParameters);
                     $this->apiObj->unlinkElement($unlinkDestinationPointer);
                     break;
                 case 'deleteRecord':
                     $deleteDestinationPointer = $this->apiObj->flexform_getPointerFromString($commandParameters);
                     $this->apiObj->deleteElement($deleteDestinationPointer);
                     break;
                 case 'pasteRecord':
                     $sourcePointer = $this->apiObj->flexform_getPointerFromString(t3lib_div::_GP('source'));
                     $destinationPointer = $this->apiObj->flexform_getPointerFromString(t3lib_div::_GP('destination'));
                     switch ($commandParameters) {
                         case 'copy':
                             $this->apiObj->copyElement($sourcePointer, $destinationPointer);
                             break;
                         case 'copyref':
                             $this->apiObj->copyElement($sourcePointer, $destinationPointer, FALSE);
                             break;
                         case 'cut':
                             $this->apiObj->moveElement($sourcePointer, $destinationPointer);
                             break;
                         case 'ref':
                             list(, $uid) = explode(':', t3lib_div::_GP('source'));
                             $this->apiObj->referenceElementByUid($uid, $destinationPointer);
                             break;
                     }
                     break;
                 case 'makeLocalRecord':
                     $sourcePointer = $this->apiObj->flexform_getPointerFromString($commandParameters);
                     $this->apiObj->copyElement($sourcePointer, $sourcePointer);
                     $this->apiObj->unlinkElement($sourcePointer);
                     break;
                 case 'localizeElement':
                     $sourcePointer = $this->apiObj->flexform_getPointerFromString(t3lib_div::_GP('source'));
                     $this->apiObj->localizeElement($sourcePointer, $commandParameters);
                     break;
                 case 'createNewPageTranslation':
                     // Create parameters and finally run the classic page module for creating a new page translation
                     $params = '&edit[pages_language_overlay][' . intval(t3lib_div::_GP('pid')) . ']=new&overrideVals[pages_language_overlay][doktype]=' . intval(t3lib_div::_GP('doktype')) . '&overrideVals[pages_language_overlay][sys_language_uid]=' . intval($commandParameters);
                     $returnUrl = '&returnUrl=' . rawurlencode(t3lib_extMgm::extRelPath('templavoila') . 'mod1/index.php?' . $this->link_getParameters());
                     $redirectLocation = $GLOBALS['BACK_PATH'] . 'alt_doc.php?' . $params . $returnUrl;
                     break;
                 case 'editPageLanguageOverlay':
                     // Look for pages language overlay record for language:
                     $sys_language_uid = intval($commandParameters);
                     $params = '';
                     if ($sys_language_uid != 0) {
                         // Edit overlay record
                         list($pLOrecord) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'pages_language_overlay', 'pid=' . intval($this->id) . ' AND sys_language_uid=' . $sys_language_uid . t3lib_BEfunc::deleteClause('pages_language_overlay') . t3lib_BEfunc::versioningPlaceholderClause('pages_language_overlay'));
                         if ($pLOrecord) {
                             t3lib_beFunc::workspaceOL('pages_language_overlay', $pLOrecord);
                             if (is_array($pLOrecord)) {
                                 $params = '&edit[pages_language_overlay][' . $pLOrecord['uid'] . ']=edit';
                             }
                         }
                     } else {
                         // Edit default language (page properties)
                         // No workspace overlay because we already on this page
                         $params = '&edit[pages][' . intval($this->id) . ']=edit';
                     }
                     if ($params) {
//.........这里部分代码省略.........
开发者ID:rod86,项目名称:t3sandbox,代码行数:101,代码来源:index.php

示例5: renderDSO

    /**
     * Renders the display of Data Structure Objects.
     *
     * @return	void
     */
    function renderDSO()
    {
        global $TYPO3_DB;
        if (intval($this->displayUid) > 0) {
            $row = t3lib_BEfunc::getRecordWSOL('tx_templavoila_datastructure', $this->displayUid);
            if (is_array($row)) {
                // Get title and icon:
                $icon = t3lib_iconworks::getIconImage('tx_templavoila_datastructure', $row, $GLOBALS['BACK_PATH'], ' align="top" title="UID: ' . $this->displayUid . '"');
                $title = t3lib_BEfunc::getRecordTitle('tx_templavoila_datastructure', $row, 1);
                $content .= $this->doc->wrapClickMenuOnIcon($icon, 'tx_templavoila_datastructure', $row['uid'], 1) . '<strong>' . $title . '</strong><br />';
                // Get Data Structure:
                $origDataStruct = $dataStruct = $this->getDataStructFromDSO($row['dataprot']);
                if (is_array($dataStruct)) {
                    // Showing Data Structure:
                    $tRows = $this->drawDataStructureMap($dataStruct);
                    $content .= '

					<!--
						Data Structure content:
					-->
					<div id="c-ds">
						<h4>Data Structure in record:</h4>
						<table border="0" cellspacing="2" cellpadding="2">
									<tr class="bgColor5">
										<td nowrap="nowrap"><strong>Data Element:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_dataElement', $this->doc->backPath, '', TRUE) . '</td>
										<td nowrap="nowrap"><strong>Mapping instructions:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_mapping_instructions', $this->doc->backPath, '', TRUE) . '</td>
										<td nowrap="nowrap"><strong>Rules:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_Rules', $this->doc->backPath, '', TRUE) . '</td>
									</tr>
						' . implode('', $tRows) . '
						</table>
					</div>';
                    // CSH
                    $content .= $this->cshItem('xMOD_tx_templavoila', 'mapping_ds', $this->doc->backPath);
                } else {
                    $content .= '<h4>' . $GLOBALS['LANG']->getLL('error') . ': ' . $GLOBALS['LANG']->getLL('noDSDefined') . '</h4>';
                }
                // Get Template Objects pointing to this Data Structure
                $res = $TYPO3_DB->exec_SELECTquery('*', 'tx_templavoila_tmplobj', 'pid IN (' . $this->storageFolders_pidList . ') AND datastructure=' . intval($row['uid']) . t3lib_BEfunc::deleteClause('tx_templavoila_tmplobj') . t3lib_BEfunc::versioningPlaceholderClause('tx_templavoila_tmplobj'));
                $tRows = array();
                $tRows[] = '
							<tr class="bgColor5">
								<td><strong>Uid:</strong></td>
								<td><strong>Title:</strong></td>
								<td><strong>File reference:</strong></td>
								<td><strong>Mapping Data Lgd:</strong></td>
							</tr>';
                $TOicon = t3lib_iconworks::getIconImage('tx_templavoila_tmplobj', array(), $GLOBALS['BACK_PATH'], ' align="top"');
                // Listing Template Objects with links:
                while (false !== ($TO_Row = $TYPO3_DB->sql_fetch_assoc($res))) {
                    t3lib_BEfunc::workspaceOL('tx_templavoila_tmplobj', $TO_Row);
                    $tRows[] = '
							<tr class="bgColor4">
								<td>[' . $TO_Row['uid'] . ']</td>
								<td nowrap="nowrap">' . $this->doc->wrapClickMenuOnIcon($TOicon, 'tx_templavoila_tmplobj', $TO_Row['uid'], 1) . '<a href="' . htmlspecialchars('index.php?table=tx_templavoila_tmplobj&uid=' . $TO_Row['uid'] . '&_reload_from=1') . '">' . t3lib_BEfunc::getRecordTitle('tx_templavoila_tmplobj', $TO_Row, 1) . '</a>' . '</td>
								<td nowrap="nowrap">' . htmlspecialchars($TO_Row['fileref']) . ' <strong>' . (!t3lib_div::getFileAbsFileName($TO_Row['fileref'], 1) ? '(NOT FOUND!)' : '(OK)') . '</strong></td>
								<td>' . strlen($TO_Row['templatemapping']) . '</td>
							</tr>';
                }
                $content .= '

					<!--
						Template Objects attached to Data Structure Record:
					-->
					<div id="c-to">
						<h4>Template Objects using this Data Structure:</h4>
						<table border="0" cellpadding="2" cellspacing="2">
						' . implode('', $tRows) . '
						</table>
					</div>';
                // CSH
                $content .= $this->cshItem('xMOD_tx_templavoila', 'mapping_ds_to', $this->doc->backPath);
                // Display XML of data structure:
                if (is_array($dataStruct)) {
                    require_once PATH_t3lib . 'class.t3lib_syntaxhl.php';
                    // Make instance of syntax highlight class:
                    $hlObj = t3lib_div::makeInstance('t3lib_syntaxhl');
                    $dataStructureXML = t3lib_div::array2xml_cs($origDataStruct, 'T3DataStructure', array('useCDATA' => 1));
                    $content .= '

					<!--
						Data Structure XML:
					-->
					<br />
					<div id="c-dsxml">
						<h3>Data Structure XML:</h3>
						' . $this->cshItem('xMOD_tx_templavoila', 'mapping_ds_showXML', $this->doc->backPath) . '
						<p>' . t3lib_BEfunc::getFuncCheck('', 'SET[showDSxml]', $this->MOD_SETTINGS['showDSxml'], '', t3lib_div::implodeArrayForUrl('', $_GET, '', 1, 1)) . ' Show XML</p>
						<pre>' . ($this->MOD_SETTINGS['showDSxml'] ? $hlObj->highLight_DS($dataStructureXML) : '') . '
						</pre>
					</div>
					';
                }
            } else {
                $content .= 'ERROR: No Data Structure Record with the UID ' . $this->displayUid;
            }
//.........这里部分代码省略.........
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:101,代码来源:index.php

示例6: makeQuerySearchByTable

 /**
  * Build the MySql where clause by table.
  *
  * @param string $tableName Record table name
  * @param array $fieldsToSearchWithin User right based visible fields where we can search within.
  * @return string
  */
 protected function makeQuerySearchByTable($tableName, array $fieldsToSearchWithin)
 {
     // free text search
     $queryLikeStatement = ' LIKE \'%' . $this->getQueryString($tableName) . '%\'';
     $integerFieldsToSearchWithin = array();
     $queryEqualStatement = '';
     if (is_numeric($this->getQueryString($tableName))) {
         $queryEqualStatement = ' = \'' . $this->getQueryString($tableName) . '\'';
     }
     $uidPos = array_search('uid', $fieldsToSearchWithin);
     if ($uidPos) {
         $integerFieldsToSearchWithin[] = 'uid';
         unset($fieldsToSearchWithin[$uidPos]);
     }
     $pidPos = array_search('pid', $fieldsToSearchWithin);
     if ($pidPos) {
         $integerFieldsToSearchWithin[] = 'pid';
         unset($fieldsToSearchWithin[$pidPos]);
     }
     $queryPart = ' AND (';
     if (count($integerFieldsToSearchWithin) && $queryEqualStatement !== '') {
         $queryPart .= implode($queryEqualStatement . ' OR ', $integerFieldsToSearchWithin) . $queryEqualStatement . ' OR ';
     }
     $queryPart .= implode($queryLikeStatement . ' OR ', $fieldsToSearchWithin) . $queryLikeStatement . ')';
     $queryPart .= t3lib_BEfunc::deleteClause($tableName);
     $queryPart .= t3lib_BEfunc::versioningPlaceholderClause($tableName);
     return $queryPart;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:35,代码来源:class.t3lib_search_livesearch.php

示例7: getShortcutIcon

 /**
  * gets the icon for the shortcut
  *
  * @param	string		backend module name
  * @return	string		shortcut icon as img tag
  */
 protected function getShortcutIcon($row, $shortcut)
 {
     global $TCA;
     switch ($row['module_name']) {
         case 'xMOD_alt_doc.php':
             $table = $shortcut['table'];
             $recordid = $shortcut['recordid'];
             if ($shortcut['type'] == 'edit') {
                 // Creating the list of fields to include in the SQL query:
                 $selectFields = $this->fieldArray;
                 $selectFields[] = 'uid';
                 $selectFields[] = 'pid';
                 if ($table == 'pages') {
                     if (t3lib_extMgm::isLoaded('cms')) {
                         $selectFields[] = 'module';
                         $selectFields[] = 'extendToSubpages';
                     }
                     $selectFields[] = 'doktype';
                 }
                 if (is_array($TCA[$table]['ctrl']['enablecolumns'])) {
                     $selectFields = array_merge($selectFields, $TCA[$table]['ctrl']['enablecolumns']);
                 }
                 if ($TCA[$table]['ctrl']['type']) {
                     $selectFields[] = $TCA[$table]['ctrl']['type'];
                 }
                 if ($TCA[$table]['ctrl']['typeicon_column']) {
                     $selectFields[] = $TCA[$table]['ctrl']['typeicon_column'];
                 }
                 if ($TCA[$table]['ctrl']['versioningWS']) {
                     $selectFields[] = 't3ver_state';
                 }
                 $selectFields = array_unique($selectFields);
                 // Unique list!
                 $permissionClause = $table == 'pages' && $this->perms_clause ? ' AND ' . $this->perms_clause : '';
                 $sqlQueryParts = array('SELECT' => implode(',', $selectFields), 'FROM' => $table, 'WHERE' => 'uid IN (' . $recordid . ') ' . $permissionClause . t3lib_BEfunc::deleteClause($table) . t3lib_BEfunc::versioningPlaceholderClause($table));
                 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($sqlQueryParts);
                 $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
                 $icon = t3lib_iconWorks::getIcon($table, $row, $this->backPath);
             } elseif ($shortcut['type'] == 'new') {
                 $icon = t3lib_iconWorks::getIcon($table, '', $this->backPath);
             }
             $icon = t3lib_iconWorks::skinImg($this->backPath, $icon, '', 1);
             break;
         case 'xMOD_file_edit.php':
             $icon = 'gfx/edit_file.gif';
             break;
         case 'xMOD_wizard_rte.php':
             $icon = 'gfx/edit_rtewiz.gif';
             break;
         default:
             if ($GLOBALS['LANG']->moduleLabels['tabs_images'][$row['module_name'] . '_tab']) {
                 $icon = $GLOBALS['LANG']->moduleLabels['tabs_images'][$row['module_name'] . '_tab'];
                 // change icon of fileadmin references - otherwise it doesn't differ with Web->List
                 $icon = str_replace('mod/file/list/list.gif', 'mod/file/file.gif', $icon);
                 if (t3lib_div::isAbsPath($icon)) {
                     $icon = '../' . substr($icon, strlen(PATH_site));
                 }
             } else {
                 $icon = 'gfx/dummy_module.gif';
             }
     }
     return '<img src="' . $icon . '" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcut', true) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcut', true) . '" />';
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:69,代码来源:class.shortcutmenu.php

示例8: editRegularContentFromId

 /**
  * Function, which populates the internal editconf array with editing commands for all tt_content elements from the normal column in normal language from the page pointed to by $this->editRegularContentFromId
  *
  * @return	void
  */
 function editRegularContentFromId()
 {
     if (t3lib_extMgm::isLoaded('cms')) {
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'tt_content', 'pid=' . intval($this->editRegularContentFromId) . t3lib_BEfunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content') . ' AND colPos=0 AND sys_language_uid=0', '', 'sorting');
         if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
             $ecUids = array();
             while ($ecRec = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                 $ecUids[] = $ecRec['uid'];
             }
             $this->editconf['tt_content'][implode(',', $ecUids)] = 'edit';
         }
     }
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:18,代码来源:alt_doc.php

示例9: getSingleRecordToTranslate

 /**
  * Selecting single record from a table filtering whether it is a default language / international element.
  *
  * @param   string   $table Table name
  * @param   integer  $uid   Record uid
  * @return  array    Record array if found, otherwise FALSE
  */
 function getSingleRecordToTranslate($table, $uid)
 {
     global $TCA;
     if ($this->t8Tools->isTranslationInOwnTable($table)) {
         // First, select all records that are default language OR international:
         $allRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', $table, 'uid=' . intval($uid) . ' AND ' . $TCA[$table]['ctrl']['languageField'] . '<=0' . t3lib_BEfunc::deleteClause($table) . t3lib_BEfunc::versioningPlaceholderClause($table));
         return is_array($allRows) && count($allRows) ? $allRows[0] : FALSE;
     }
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:16,代码来源:class.tx_l10nmgr_tools.php

示例10: expandPage

 /**
  * For RTE: This displays all content elements on a page and lets you create a link to the element.
  *
  * @return	string		HTML output. Returns content only if the ->expandPage value is set (pointing to a page uid to show tt_content records from ...)
  */
 function expandPage()
 {
     $out = '';
     $expPageId = $this->browseLinks->expandPage;
     // Set page id (if any) to expand
     // If there is an anchor value (content element reference) in the element reference, then force an ID to expand:
     if (!$this->browseLinks->expandPage && $this->browseLinks->curUrlInfo['cElement']) {
         $expPageId = $this->browseLinks->curUrlInfo['pageid'];
         // Set to the current link page id.
     }
     // Draw the record list IF there is a page id to expand:
     if ($expPageId && t3lib_utility_Math::canBeInterpretedAsInteger($expPageId) && $GLOBALS['BE_USER']->isInWebMount($expPageId)) {
         // Set header:
         $out .= $this->browseLinks->barheader($GLOBALS['LANG']->getLL('contentElements') . ':');
         // Create header for listing, showing the page title/icon:
         $titleLen = intval($GLOBALS['BE_USER']->uc['titleLen']);
         $mainPageRec = t3lib_BEfunc::getRecordWSOL('pages', $expPageId);
         $picon = t3lib_iconWorks::getSpriteIconForRecord('pages', $mainPageRec);
         $picon .= t3lib_BEfunc::getRecordTitle('pages', $mainPageRec, TRUE);
         $out .= $picon . '<br />';
         // Look up tt_content elements from the expanded page:
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,header,hidden,starttime,endtime,fe_group,CType,colPos,bodytext,tx_jfmulticontent_view,tx_jfmulticontent_pages,tx_jfmulticontent_contents', 'tt_content', 'pid=' . intval($expPageId) . t3lib_BEfunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'colPos,sorting');
         $cc = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
         // Traverse list of records:
         $c = 0;
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             $c++;
             $icon = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $row);
             if ($this->browseLinks->curUrlInfo['act'] == 'page' && $this->browseLinks->curUrlInfo['cElement'] == $row['uid']) {
                 $arrCol = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/blinkarrow_left.gif', 'width="5" height="9"') . ' class="c-blinkArrowL" alt="" />';
             } else {
                 $arrCol = '';
             }
             // Putting list element HTML together:
             $out .= '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/join' . ($c == $cc ? 'bottom' : '') . '.gif', 'width="18" height="16"') . ' alt="" />' . $arrCol . '<a href="#" onclick="return link_typo3Page(\'' . $expPageId . '\',\'#' . $row['uid'] . '\');">' . $icon . t3lib_BEfunc::getRecordTitle('tt_content', $row, TRUE) . '</a><br />';
             $contents = array();
             // get all contents
             switch ($row['tx_jfmulticontent_view']) {
                 case "page":
                     $contents = t3lib_div::trimExplode(",", $row['tx_jfmulticontent_pages']);
                     break;
                 case "content":
                     $contents = t3lib_div::trimExplode(",", $row['tx_jfmulticontent_contents']);
                     break;
                 case "irre":
                     $resIrre = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'tx_jfmulticontent_irre_parentid=' . intval($row['uid']) . ' AND deleted = 0 AND hidden = 0', '', '');
                     while ($rowIrre = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resIrre)) {
                         $contents[] = $rowIrre['uid'];
                     }
                     break;
             }
             if (count($contents) > 0) {
                 $out .= '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/line.gif', 'width="18" height="16"') . ' alt="" />' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/blank.gif', 'width="18" height="16"') . ' alt="" />';
                 foreach ($contents as $key => $content) {
                     $out .= '<a href="#" onclick="return link_typo3Page(\'' . $expPageId . '\',\'#jfmulticontent_c' . $row['uid'] . '-' . ($key + 1) . '\');">' . '&nbsp;' . ($key + 1) . '&nbsp;' . '</a>';
                 }
                 $out .= '<br/>';
             }
         }
     }
     return $out;
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:67,代码来源:class.tx_jfmulticontent_browselinkshooks.php

示例11: getSingleField_typeFlex

 /**
  * Handler for Flex Forms
  *
  * @param	string		The table name of the record
  * @param	string		The field name which this element is supposed to edit
  * @param	array		The record data array where the value(s) for the field can be found
  * @param	array		An array with additional configuration options.
  * @return	string		The HTML code for the TCEform field
  */
 function getSingleField_typeFlex($table, $field, $row, &$PA)
 {
     // Data Structure:
     $dataStructArray = t3lib_BEfunc::getFlexFormDS($PA['fieldConf']['config'], $row, $table);
     // Manipulate Flexform DS via TSConfig and group access lists
     if (is_array($dataStructArray)) {
         $flexFormHelper = t3lib_div::makeInstance('t3lib_TCEforms_Flexforms');
         $dataStructArray = $flexFormHelper->modifyFlexFormDS($dataStructArray, $table, $field, $row, $PA['fieldConf']['config']);
         unset($flexFormHelper);
     }
     // Get data structure:
     if (is_array($dataStructArray)) {
         // Get data:
         $xmlData = $PA['itemFormElValue'];
         $xmlHeaderAttributes = t3lib_div::xmlGetHeaderAttribs($xmlData);
         $storeInCharset = strtolower($xmlHeaderAttributes['encoding']);
         if ($storeInCharset) {
             $currentCharset = $GLOBALS['LANG']->charSet;
             $xmlData = $GLOBALS['LANG']->csConvObj->conv($xmlData, $storeInCharset, $currentCharset, 1);
         }
         $editData = t3lib_div::xml2array($xmlData);
         if (!is_array($editData)) {
             // Must be XML parsing error...
             $editData = array();
         } elseif (!isset($editData['meta']) || !is_array($editData['meta'])) {
             $editData['meta'] = array();
         }
         // Find the data structure if sheets are found:
         $sheet = $editData['meta']['currentSheetId'] ? $editData['meta']['currentSheetId'] : 'sDEF';
         // Sheet to display
         // Create sheet menu:
         //TODO; Why is this commented out?
         //			if (is_array($dataStructArray['sheets']))	{
         //				#$item.=$this->getSingleField_typeFlex_sheetMenu($dataStructArray['sheets'], $PA['itemFormElName'].'[meta][currentSheetId]', $sheet).'<br />';
         //			}
         // Create language menu:
         $langChildren = $dataStructArray['meta']['langChildren'] ? 1 : 0;
         $langDisabled = $dataStructArray['meta']['langDisable'] ? 1 : 0;
         $editData['meta']['currentLangId'] = array();
         // Look up page overlays:
         $checkPageLanguageOverlay = $GLOBALS['BE_USER']->getTSConfigVal('options.checkPageLanguageOverlay') ? TRUE : FALSE;
         if ($checkPageLanguageOverlay) {
             $pageOverlays = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'pages_language_overlay', 'pid=' . intval($row['pid']) . t3lib_BEfunc::deleteClause('pages_language_overlay') . t3lib_BEfunc::versioningPlaceholderClause('pages_language_overlay'), '', '', '', 'sys_language_uid');
         }
         $languages = $this->getAvailableLanguages();
         foreach ($languages as $lInfo) {
             if ($GLOBALS['BE_USER']->checkLanguageAccess($lInfo['uid']) && (!$checkPageLanguageOverlay || $lInfo['uid'] <= 0 || is_array($pageOverlays[$lInfo['uid']]))) {
                 $editData['meta']['currentLangId'][] = $lInfo['ISOcode'];
             }
         }
         if (!is_array($editData['meta']['currentLangId']) || !count($editData['meta']['currentLangId'])) {
             $editData['meta']['currentLangId'] = array('DEF');
         }
         $editData['meta']['currentLangId'] = array_unique($editData['meta']['currentLangId']);
         //TODO: Why is this commented out?
         //			if (!$langDisabled && count($languages) > 1)	{
         //				$item.=$this->getSingleField_typeFlex_langMenu($languages, $PA['itemFormElName'].'[meta][currentLangId]', $editData['meta']['currentLangId']).'<br />';
         //			}
         $PA['_noEditDEF'] = FALSE;
         if ($langChildren || $langDisabled) {
             $rotateLang = array('DEF');
         } else {
             if (!in_array('DEF', $editData['meta']['currentLangId'])) {
                 array_unshift($editData['meta']['currentLangId'], 'DEF');
                 $PA['_noEditDEF'] = TRUE;
             }
             $rotateLang = $editData['meta']['currentLangId'];
         }
         // Tabs sheets
         if (is_array($dataStructArray['sheets'])) {
             $tabsToTraverse = array_keys($dataStructArray['sheets']);
         } else {
             $tabsToTraverse = array($sheet);
         }
         foreach ($rotateLang as $lKey) {
             if (!$langChildren && !$langDisabled) {
                 $item .= '<strong>' . $this->getLanguageIcon($table, $row, 'v' . $lKey) . $lKey . ':</strong>';
             }
             $tabParts = array();
             foreach ($tabsToTraverse as $sheet) {
                 list($dataStruct, $sheet) = t3lib_div::resolveSheetDefInDS($dataStructArray, $sheet);
                 // Render sheet:
                 if (is_array($dataStruct['ROOT']) && is_array($dataStruct['ROOT']['el'])) {
                     $lang = 'l' . $lKey;
                     // Default language, other options are "lUK" or whatever country code (independant of system!!!)
                     $PA['_valLang'] = $langChildren && !$langDisabled ? $editData['meta']['currentLangId'] : 'DEF';
                     // Default language, other options are "lUK" or whatever country code (independant of system!!!)
                     $PA['_lang'] = $lang;
                     // Assemble key for loading the correct CSH file
                     $dsPointerFields = t3lib_div::trimExplode(',', $GLOBALS['TCA'][$table]['columns'][$field]['config']['ds_pointerField'], TRUE);
                     $PA['_cshKey'] = $table . '.' . $field;
//.........这里部分代码省略.........
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:101,代码来源:class.t3lib_tceforms.php

示例12: wizardArray

 /**
  * Returns the array of elements in the wizard display.
  * For the plugin section there is support for adding elements there from a global variable.
  *
  * @return	array
  */
 function wizardArray()
 {
     global $LANG, $TBE_MODULES_EXT, $TYPO3_DB;
     $defVals = t3lib_div::implodeArrayForUrl('defVals', is_array($this->defVals) ? $this->defVals : array());
     $wizardItems = array('common' => array('header' => $LANG->getLL('common')), 'common_1' => array('icon' => 'gfx/c_wiz/regular_text.gif', 'title' => $LANG->getLL('common_1_title'), 'description' => $LANG->getLL('common_1_description'), 'params' => '&defVals[tt_content][CType]=text' . $defVals), 'common_2' => array('icon' => 'gfx/c_wiz/text_image_below.gif', 'title' => $LANG->getLL('common_2_title'), 'description' => $LANG->getLL('common_2_description'), 'params' => '&defVals[tt_content][CType]=textpic&defVals[tt_content][imageorient]=8' . $defVals), 'common_3' => array('icon' => 'gfx/c_wiz/text_image_right.gif', 'title' => $LANG->getLL('common_3_title'), 'description' => $LANG->getLL('common_3_description'), 'params' => '&defVals[tt_content][CType]=textpic&defVals[tt_content][imageorient]=17' . $defVals), 'common_4' => array('icon' => 'gfx/c_wiz/images_only.gif', 'title' => $LANG->getLL('common_4_title'), 'description' => $LANG->getLL('common_4_description'), 'params' => '&defVals[tt_content][CType]=image&defVals[tt_content][imagecols]=2' . $defVals), 'common_5' => array('icon' => 'gfx/c_wiz/bullet_list.gif', 'title' => $LANG->getLL('common_5_title'), 'description' => $LANG->getLL('common_5_description'), 'params' => '&defVals[tt_content][CType]=bullets' . $defVals), 'common_6' => array('icon' => 'gfx/c_wiz/table.gif', 'title' => $LANG->getLL('common_6_title'), 'description' => $LANG->getLL('common_6_description'), 'params' => '&defVals[tt_content][CType]=table' . $defVals), 'special' => array('header' => $LANG->getLL('special')), 'special_1' => array('icon' => 'gfx/c_wiz/filelinks.gif', 'title' => $LANG->getLL('special_1_title'), 'description' => $LANG->getLL('special_1_description'), 'params' => '&defVals[tt_content][CType]=uploads' . $defVals), 'special_2' => array('icon' => 'gfx/c_wiz/multimedia.gif', 'title' => $LANG->getLL('special_2_title'), 'description' => $LANG->getLL('special_2_description'), 'params' => '&defVals[tt_content][CType]=multimedia' . $defVals), 'special_3' => array('icon' => 'gfx/c_wiz/sitemap2.gif', 'title' => $LANG->getLL('special_3_title'), 'description' => $LANG->getLL('special_3_description'), 'params' => '&defVals[tt_content][CType]=menu&defVals[tt_content][menu_type]=2' . $defVals), 'special_4' => array('icon' => 'gfx/c_wiz/html.gif', 'title' => $LANG->getLL('special_4_title'), 'description' => $LANG->getLL('special_4_description'), 'params' => '&defVals[tt_content][CType]=html' . $defVals), 'forms' => array('header' => $LANG->getLL('forms')), 'forms_1' => array('icon' => 'gfx/c_wiz/mailform.gif', 'title' => $LANG->getLL('forms_1_title'), 'description' => $LANG->getLL('forms_1_description'), 'params' => '&defVals[tt_content][CType]=mailform&defVals[tt_content][bodytext]=' . rawurlencode(trim($LANG->getLL('forms_1_example'))) . $defVals), 'forms_2' => array('icon' => 'gfx/c_wiz/searchform.gif', 'title' => $LANG->getLL('forms_2_title'), 'description' => $LANG->getLL('forms_2_description'), 'params' => '&defVals[tt_content][CType]=search' . $defVals), 'forms_3' => array('icon' => 'gfx/c_wiz/login_form.gif', 'title' => $LANG->getLL('forms_3_title'), 'description' => $LANG->getLL('forms_3_description'), 'params' => '&defVals[tt_content][CType]=login' . $defVals));
     // Flexible content elements:
     $positionPid = $this->id;
     $dataStructureRecords = array();
     $storageFolderPID = $this->apiObj->getStorageFolderPid($positionPid);
     // Fetch data structures stored in the database:
     $addWhere = $this->buildRecordWhere('tx_templavoila_datastructure');
     $res = $TYPO3_DB->exec_SELECTquery('*', 'tx_templavoila_datastructure', 'pid=' . intval($storageFolderPID) . ' AND scope=2' . $addWhere . t3lib_BEfunc::deleteClause('tx_templavoila_datastructure') . t3lib_BEfunc::versioningPlaceholderClause('tx_templavoila_datastructure'));
     while (FALSE !== ($row = $TYPO3_DB->sql_fetch_assoc($res))) {
         $dataStructureRecords[$row['uid']] = $row;
     }
     /*
             	// Fetch static data structures which are stored in XML files:
     		if (is_array($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures']))	{
     			foreach($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'] as $staticDataStructureArr)	{
     				$staticDataStructureArr['_STATIC'] = TRUE;
     				$dataStructureRecords[$staticDataStructureArr['path']] = $staticDataStructureArr;
     			}
     		}
     */
     // Fetch all template object records which uare based one of the previously fetched data structures:
     $templateObjectRecords = array();
     $addWhere = $this->buildRecordWhere('tx_templavoila_tmplobj');
     $res = $TYPO3_DB->exec_SELECTquery('*', 'tx_templavoila_tmplobj', 'pid=' . intval($storageFolderPID) . ' AND parent=0' . $addWhere . t3lib_BEfunc::deleteClause('tx_templavoila_tmplobj') . t3lib_BEfunc::versioningPlaceholderClause('tx_templavoila_tmpl'), '', 'sorting');
     while (FALSE !== ($row = $TYPO3_DB->sql_fetch_assoc($res))) {
         if (is_array($dataStructureRecords[$row['datastructure']])) {
             $templateObjectRecords[] = $row;
         }
     }
     // Add the filtered set of TO entries to the wizard list:
     $wizardItems['fce']['header'] = $LANG->getLL('fce');
     foreach ($templateObjectRecords as $index => $templateObjectRecord) {
         $tmpFilename = 'uploads/tx_templavoila/' . $templateObjectRecord['previewicon'];
         $wizardItems['fce_' . $index]['icon'] = @is_file(PATH_site . $tmpFilename) ? '../' . $tmpFilename : '../' . t3lib_extMgm::siteRelPath('templavoila') . 'res1/default_previewicon.gif';
         $wizardItems['fce_' . $index]['description'] = $templateObjectRecord['description'] ? htmlspecialchars($templateObjectRecord['description']) : $LANG->getLL('template_nodescriptionavailable');
         $wizardItems['fce_' . $index]['title'] = $templateObjectRecord['title'];
         $wizardItems['fce_' . $index]['params'] = '&defVals[tt_content][CType]=templavoila_pi1&defVals[tt_content][tx_templavoila_ds]=' . $templateObjectRecord['datastructure'] . '&defVals[tt_content][tx_templavoila_to]=' . $templateObjectRecord['uid'] . $defVals;
         $index++;
     }
     // PLUG-INS:
     if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) {
         $wizardItems['plugins'] = array('header' => $LANG->getLL('plugins'));
         reset($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']);
         while (list($class, $path) = each($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) {
             $modObj = t3lib_div::makeInstance($class);
             $wizardItems = $modObj->proc($wizardItems);
         }
     }
     // Remove elements where preset values are not allowed:
     $this->removeInvalidElements($wizardItems);
     return $wizardItems;
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:62,代码来源:db_new_content_el.php

示例13: getConfigurationsForBranch

 function getConfigurationsForBranch($rootid, $depth)
 {
     $configurationsForBranch = array();
     $pageTSconfig = $this->getPageTSconfigForId($rootid);
     if (is_array($pageTSconfig) && is_array($pageTSconfig['tx_crawler.']['crawlerCfg.']) && is_array($pageTSconfig['tx_crawler.']['crawlerCfg.']['paramSets.'])) {
         $sets = $pageTSconfig['tx_crawler.']['crawlerCfg.']['paramSets.'];
         if (is_array($sets)) {
             foreach ($sets as $key => $value) {
                 if (!is_array($value)) {
                     continue;
                 }
                 $configurationsForBranch[] = substr($key, -1) == '.' ? substr($key, 0, -1) : $key;
             }
         }
     }
     $pids = array();
     $rootLine = t3lib_BEfunc::BEgetRootLine($rootid);
     foreach ($rootLine as $node) {
         $pids[] = $node['uid'];
     }
     /* @var t3lib_pageTree */
     $tree = t3lib_div::makeInstance('t3lib_pageTree');
     $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
     $tree->init('AND ' . $perms_clause);
     $tree->getTree($rootid, $depth, '');
     foreach ($tree->tree as $node) {
         $pids[] = $node['row']['uid'];
     }
     $res = $this->db->exec_SELECTquery('*', 'tx_crawler_configuration', 'pid IN (' . implode(',', $pids) . ') ' . t3lib_BEfunc::BEenableFields('tx_crawler_configuration') . t3lib_BEfunc::deleteClause('tx_crawler_configuration') . ' ' . t3lib_BEfunc::versioningPlaceholderClause('tx_crawler_configuration') . ' ');
     while ($row = $this->db->sql_fetch_assoc($res)) {
         $configurationsForBranch[] = $row['name'];
     }
     $this->db->sql_free_result($res);
     return $configurationsForBranch;
 }
开发者ID:b13,项目名称:crawler,代码行数:35,代码来源:class.tx_crawler_lib.php

示例14: makeQueryArray

 /**
  * [Describe function...]
  *
  * @param	[type]		$table: ...
  * @param	[type]		$id: ...
  * @param	[type]		$addWhere: ...
  * @param	[type]		$fieldList: ...
  * @return	[type]		...
  */
 function makeQueryArray($table, $id, $addWhere = "", $fieldList = '')
 {
     global $TCA;
     if (!$fieldList) {
         $fieldList = $table . '.*';
     }
     // Set ORDER BY:
     $orderBy = $TCA[$table]['ctrl']['sortby'] ? 'ORDER BY ' . $TCA[$table]['ctrl']['sortby'] : $TCA[$table]['ctrl']['default_sortby'];
     if ($this->sortField) {
         if (in_array($this->sortField, $this->makeFieldList($table, 1))) {
             $orderBy = 'ORDER BY ' . $this->sortField;
             if ($this->sortRev) {
                 $orderBy .= ' DESC';
             }
         }
     }
     // Set LIMIT:
     $limit = $this->iLimit ? ($this->firstElementNumber ? $this->firstElementNumber . ',' : '') . $this->iLimit : '';
     // fix for 6.2
     $TCA[$table]['ctrl']['searchFields'] = $this->searchFields;
     // Adding search constraints:
     $search = $this->makeSearchString($table);
     if ($this->selectedCategories) {
         $mmTable = 'tt_news_cat_mm';
         $fieldList = 'DISTINCT ' . $table . '.uid, ' . $fieldList;
         $leftjoin = ' LEFT JOIN ' . $mmTable . ' AS mm1 ON ' . $table . '.uid=mm1.uid_local';
     }
     $catWhere = '';
     if ($this->selectedCategories) {
         $catWhere .= ' AND mm1.uid_foreign IN (' . $this->selectedCategories . ')';
     } elseif ($this->lTSprop['noListWithoutCatSelection'] && !$this->isAdmin) {
         $addWhere .= ' AND 1=0';
     }
     if ($this->searchLevels == -1) {
         $this->pidSelect = '';
     }
     $ps = $this->pidSelect ? $this->pidSelect . ' AND ' : '';
     if ($this->isAdmin) {
         $this->pidSelect = $ps . '1=1';
     } else {
         if ($this->showOnlyEditable) {
             $this->pidSelect = $ps . $table . '.pid IN (' . $this->editablePagesList . ')';
         } else {
             $this->pidSelect = $ps . $table . '.pid IN (' . $this->pidList . ')';
         }
     }
     $addWhere .= ' AND ' . $table . '.sys_language_uid=' . $this->current_sys_language;
     // Compiling query array:
     $queryParts = array('SELECT' => $fieldList, 'FROM' => $table . $leftjoin, 'WHERE' => $this->pidSelect . ' AND ' . $table . '.pid > 0' . t3lib_BEfunc::deleteClause($table) . t3lib_BEfunc::versioningPlaceholderClause($table) . ' ' . $addWhere . ' ' . $search . $catWhere, 'GROUPBY' => '', 'ORDERBY' => $GLOBALS['TYPO3_DB']->stripOrderBy($orderBy), 'LIMIT' => $limit);
     if (!$this->isAdmin && ($this->selectedCategories || !$this->lTSprop['noListWithoutCatSelection']) && $this->showOnlyEditable) {
         $queryParts = $this->ckeckDisallowedCategories($queryParts);
     }
     // Return query:
     return $queryParts;
 }
开发者ID:ghanshyamgohel,项目名称:tt_news,代码行数:64,代码来源:class.tx_ttnews_recordlist.php

示例15: translationInfo

 /**
  * Information about translation for an element
  * Will overlay workspace version of record too!
  *
  * @param	string		Table name
  * @param	integer		Record uid
  * @param	integer		Language uid. If zero, then all languages are selected.
  * @param	array		The record to be translated
  * @param	array		select fields for the query which fetches the translations of the current record
  * @return	array		Array with information. Errors will return string with message.
  */
 function translationInfo($table, $uid, $sys_language_uid = 0, $row = NULL, $selFieldList = '')
 {
     global $TCA;
     if ($TCA[$table] && $uid) {
         t3lib_div::loadTCA($table);
         if ($row === NULL) {
             $row = t3lib_BEfunc::getRecordWSOL($table, $uid);
         }
         if (is_array($row)) {
             $trTable = $this->getTranslationTable($table);
             if ($trTable) {
                 if ($trTable !== $table || $row[$TCA[$table]['ctrl']['languageField']] <= 0) {
                     if ($trTable !== $table || $row[$TCA[$table]['ctrl']['transOrigPointerField']] == 0) {
                         // Look for translations of this record, index by language field value:
                         $translationsTemp = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($selFieldList ? $selFieldList : 'uid,' . $TCA[$trTable]['ctrl']['languageField'], $trTable, $TCA[$trTable]['ctrl']['transOrigPointerField'] . '=' . intval($uid) . ' AND pid=' . intval($table === 'pages' ? $row['uid'] : $row['pid']) . ' AND ' . $TCA[$trTable]['ctrl']['languageField'] . (!$sys_language_uid ? '>0' : '=' . intval($sys_language_uid)) . t3lib_BEfunc::deleteClause($trTable) . t3lib_BEfunc::versioningPlaceholderClause($trTable));
                         $translations = array();
                         $translations_errors = array();
                         foreach ($translationsTemp as $r) {
                             if (!isset($translations[$r[$TCA[$trTable]['ctrl']['languageField']]])) {
                                 $translations[$r[$TCA[$trTable]['ctrl']['languageField']]] = $r;
                             } else {
                                 $translations_errors[$r[$TCA[$trTable]['ctrl']['languageField']]][] = $r;
                             }
                         }
                         return array('table' => $table, 'uid' => $uid, 'CType' => $row['CType'], 'sys_language_uid' => $row[$TCA[$table]['ctrl']['languageField']], 'translation_table' => $trTable, 'translations' => $translations, 'excessive_translations' => $translations_errors);
                     } else {
                         return 'Record "' . $table . '_' . $uid . '" seems to be a translation already (has a relation to record "' . $row[$TCA[$table]['ctrl']['transOrigPointerField']] . '")';
                     }
                 } else {
                     return 'Record "' . $table . '_' . $uid . '" seems to be a translation already (has a language value "' . $row[$TCA[$table]['ctrl']['languageField']] . '", relation to record "' . $row[$TCA[$table]['ctrl']['transOrigPointerField']] . '")';
                 }
             } else {
                 return 'Translation is not supported for this table!';
             }
         } else {
             return 'Record "' . $table . '_' . $uid . '" was not found';
         }
     } else {
         return 'No table "' . $table . '" or no UID value';
     }
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:52,代码来源:class.t3lib_transl8tools.php


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