コード例 #1
0
 /**
  * Returns information about localization of traditional content elements (non FCEs).
  * It will be added to the content tree by getContentTree().
  *
  * @param	array		$contentTreeArr: Part of the content tree of the element to create the localization information for.
  * @param	array		$tt_content_elementRegister: Array of sys_language UIDs with some information as the value
  * @return	array		Localization information
  * @access	protected
  * @see	getContentTree_element()
  */
 function getContentTree_getLocalizationInfoForElement($contentTreeArr, &$tt_content_elementRegister)
 {
     global $TYPO3_DB;
     $localizationInfoArr = array();
     if ($contentTreeArr['el']['table'] == 'tt_content' && $contentTreeArr['el']['sys_language_uid'] <= 0) {
         // Finding translations of this record and select overlay record:
         $fakeElementRow = array('uid' => $contentTreeArr['el']['uid'], 'pid' => $contentTreeArr['el']['pid']);
         t3lib_beFunc::fixVersioningPID('tt_content', $fakeElementRow);
         $res = $TYPO3_DB->exec_SELECTquery('*', 'tt_content', 'pid=' . $fakeElementRow['pid'] . ' AND sys_language_uid>0' . ' AND l18n_parent=' . intval($contentTreeArr['el']['uid']) . t3lib_BEfunc::deleteClause('tt_content'));
         $attachedLocalizations = array();
         while (TRUE == ($olrow = $TYPO3_DB->sql_fetch_assoc($res))) {
             t3lib_BEfunc::workspaceOL('tt_content', $olrow);
             if (!isset($attachedLocalizations[$olrow['sys_language_uid']])) {
                 $attachedLocalizations[$olrow['sys_language_uid']] = $olrow['uid'];
             }
         }
         $TYPO3_DB->sql_free_result($res);
         // Traverse the available languages of the page (not default and [All])
         if (is_array($this->allSystemWebsiteLanguages) && is_array($this->allSystemWebsiteLanguages['rows'])) {
             foreach (array_keys($this->allSystemWebsiteLanguages['rows']) as $sys_language_uid) {
                 if ($sys_language_uid > 0) {
                     if (isset($attachedLocalizations[$sys_language_uid])) {
                         $localizationInfoArr[$sys_language_uid] = array();
                         $localizationInfoArr[$sys_language_uid]['mode'] = 'exists';
                         $localizationInfoArr[$sys_language_uid]['localization_uid'] = $attachedLocalizations[$sys_language_uid];
                         $tt_content_elementRegister[$attachedLocalizations[$sys_language_uid]]++;
                     } elseif ($contentTreeArr['el']['CType'] != 'templavoila_pi1') {
                         // Only localize content elements with "Default" langauge set
                         if ((int) $contentTreeArr['el']['sys_language_uid'] === 0) {
                             $localizationInfoArr[$sys_language_uid] = array();
                             $localizationInfoArr[$sys_language_uid]['mode'] = 'localize';
                         }
                     } elseif (!$contentTreeArr['ds_meta']['langDisable'] && ((int) $contentTreeArr['el']['sys_language_uid'] === -1 || (int) $contentTreeArr['el']['sys_language_uid'] === 0)) {
                         $localizationInfoArr[$sys_language_uid] = array();
                         $localizationInfoArr[$sys_language_uid]['mode'] = 'localizedFlexform';
                     } else {
                         $localizationInfoArr[$sys_language_uid] = array();
                         $localizationInfoArr[$sys_language_uid]['mode'] = 'no_localization';
                     }
                 }
             }
         }
     }
     return $localizationInfoArr;
 }
コード例 #2
0
    /**
     * Main function creating the content for the module.
     *
     * @return	string		HTML content for the module, actually a "section" made through the parent object in $this->pObj
     */
    function main()
    {
        global $SOBE, $LANG;
        $theCode = '';
        $this->tsConfig = t3lib_BEfunc::getPagesTSconfig($this->pObj->id);
        $this->pagesTsConfig = isset($this->tsConfig['TCEFORM.']['pages.']) ? $this->tsConfig['TCEFORM.']['pages.'] : array();
        // Create loremIpsum code:
        if (t3lib_extMgm::isLoaded('lorem_ipsum')) {
            $this->loremIpsumObject = t3lib_div::getUserObj('EXT:lorem_ipsum/class.tx_loremipsum_wiz.php:tx_loremipsum_wiz');
        }
        $m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(8);
        // create new pages here?
        $pRec = t3lib_BEfunc::getRecord('pages', $this->pObj->id, 'uid', ' AND ' . $m_perms_clause);
        $sys_pages = t3lib_div::makeInstance('t3lib_pageSelect');
        $menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', 0);
        if (is_array($pRec)) {
            $data = t3lib_div::_GP('data');
            if (is_array($data['pages'])) {
                if (t3lib_div::_GP('createInListEnd')) {
                    $endI = end($menuItems);
                    $thePid = -intval($endI['uid']);
                    if (!$thePid) {
                        $thePid = $this->pObj->id;
                    }
                } else {
                    $thePid = $this->pObj->id;
                }
                $firstRecord = true;
                $previousIdentifier = '';
                foreach ($data['pages'] as $identifier => $dat) {
                    if (!trim($dat['title'])) {
                        unset($data['pages'][$identifier]);
                    } else {
                        $data['pages'][$identifier]['hidden'] = t3lib_div::_GP('hidePages') ? 1 : 0;
                        if ($firstRecord) {
                            $firstRecord = false;
                            $data['pages'][$identifier]['pid'] = $thePid;
                        } else {
                            $data['pages'][$identifier]['pid'] = '-' . $previousIdentifier;
                        }
                        $previousIdentifier = $identifier;
                    }
                }
                if (count($data['pages'])) {
                    reset($data);
                    $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                    $tce->stripslashes_values = 0;
                    // set default TCA values specific for the user
                    $TCAdefaultOverride = $GLOBALS['BE_USER']->getTSConfigProp('TCAdefaults');
                    if (is_array($TCAdefaultOverride)) {
                        $tce->setDefaultsFromUserTS($TCAdefaultOverride);
                    }
                    $tce->start($data, array());
                    $tce->process_datamap();
                    t3lib_BEfunc::setUpdateSignal('updatePageTree');
                    $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', '', $GLOBALS['LANG']->getLL('wiz_newPages_create'));
                } else {
                    $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', '', $GLOBALS['LANG']->getLL('wiz_newPages_noCreate'), t3lib_FlashMessage::ERROR);
                }
                $theCode .= $flashMessage->render();
                // Display result:
                $menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', 0);
                $lines = array();
                foreach ($menuItems as $rec) {
                    t3lib_BEfunc::workspaceOL('pages', $rec);
                    if (is_array($rec)) {
                        $lines[] = '<nobr>' . t3lib_iconWorks::getSpriteIconForRecord('pages', $rec, array('title' => t3lib_BEfunc::titleAttribForPages($rec, '', FALSE))) . htmlspecialchars(t3lib_div::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</nobr>';
                    }
                }
                $theCode .= '<h4>' . $LANG->getLL('wiz_newPages_currentMenu') . '</h4>' . implode('<br />', $lines);
            } else {
                // Display create form
                $lines = array();
                for ($a = 0; $a < 9; $a++) {
                    $lines[] = $this->getFormLine($a);
                }
                $theCode .= '<h4>' . $LANG->getLL('wiz_newPages') . ':</h4>' . '<div id="formFieldContainer">' . implode('', $lines) . '</div>' . '<br class="clearLeft" />' . '<input type="button" id="createNewFormFields" value="' . $LANG->getLL('wiz_newPages_addMoreLines') . '" />' . '<br /><br />
				<input type="checkbox" name="createInListEnd" id="createInListEnd" value="1" /> <label for="createInListEnd">' . $LANG->getLL('wiz_newPages_listEnd') . '</label><br />
				<input type="checkbox" name="hidePages" id="hidePages" value="1" /> <label for="hidePages">' . $LANG->getLL('wiz_newPages_hidePages') . '</label><br /><br />
				<input type="submit" name="create" value="' . $LANG->getLL('wiz_newPages_lCreate') . '" onclick="return confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('wiz_newPages_lCreate_msg1')) . ')" />&nbsp;<input type="reset" value="' . $LANG->getLL('wiz_newPages_lReset') . '" /><br />';
                // Add ExtJS inline code
                $extCode = '
					var tpl = "' . addslashes(str_replace(array(LF, TAB), array('', ''), $this->getFormLine('#'))) . '", i, line, div, bg, label;
					var lineCounter = 9;
					Ext.get("createNewFormFields").on("click", function() {
						div = Ext.get("formFieldContainer");
						for (i = 0; i < 5; i++) {
							label = lineCounter + i + 1;
							bg = label % 2 === 0 ? 6 : 4;
							line = String.format(tpl, (lineCounter + i), label, bg);
							div.insertHtml("beforeEnd", line);
						}
						lineCounter += 5;
					});
				';
                /** @var t3lib_pageRenderer **/
                $pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
                $pageRenderer->loadExtJS();
                $pageRenderer->addExtOnReadyCode($extCode);
                $pageRenderer->addCssInlineBlock('tx_wizardcrpages_webfunc_2', '
				#formFieldContainer {float: left; margin: 0 0 10px 0;}
				.clearLeft {clear: left;}
				#formFieldContainer label {width: 70px; display: inline-block;}
				#formFieldContainer input {margin:4px 2px; padding:1px; vertical-align:middle}
				#formFieldContainer span {padding: 0 3px;}
				');
            }
        } else {
            $theCode .= $GLOBALS['TBE_TEMPLATE']->rfw($LANG->getLL('wiz_newPages_errorMsg1'));
        }
        // CSH
        $theCode .= t3lib_BEfunc::cshItem('_MOD_web_func', 'tx_wizardcrpages', $GLOBALS['BACK_PATH'], '<br />|');
        $out = $this->pObj->doc->section($LANG->getLL('wiz_crMany'), $theCode, 0, 1);
        return $out;
    }
コード例 #3
0
 /**
  * Creating versioning overlay of a sys_template record. This will use either frontend or backend overlay functionality depending on environment.
  *
  * @param	array		Row to overlay.
  * @return	void		Row is passed by reference.
  */
 function versionOL(&$row)
 {
     if (is_object($GLOBALS['TSFE'])) {
         // Frontend:
         $GLOBALS['TSFE']->sys_page->versionOL('sys_template', $row);
     } else {
         // Backend:
         t3lib_BEfunc::workspaceOL('sys_template', $row);
     }
 }
コード例 #4
0
ファイル: index.php プロジェクト: rod86/t3sandbox
    /**
     * Returns an array of available languages (to use for FlexForms)
     *
     * @param	integer		$id: If zero, the query will select all sys_language records from root level. If set to another value, the query will select all sys_language records that has a pages_language_overlay record on that page (and is not hidden, unless you are admin user)
     * @param	boolean		$onlyIsoCoded: If set, only languages which are paired with a static_info_table / static_language record will be returned.
     * @param	boolean		$setDefault: If set, an array entry for a default language is set.
     * @param	boolean		$setMulti: If set, an array entry for "multiple languages" is added (uid -1)
     * @return	array
     * @access protected
     */
    function getAvailableLanguages($id = 0, $onlyIsoCoded = true, $setDefault = true, $setMulti = false)
    {
        global $LANG, $TYPO3_DB, $BE_USER, $TCA, $BACK_PATH;
        t3lib_div::loadTCA('sys_language');
        $output = array();
        $excludeHidden = $BE_USER->isAdmin() ? '1=1' : 'sys_language.hidden=0';
        if ($id) {
            $excludeHidden .= ' AND pages_language_overlay.deleted=0';
            $res = $TYPO3_DB->exec_SELECTquery('DISTINCT sys_language.*, pages_language_overlay.hidden as PLO_hidden, pages_language_overlay.title as PLO_title', 'pages_language_overlay,sys_language', 'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid=' . intval($id) . ' AND ' . $excludeHidden, '', 'sys_language.title');
        } else {
            $res = $TYPO3_DB->exec_SELECTquery('sys_language.*', 'sys_language', $excludeHidden, '', 'sys_language.title');
        }
        if ($setDefault) {
            $output[0] = array('uid' => 0, 'title' => strlen($this->modSharedTSconfig['properties']['defaultLanguageLabel']) ? $this->modSharedTSconfig['properties']['defaultLanguageLabel'] : $LANG->getLL('defaultLanguage'), 'ISOcode' => 'DEF', 'flagIcon' => strlen($this->modSharedTSconfig['properties']['defaultLanguageFlag']) ? $this->modSharedTSconfig['properties']['defaultLanguageFlag'] : null);
        }
        if ($setMulti) {
            $output[-1] = array('uid' => -1, 'title' => $LANG->getLL('multipleLanguages'), 'ISOcode' => 'DEF', 'flagIcon' => 'multiple');
        }
        while (TRUE == ($row = $TYPO3_DB->sql_fetch_assoc($res))) {
            t3lib_BEfunc::workspaceOL('sys_language', $row);
            if ($id) {
                $table = 'pages_language_overlay';
                $enableFields = t3lib_BEfunc::BEenableFields($table);
                if (trim($enableFields) == 'AND') {
                    $enableFields = '';
                }
                $enableFields .= t3lib_BEfunc::deleteClause($table);
                // Selecting overlay record:
                $resP = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages_language_overlay', 'pid=' . intval($id) . '
						AND sys_language_uid=' . intval($row['uid']), '', '', '1');
                $pageRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resP);
                $GLOBALS['TYPO3_DB']->sql_free_result($resP);
                t3lib_BEfunc::workspaceOL('pages_language_overlay', $pageRow);
                $row['PLO_hidden'] = $pageRow['hidden'];
                $row['PLO_title'] = $pageRow['title'];
            }
            $output[$row['uid']] = $row;
            if ($row['static_lang_isocode']) {
                $staticLangRow = t3lib_BEfunc::getRecord('static_languages', $row['static_lang_isocode'], 'lg_iso_2');
                if ($staticLangRow['lg_iso_2']) {
                    $output[$row['uid']]['ISOcode'] = $staticLangRow['lg_iso_2'];
                }
            }
            if (strlen($row['flag'])) {
                $output[$row['uid']]['flagIcon'] = $row['flag'];
            }
            if ($onlyIsoCoded && !$output[$row['uid']]['ISOcode']) {
                unset($output[$row['uid']]);
            }
            $disableLanguages = t3lib_div::trimExplode(',', $this->modSharedTSconfig['properties']['disableLanguages'], 1);
            foreach ($disableLanguages as $language) {
                // $language is the uid of a sys_language
                unset($output[$language]);
            }
        }
        return $output;
    }
コード例 #5
0
 /**
  * Returns an array with record properties, like header and pid
  * No check for deleted or access is done!
  * For versionized records, pid is resolved to its live versions pid.
  * Used for loggin
  *
  * @param	string		Table name
  * @param	integer		Uid of record
  * @param	boolean		If set, no workspace overlay is performed
  * @return	array		Properties of record
  */
 function getRecordProperties($table, $id, $noWSOL = FALSE)
 {
     $row = $table == 'pages' && !$id ? array('title' => '[root-level]', 'uid' => 0, 'pid' => 0) : $this->recordInfo($table, $id, '*');
     if (!$noWSOL) {
         t3lib_BEfunc::workspaceOL($table, $row);
     }
     return $this->getRecordPropertiesFromRow($table, $row);
 }
コード例 #6
0
 /**
  * Add entries for a single record
  *
  * @param	string		Table name
  * @param	integer		Record uid
  * @param	array		Output lines array (is passed by reference and modified)
  * @param	string		Pre-HTML code
  * @param	boolean		If you want import validation, you can set this so it checks if the import can take place on the specified page.
  * @return	void
  */
 function singleRecordLines($table, $uid, &$lines, $preCode, $checkImportInPidRecord = 0)
 {
     global $TCA, $BE_USER, $LANG;
     // Get record:
     $record = $this->dat['header']['records'][$table][$uid];
     unset($this->remainHeader['records'][$table][$uid]);
     if (!is_array($record) && !($table === 'pages' && !$uid)) {
         $this->error('MISSING RECORD: ' . $table . ':' . $uid, 1);
     }
     // Begin to create the line arrays information record, pInfo:
     $pInfo = array();
     $pInfo['ref'] = $table . ':' . $uid;
     if ($table === '_SOFTREF_') {
         // Unknown table name:
         $pInfo['preCode'] = $preCode;
         $pInfo['title'] = '<em>' . $LANG->getLL('impexpcore_singlereco_softReferencesFiles', 1) . '</em>';
     } elseif (!isset($TCA[$table])) {
         // Unknown table name:
         $pInfo['preCode'] = $preCode;
         $pInfo['msg'] = "UNKNOWN TABLE '" . $pInfo['ref'] . "'";
         $pInfo['title'] = '<em>' . htmlspecialchars($record['title']) . '</em>';
     } else {
         // Otherwise, set table icon and title.
         // Import Validation (triggered by $this->display_import_pid_record) will show messages if import is not possible of various items.
         if (is_array($this->display_import_pid_record)) {
             if ($checkImportInPidRecord) {
                 if (!$BE_USER->doesUserHaveAccess($this->display_import_pid_record, $table == 'pages' ? 8 : 16)) {
                     $pInfo['msg'] .= "'" . $pInfo['ref'] . "' cannot be INSERTED on this page! ";
                 }
                 if (!$this->checkDokType($table, $this->display_import_pid_record['doktype']) && !$TCA[$table]['ctrl']['rootLevel']) {
                     $pInfo['msg'] .= "'" . $table . "' cannot be INSERTED on this page type (change page type to 'Folder'.) ";
                 }
             }
             if (!$BE_USER->check('tables_modify', $table)) {
                 $pInfo['msg'] .= "You are not allowed to CREATE '" . $table . "' tables! ";
             }
             if ($TCA[$table]['ctrl']['readOnly']) {
                 $pInfo['msg'] .= "TABLE '" . $table . "' is READ ONLY! ";
             }
             if ($TCA[$table]['ctrl']['adminOnly'] && !$BE_USER->isAdmin()) {
                 $pInfo['msg'] .= "TABLE '" . $table . "' is ADMIN ONLY! ";
             }
             if ($TCA[$table]['ctrl']['is_static']) {
                 $pInfo['msg'] .= "TABLE '" . $table . "' is a STATIC TABLE! ";
             }
             if ($TCA[$table]['ctrl']['rootLevel']) {
                 $pInfo['msg'] .= "TABLE '" . $table . "' will be inserted on ROOT LEVEL! ";
             }
             $diffInverse = FALSE;
             if ($this->update) {
                 $diffInverse = TRUE;
                 // In case of update-PREVIEW we swap the diff-sources.
                 $recInf = $this->doesRecordExist($table, $uid, $this->showDiff ? '*' : '');
                 $pInfo['updatePath'] = $recInf ? htmlspecialchars($this->getRecordPath($recInf['pid'])) : '<strong>NEW!</strong>';
                 // Mode selector:
                 $optValues = array();
                 $optValues[] = $recInf ? $LANG->getLL('impexpcore_singlereco_update') : $LANG->getLL('impexpcore_singlereco_insert');
                 if ($recInf) {
                     $optValues['as_new'] = $LANG->getLL('impexpcore_singlereco_importAsNew');
                 }
                 if ($recInf) {
                     if (!$this->global_ignore_pid) {
                         $optValues['ignore_pid'] = $LANG->getLL('impexpcore_singlereco_ignorePid');
                     } else {
                         $optValues['respect_pid'] = $LANG->getLL('impexpcore_singlereco_respectPid');
                     }
                 }
                 if (!$recInf && $GLOBALS['BE_USER']->isAdmin()) {
                     $optValues['force_uid'] = sprintf($LANG->getLL('impexpcore_singlereco_forceUidSAdmin'), $uid);
                 }
                 $optValues['exclude'] = $LANG->getLL('impexpcore_singlereco_exclude');
                 $pInfo['updateMode'] = $this->renderSelectBox('tx_impexp[import_mode][' . $table . ':' . $uid . ']', $this->import_mode[$table . ':' . $uid], $optValues);
             }
             // Diff vieiw:
             if ($this->showDiff) {
                 // For IMPORTS, get new id:
                 if ($newUid = $this->import_mapId[$table][$uid]) {
                     $diffInverse = FALSE;
                     $recInf = $this->doesRecordExist($table, $newUid, '*');
                     t3lib_BEfunc::workspaceOL($table, $recInf);
                 }
                 if (is_array($recInf)) {
                     $pInfo['showDiffContent'] = $this->compareRecords($recInf, $this->dat['records'][$table . ':' . $uid]['data'], $table, $diffInverse);
                 }
             }
         }
         $pInfo['preCode'] = $preCode . t3lib_iconworks::getSpriteIconForRecord($table, (array) $this->dat['records'][$table . ':' . $uid]['data'], array('title' => htmlspecialchars($table . ':' . $uid)));
         $pInfo['title'] = htmlspecialchars($record['title']);
         // View page:
         if ($table === 'pages') {
             $viewID = $this->mode === 'export' ? $uid : ($this->doesImport ? $this->import_mapId['pages'][$uid] : 0);
             if ($viewID) {
                 $pInfo['title'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($viewID, $GLOBALS['BACK_PATH'])) . 'return false;">' . $pInfo['title'] . '</a>';
             }
         }
     }
     $pInfo['class'] = $table == 'pages' ? 'bgColor4-20' : 'bgColor4';
     $pInfo['type'] = 'record';
     $pInfo['size'] = $record['size'];
     $lines[] = $pInfo;
     // File relations:
     if (is_array($record['filerefs'])) {
         $this->addFiles($record['filerefs'], $lines, $preCode);
     }
     // DB relations
     if (is_array($record['rels'])) {
         $this->addRelations($record['rels'], $lines, $preCode);
     }
     // Soft ref
     if (count($record['softrefs'])) {
         $preCode_A = $preCode . '&nbsp;&nbsp;&nbsp;&nbsp;';
         $preCode_B = $preCode . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
         foreach ($record['softrefs'] as $info) {
             $pInfo = array();
             $pInfo['preCode'] = $preCode_A . t3lib_iconWorks::getSpriteIcon('status-status-reference-soft');
             $pInfo['title'] = '<em>' . $info['field'] . ', "' . $info['spKey'] . '" </em>: <span title="' . htmlspecialchars($info['matchString']) . '">' . htmlspecialchars(t3lib_div::fixed_lgd_cs($info['matchString'], 60)) . '</span>';
             if ($info['subst']['type']) {
                 if (strlen($info['subst']['title'])) {
                     $pInfo['title'] .= '<br/>' . $preCode_B . '<strong>' . $LANG->getLL('impexpcore_singlereco_title', 1) . '</strong> ' . htmlspecialchars(t3lib_div::fixed_lgd_cs($info['subst']['title'], 60));
                 }
                 if (strlen($info['subst']['description'])) {
                     $pInfo['title'] .= '<br/>' . $preCode_B . '<strong>' . $LANG->getLL('impexpcore_singlereco_descr', 1) . '</strong> ' . htmlspecialchars(t3lib_div::fixed_lgd_cs($info['subst']['description'], 60));
                 }
                 $pInfo['title'] .= '<br/>' . $preCode_B . ($info['subst']['type'] == 'file' ? $LANG->getLL('impexpcore_singlereco_filename', 1) . ' <strong>' . $info['subst']['relFileName'] . '</strong>' : '') . ($info['subst']['type'] == 'string' ? $LANG->getLL('impexpcore_singlereco_value', 1) . ' <strong>' . $info['subst']['tokenValue'] . '</strong>' : '') . ($info['subst']['type'] == 'db' ? $LANG->getLL('impexpcore_softrefsel_record', 1) . ' <strong>' . $info['subst']['recordRef'] . '</strong>' : '');
             }
             $pInfo['ref'] = 'SOFTREF';
             $pInfo['size'] = '';
             $pInfo['class'] = 'bgColor3';
             $pInfo['type'] = 'softref';
             $pInfo['_softRefInfo'] = $info;
             $pInfo['type'] = 'softref';
             if ($info['error'] && !t3lib_div::inList('editable,exclude', $this->softrefCfg[$info['subst']['tokenID']]['mode'])) {
                 $pInfo['msg'] .= $info['error'];
             }
             $lines[] = $pInfo;
             // Add relations:
             if ($info['subst']['type'] == 'db') {
                 list($tempTable, $tempUid) = explode(':', $info['subst']['recordRef']);
                 $this->addRelations(array(array('table' => $tempTable, 'id' => $tempUid, 'tokenID' => $info['subst']['tokenID'])), $lines, $preCode_B, array(), '');
             }
             // Add files:
             if ($info['subst']['type'] == 'file') {
                 #debug($info);
                 $this->addFiles(array($info['file_ID']), $lines, $preCode_B, '', $info['subst']['tokenID']);
             }
         }
     }
 }
 /** set internal _accumulatedInformations array. Is called from constructor and uses the given tree, lang and l10ncfg
  * @return void
  **/
 function _calculateInternalAccumulatedInformationsArray()
 {
     global $TCA;
     $tree = $this->tree;
     $l10ncfg = $this->l10ncfg;
     $accum = array();
     $sysLang = $this->sysLang;
     // FlexForm Diff data:
     $flexFormDiff = unserialize($l10ncfg['flexformdiff']);
     $flexFormDiff = $flexFormDiff[$sysLang];
     $excludeIndex = array_flip(t3lib_div::trimExplode(',', $l10ncfg['exclude'], 1));
     $tableUidConstraintIndex = array_flip(t3lib_div::trimExplode(',', $l10ncfg['tableUidConstraint'], 1));
     // Init:
     $t8Tools = t3lib_div::makeInstance('tx_l10nmgr_tools');
     $t8Tools->verbose = FALSE;
     // Otherwise it will show records which has fields but none editable.
     if ($l10ncfg['incfcewithdefaultlanguage'] == 1) {
         $t8Tools->includeFceWithDefaultLanguage = TRUE;
     }
     // Set preview language (only first one in list is supported):
     if ($this->forcedPreviewLanguage != '') {
         $previewLanguage = $this->forcedPreviewLanguage;
     } else {
         $previewLanguage = current(t3lib_div::intExplode(',', $GLOBALS['BE_USER']->getTSConfigVal('options.additionalPreviewLanguages')));
     }
     if ($previewLanguage) {
         $t8Tools->previewLanguages = array($previewLanguage);
     }
     // Traverse tree elements:
     foreach ($tree->tree as $treeElement) {
         $pageId = $treeElement['row']['uid'];
         if (!isset($excludeIndex['pages:' . $pageId]) && !in_array($treeElement['row']['doktype'], $this->disallowDoktypes)) {
             $accum[$pageId]['header']['title'] = $treeElement['row']['title'];
             $accum[$pageId]['header']['icon'] = $treeElement['HTML'];
             $accum[$pageId]['header']['prevLang'] = $previewLanguage;
             $accum[$pageId]['items'] = array();
             // Traverse tables:
             foreach ($TCA as $table => $cfg) {
                 // Only those tables we want to work on:
                 if (t3lib_div::inList($l10ncfg['tablelist'], $table)) {
                     if ($table === 'pages') {
                         $accum[$pageId]['items'][$table][$pageId] = $t8Tools->translationDetails('pages', t3lib_BEfunc::getRecordWSOL('pages', $pageId), $sysLang, $flexFormDiff);
                         $this->_increaseInternalCounters($accum[$pageId]['items'][$table][$pageId]['fields']);
                     } else {
                         $allRows = $t8Tools->getRecordsToTranslateFromTable($table, $pageId);
                         if (is_array($allRows)) {
                             if (count($allRows)) {
                                 // Now, for each record, look for localization:
                                 foreach ($allRows as $row) {
                                     t3lib_BEfunc::workspaceOL($table, $row);
                                     if (is_array($row) && count($tableUidConstraintIndex) > 0) {
                                         if (is_array($row) && isset($tableUidConstraintIndex[$table . ':' . $row['uid']])) {
                                             $accum[$pageId]['items'][$table][$row['uid']] = $t8Tools->translationDetails($table, $row, $sysLang, $flexFormDiff);
                                             $this->_increaseInternalCounters($accum[$pageId]['items'][$table][$row['uid']]['fields']);
                                         }
                                     } else {
                                         if (is_array($row) && !isset($excludeIndex[$table . ':' . $row['uid']])) {
                                             $accum[$pageId]['items'][$table][$row['uid']] = $t8Tools->translationDetails($table, $row, $sysLang, $flexFormDiff);
                                             $this->_increaseInternalCounters($accum[$pageId]['items'][$table][$row['uid']]['fields']);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $includeIndex = array_unique(t3lib_div::trimExplode(',', $l10ncfg['include'], 1));
     foreach ($includeIndex as $recId) {
         list($table, $uid) = explode(':', $recId);
         $row = t3lib_BEfunc::getRecordWSOL($table, $uid);
         if (count($row)) {
             $accum[-1]['items'][$table][$row['uid']] = $t8Tools->translationDetails($table, $row, $sysLang, $flexFormDiff);
             $this->_increaseInternalCounters($accum[-1]['items'][$table][$row['uid']]['fields']);
         }
     }
     #		debug($accum);
     $this->_accumulatedInformations = $accum;
 }
コード例 #8
0
 /**
  * Traverse the result pointer given, adding each record to array and setting some internal values at the same time.
  *
  * @param	pointer		SQL result pointer for select query.
  * @param	string		Table name defaulting to tt_content
  * @return	array		The selected rows returned in this array.
  */
 function getResult($result, $table = 'tt_content')
 {
     // Initialize:
     $editUidList = '';
     $recs = array();
     $nextTree = $this->nextThree;
     $c = 0;
     $output = array();
     // Traverse the result:
     while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
         t3lib_BEfunc::workspaceOL($table, $row, -99, TRUE);
         if ($row) {
             // Add the row to the array:
             $output[] = $row;
             // Set an internal register:
             $recs[$c] = $row['uid'];
             // Create the list of the next three ids (for editing links...)
             for ($a = 0; $a < $nextTree; $a++) {
                 if (isset($recs[$c - $a])) {
                     $this->tt_contentData['nextThree'][$recs[$c - $a]] .= $row['uid'] . ',';
                 }
             }
             // Set next/previous ids:
             if (isset($recs[$c - 1])) {
                 if (isset($recs[$c - 2])) {
                     $this->tt_contentData['prev'][$row['uid']] = -$recs[$c - 2];
                 } else {
                     $this->tt_contentData['prev'][$row['uid']] = $row['pid'];
                 }
                 $this->tt_contentData['next'][$recs[$c - 1]] = -$row['uid'];
             }
             $c++;
         }
     }
     // Return selected records
     return $output;
 }
コード例 #9
0
    /**
     * Creates a standard list of elements from a table.
     *
     * @param	string		Table name
     * @param	integer		Page id.
     * @param	string		Comma list of fields to display
     * @param	boolean		If true, icon is shown
     * @param	string		Additional WHERE-clauses.
     * @return	string		HTML table
     */
    function makeOrdinaryList($table, $id, $fList, $icon = 0, $addWhere = '')
    {
        // Initialize:
        $out = '';
        $queryParts = $this->makeQueryArray($table, $id, $addWhere);
        $this->setTotalItems($queryParts);
        //		$dbCount = 0;
        $this->eCounter = 0;
        // Make query for records if there were any records found in the count operation:
        if ($this->totalItems) {
            $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
            //			$dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
        }
        // If records were found, render the list:
        if ($this->totalItems) {
            // Set fields
            $this->fieldArray = explode(',', $fList);
            // Header line is drawn
            $theData = array();
            $theData = $this->headerFields($this->fieldArray, $table, $theData);
            if ($this->doEdit) {
                $newRecIcon = $this->getNewRecordButton($table);
            }
            $out .= $this->addelement(1, $newRecIcon, $theData, ' class="c-headLineTable"');
            $checkCategories = false;
            if (count($this->includeCats) || count($this->excludeCats)) {
                $checkCategories = true;
            }
            // Render Items
            $this->eCounter = $this->firstElementNumber;
            while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
                t3lib_BEfunc::workspaceOL($table, $row);
                if (is_array($row)) {
                    //					list($flag,$code) = $this->fwd_rwd_nav();
                    //					$out.= $code;
                    if (1) {
                        $Nrow = array();
                        $NrowIcon = '';
                        $noEdit = $this->checkRecordPerms($row, $checkCategories);
                        // Setting icons/edit links:
                        if ($icon) {
                            $NrowIcon = $this->getIcon($table, $row, $noEdit);
                        }
                        if (!$noEdit) {
                            $params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
                            $NrowIcon .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->backPath, $this->returnUrl)) . '">' . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/edit2.gif', 'width="11" height="12"') . ' title="' . $GLOBALS['LANG']->getLL('edit', 1) . '" alt="" />' . '</a>';
                        } else {
                            $NrowIcon .= $this->noEditIcon($noEdit);
                        }
                        // Get values:
                        $Nrow = $this->dataFields($this->fieldArray, $table, $row, $Nrow, $noEdit);
                        $tdparams = $this->eCounter % 2 ? ' class="bgColor4"' : ' class="bgColor4-20"';
                        $out .= $this->addelement(1, $NrowIcon, $Nrow, $tdparams);
                    }
                    $this->eCounter++;
                }
            }
            // Wrap it all in a table:
            $out = '
				<table border="0" cellpadding="1" cellspacing="1" class="typo3-dblist">
					' . $out . '
				</table>';
            // Record navigation is added to the beginning and end of the table if in single table mode
            if ($table) {
                $pageNavigation = $this->renderListNavigation();
                $out = $pageNavigation . $out . $pageNavigation;
            }
        }
        return $out;
    }
 /**
  * This method returns an overlay of a record, independent from
  * a frontend or backend context
  *
  * @param string $table
  * @param string $olrow
  * @return array
  */
 protected function getContextIndependentWorkspaceOverlay($table, $olrow)
 {
     if (is_object($GLOBALS['TSFE']->sys_page)) {
         $GLOBALS['TSFE']->sys_page->versionOL($table, $olrow);
     } else {
         t3lib_BEfunc::workspaceOL($table, $olrow);
     }
     return $olrow;
 }
コード例 #11
0
 /**
  * Get an alternative language record for a specific page / language
  *
  * @param	integer		Page ID to look up for.
  * @param	integer		Language UID to select for.
  * @return	array		pages_languages_overlay record
  */
 function getLangStatus($pageId, $langId)
 {
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages_language_overlay', 'pid=' . intval($pageId) . ' AND sys_language_uid=' . intval($langId) . t3lib_BEfunc::deleteClause('pages_language_overlay') . t3lib_BEfunc::versioningPlaceholderClause('pages_language_overlay'));
     $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
     t3lib_BEfunc::workspaceOL('pages_language_overlay', $row);
     if (is_array($row)) {
         $row['_COUNT'] = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
         $row['_HIDDEN'] = $row['hidden'] || intval($row['endtime']) > 0 && intval($row['endtime']) < $GLOBALS['EXEC_TIME'] || $GLOBALS['EXEC_TIME'] < intval($row['starttime']);
     }
     return $row;
 }
コード例 #12
0
ファイル: backend.php プロジェクト: NaveedWebdeveloper/Test
    /**
     * Checking if the "&edit" variable was sent so we can open it for editing the page.
     * Code based on code from "alt_shortcut.php"
     *
     * @return	void
     */
    protected function handlePageEditing()
    {
        if (!t3lib_extMgm::isLoaded('cms')) {
            return;
        }
        // EDIT page:
        $editId = preg_replace('/[^[:alnum:]_]/', '', t3lib_div::_GET('edit'));
        $editRecord = '';
        if ($editId) {
            // Looking up the page to edit, checking permissions:
            $where = ' AND (' . $GLOBALS['BE_USER']->getPagePermsClause(2) . ' OR ' . $GLOBALS['BE_USER']->getPagePermsClause(16) . ')';
            if (t3lib_div::testInt($editId)) {
                $editRecord = t3lib_BEfunc::getRecordWSOL('pages', $editId, '*', $where);
            } else {
                $records = t3lib_BEfunc::getRecordsByField('pages', 'alias', $editId, $where);
                if (is_array($records)) {
                    reset($records);
                    $editRecord = current($records);
                    t3lib_BEfunc::workspaceOL('pages', $editRecord);
                }
            }
            // If the page was accessible, then let the user edit it.
            if (is_array($editRecord) && $GLOBALS['BE_USER']->isInWebMount($editRecord['uid'])) {
                // Setting JS code to open editing:
                $this->js .= '
		// Load page to edit:
	window.setTimeout("top.loadEditId(' . intval($editRecord['uid']) . ');", 500);
			';
                // "Shortcuts" have been renamed to "Bookmarks"
                // @deprecated remove shortcuts code in TYPO3 4.7
                $shortcutSetPageTree = $GLOBALS['BE_USER']->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree');
                $bookmarkSetPageTree = $GLOBALS['BE_USER']->getTSConfigVal('options.bookmark_onEditId_dontSetPageTree');
                if ($shortcutSetPageTree !== '') {
                    t3lib_div::deprecationLog('options.shortcut_onEditId_dontSetPageTree - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmark_onEditId_dontSetPageTree instead');
                }
                // Checking page edit parameter:
                if (!$shortcutSetPageTree && !$bookmarkSetPageTree) {
                    $shortcutKeepExpanded = $GLOBALS['BE_USER']->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded');
                    $bookmarkKeepExpanded = $GLOBALS['BE_USER']->getTSConfigVal('options.bookmark_onEditId_keepExistingExpanded');
                    $keepExpanded = $shortcutKeepExpanded || $bookmarkKeepExpanded;
                    // Expanding page tree:
                    t3lib_BEfunc::openPageTree(intval($editRecord['pid']), !$keepExpanded);
                    if ($shortcutKeepExpanded) {
                        t3lib_div::deprecationLog('options.shortcut_onEditId_keepExistingExpanded - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmark_onEditId_keepExistingExpanded instead');
                    }
                }
            } else {
                $this->js .= '
		// Warning about page editing:
	alert(' . $GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->getLL('noEditPage'), $editId)) . ');
			';
            }
        }
    }
コード例 #13
0
ファイル: db_layout.php プロジェクト: NaveedWebdeveloper/Test
    /**
     * Rendering the quick-edit view.
     *
     * @return	void
     */
    function renderQuickEdit()
    {
        global $LANG, $BE_USER, $BACK_PATH;
        // Alternative template
        $this->doc->setModuleTemplate('templates/db_layout_quickedit.html');
        // Alternative form tag; Quick Edit submits its content to tce_db.php.
        $this->doc->form = '<form action="' . htmlspecialchars($BACK_PATH . 'tce_db.php?&prErr=1&uPT=1') . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
        // Setting up the context sensitive menu:
        $this->doc->getContextMenuCode();
        // Set the edit_record value for internal use in this function:
        $edit_record = $this->edit_record;
        // If a command to edit all records in a column is issue, then select all those elements, and redirect to alt_doc.php:
        if (substr($edit_record, 0, 9) == '_EDIT_COL') {
            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . intval($this->id) . ' AND colPos=' . intval(substr($edit_record, 10)) . ' AND sys_language_uid=' . intval($this->current_sys_language) . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : t3lib_BEfunc::BEenableFields('tt_content')) . t3lib_BEfunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'sorting');
            $idListA = array();
            while ($cRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                $idListA[] = $cRow['uid'];
            }
            $url = $BACK_PATH . 'alt_doc.php?edit[tt_content][' . implode(',', $idListA) . ']=edit&returnUrl=' . rawurlencode($this->local_linkThisScript(array('edit_record' => '')));
            t3lib_utility_Http::redirect($url);
        }
        // If the former record edited was the creation of a NEW record, this will look up the created records uid:
        if ($this->new_unique_uid) {
            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_log', 'userid=' . intval($BE_USER->user['uid']) . ' AND NEWid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->new_unique_uid, 'sys_log'));
            $sys_log_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
            if (is_array($sys_log_row)) {
                $edit_record = $sys_log_row['tablename'] . ':' . $sys_log_row['recuid'];
            }
        }
        // Creating the selector box, allowing the user to select which element to edit:
        $opt = array();
        $is_selected = 0;
        $languageOverlayRecord = '';
        if ($this->current_sys_language) {
            list($languageOverlayRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay', 'pid', $this->id, 'AND sys_language_uid=' . intval($this->current_sys_language));
        }
        if (is_array($languageOverlayRecord)) {
            $inValue = 'pages_language_overlay:' . $languageOverlayRecord['uid'];
            $is_selected += intval($edit_record == $inValue);
            $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $LANG->getLL('editLanguageHeader', 1) . ' ]</option>';
        } else {
            $inValue = 'pages:' . $this->id;
            $is_selected += intval($edit_record == $inValue);
            $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $LANG->getLL('editPageProperties', 1) . ' ]</option>';
        }
        // Selecting all content elements from this language and allowed colPos:
        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . intval($this->id) . ' AND sys_language_uid=' . intval($this->current_sys_language) . ' AND colPos IN (' . $this->colPosList . ')' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : t3lib_BEfunc::BEenableFields('tt_content')) . t3lib_Befunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'colPos,sorting');
        $colPos = '';
        $first = 1;
        $prev = $this->id;
        // Page is the pid if no record to put this after.
        while ($cRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
            t3lib_BEfunc::workspaceOL('tt_content', $cRow);
            if (is_array($cRow)) {
                if ($first) {
                    if (!$edit_record) {
                        $edit_record = 'tt_content:' . $cRow['uid'];
                    }
                    $first = 0;
                }
                if (strcmp($cRow['colPos'], $colPos)) {
                    $colPos = $cRow['colPos'];
                    $opt[] = '<option value=""></option>';
                    $opt[] = '<option value="_EDIT_COL:' . $colPos . '">__' . $LANG->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $colPos), 1) . ':__</option>';
                }
                $inValue = 'tt_content:' . $cRow['uid'];
                $is_selected += intval($edit_record == $inValue);
                $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($cRow['header'] ? $cRow['header'] : '[' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.no_title') . '] ' . strip_tags($cRow['bodytext']), $BE_USER->uc['titleLen'])) . '</option>';
                $prev = -$cRow['uid'];
            }
        }
        // If edit_record is not set (meaning, no content elements was found for this language) we simply set it to create a new element:
        if (!$edit_record) {
            $edit_record = 'tt_content:new/' . $prev . '/' . $colPos;
            $inValue = 'tt_content:new/' . $prev . '/' . $colPos;
            $is_selected += intval($edit_record == $inValue);
            $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $LANG->getLL('newLabel', 1) . ' ]</option>';
        }
        // If none is yet selected...
        if (!$is_selected) {
            $opt[] = '<option value=""></option>';
            $opt[] = '<option value="' . $edit_record . '"  selected="selected">[ ' . $LANG->getLL('newLabel', 1) . ' ]</option>';
        }
        // Splitting the edit-record cmd value into table/uid:
        $this->eRParts = explode(':', $edit_record);
        // Delete-button flag?
        $this->deleteButton = t3lib_div::testInt($this->eRParts[1]) && $edit_record && ($this->eRParts[0] != 'pages' && $this->EDIT_CONTENT || $this->eRParts[0] == 'pages' && $this->CALC_PERMS & 4);
        // If undo-button should be rendered (depends on available items in sys_history)
        $this->undoButton = 0;
        $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->eRParts[0], 'sys_history') . ' AND recuid=' . intval($this->eRParts[1]), '', 'tstamp DESC', '1');
        if ($this->undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes)) {
            $this->undoButton = 1;
        }
        // Setting up the Return URL for coming back to THIS script (if links take the user to another script)
        $R_URL_parts = parse_url(t3lib_div::getIndpEnv('REQUEST_URI'));
        $R_URL_getvars = t3lib_div::_GET();
        unset($R_URL_getvars['popView']);
        unset($R_URL_getvars['new_unique_uid']);
        $R_URL_getvars['edit_record'] = $edit_record;
        $this->R_URI = $R_URL_parts['path'] . '?' . t3lib_div::implodeArrayForUrl('', $R_URL_getvars);
        // Setting close url/return url for exiting this script:
        $this->closeUrl = $this->local_linkThisScript(array('SET' => array('function' => 1)));
        // Goes to 'Columns' view if close is pressed (default)
        if ($BE_USER->uc['condensedMode']) {
            $this->closeUrl = $BACK_PATH . 'alt_db_navframe.php';
        }
        if ($this->returnUrl) {
            $this->closeUrl = $this->returnUrl;
        }
        // Return-url for JavaScript:
        $retUrlStr = $this->returnUrl ? "+'&returnUrl='+'" . rawurlencode($this->returnUrl) . "'" : '';
        // Drawing the edit record selectbox
        $this->editSelect = '<select name="edit_record" onchange="' . htmlspecialchars('jumpToUrl(\'db_layout.php?id=' . $this->id . '&edit_record=\'+escape(this.options[this.selectedIndex].value)' . $retUrlStr . ',this);') . '">' . implode('', $opt) . '</select>';
        // Creating editing form:
        if ($BE_USER->check('tables_modify', $this->eRParts[0]) && $edit_record && ($this->eRParts[0] != 'pages' && $this->EDIT_CONTENT || $this->eRParts[0] == 'pages' && $this->CALC_PERMS & 1)) {
            // Splitting uid parts for special features, if new:
            list($uidVal, $ex_pid, $ex_colPos) = explode('/', $this->eRParts[1]);
            // Convert $uidVal to workspace version if any:
            if ($uidVal != 'new') {
                if ($draftRecord = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, $this->eRParts[0], $uidVal, 'uid')) {
                    $uidVal = $draftRecord['uid'];
                }
            }
            // Initializing transfer-data object:
            $trData = t3lib_div::makeInstance('t3lib_transferData');
            $trData->addRawData = TRUE;
            $trData->defVals[$this->eRParts[0]] = array('colPos' => intval($ex_colPos), 'sys_language_uid' => intval($this->current_sys_language));
            $trData->disableRTE = $this->MOD_SETTINGS['disableRTE'];
            $trData->lockRecords = 1;
            $trData->fetchRecord($this->eRParts[0], $uidVal == 'new' ? $this->id : $uidVal, $uidVal);
            // 'new'
            // Getting/Making the record:
            reset($trData->regTableItems_data);
            $rec = current($trData->regTableItems_data);
            if ($uidVal == 'new') {
                $new_unique_uid = uniqid('NEW');
                $rec['uid'] = $new_unique_uid;
                $rec['pid'] = intval($ex_pid) ? intval($ex_pid) : $this->id;
                $recordAccess = TRUE;
            } else {
                $rec['uid'] = $uidVal;
                // Checking internals access:
                $recordAccess = $BE_USER->recordEditAccessInternals($this->eRParts[0], $uidVal);
            }
            if (!$recordAccess) {
                // If no edit access, print error message:
                $content .= $this->doc->section($LANG->getLL('noAccess'), $LANG->getLL('noAccess_msg') . '<br /><br />' . ($BE_USER->errorMsg ? 'Reason: ' . $BE_USER->errorMsg . '<br /><br />' : ''), 0, 1);
            } elseif (is_array($rec)) {
                // If the record is an array (which it will always be... :-)
                // Create instance of TCEforms, setting defaults:
                $tceforms = t3lib_div::makeInstance('t3lib_TCEforms');
                $tceforms->backPath = $BACK_PATH;
                $tceforms->initDefaultBEMode();
                $tceforms->fieldOrder = $this->modTSconfig['properties']['tt_content.']['fieldOrder'];
                $tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes'];
                $tceforms->disableRTE = $this->MOD_SETTINGS['disableRTE'];
                $tceforms->enableClickMenu = TRUE;
                // Clipboard is initialized:
                $tceforms->clipObj = t3lib_div::makeInstance('t3lib_clipboard');
                // Start clipboard
                $tceforms->clipObj->initializeClipboard();
                // Initialize - reads the clipboard content from the user session
                if ($BE_USER->uc['edit_showFieldHelp'] != 'text' && $this->MOD_SETTINGS['showDescriptions']) {
                    $tceforms->edit_showFieldHelp = 'text';
                }
                // Render form, wrap it:
                $panel = '';
                $panel .= $tceforms->getMainFields($this->eRParts[0], $rec);
                $panel = $tceforms->wrapTotal($panel, $rec, $this->eRParts[0]);
                // Add hidden fields:
                $theCode = $panel;
                if ($uidVal == 'new') {
                    $theCode .= '<input type="hidden" name="data[' . $this->eRParts[0] . '][' . $rec['uid'] . '][pid]" value="' . $rec['pid'] . '" />';
                }
                $theCode .= '
					<input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" />
					<input type="hidden" name="_disableRTE" value="' . $tceforms->disableRTE . '" />
					<input type="hidden" name="edit_record" value="' . $edit_record . '" />
					<input type="hidden" name="redirect" value="' . htmlspecialchars($uidVal == 'new' ? t3lib_extMgm::extRelPath('cms') . 'layout/db_layout.php?id=' . $this->id . '&new_unique_uid=' . $new_unique_uid . '&returnUrl=' . rawurlencode($this->returnUrl) : $this->R_URI) . '" />
					' . t3lib_TCEforms::getHiddenTokenField('tceAction');
                // Add JavaScript as needed around the form:
                $theCode = $tceforms->printNeededJSFunctions_top() . $theCode . $tceforms->printNeededJSFunctions();
                // Add warning sign if record was "locked":
                if ($lockInfo = t3lib_BEfunc::isRecordLocked($this->eRParts[0], $rec['uid'])) {
                    $lockedMessage = t3lib_div::makeInstance('t3lib_FlashMessage', htmlspecialchars($lockInfo['msg']), '', t3lib_FlashMessage::WARNING);
                    t3lib_FlashMessageQueue::addMessage($lockedMessage);
                }
                // Add whole form as a document section:
                $content .= $this->doc->section('', $theCode);
            }
        } else {
            // If no edit access, print error message:
            $content .= $this->doc->section($LANG->getLL('noAccess'), $LANG->getLL('noAccess_msg') . '<br /><br />', 0, 1);
        }
        // Bottom controls (function menus):
        $q_count = $this->getNumberOfHiddenElements();
        $h_func_b = t3lib_BEfunc::getFuncCheck($this->id, 'SET[tt_content_showHidden]', $this->MOD_SETTINGS['tt_content_showHidden'], 'db_layout.php', '', 'id="checkTt_content_showHidden"') . '<label for="checkTt_content_showHidden">' . (!$q_count ? $GLOBALS['TBE_TEMPLATE']->dfw($LANG->getLL('hiddenCE', 1)) : $LANG->getLL('hiddenCE', 1) . ' (' . $q_count . ')') . '</label>';
        $h_func_b .= '<br />' . t3lib_BEfunc::getFuncCheck($this->id, 'SET[showPalettes]', $this->MOD_SETTINGS['showPalettes'], 'db_layout.php', '', 'id="checkShowPalettes"') . '<label for="checkShowPalettes">' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPalettes', 1) . '</label>';
        if (t3lib_extMgm::isLoaded('context_help') && $BE_USER->uc['edit_showFieldHelp'] != 'text') {
            $h_func_b .= '<br />' . t3lib_BEfunc::getFuncCheck($this->id, 'SET[showDescriptions]', $this->MOD_SETTINGS['showDescriptions'], 'db_layout.php', '', 'id="checkShowDescriptions"') . '<label for="checkShowDescriptions">' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showDescriptions', 1) . '</label>';
        }
        if ($BE_USER->isRTE()) {
            $h_func_b .= '<br />' . t3lib_BEfunc::getFuncCheck($this->id, 'SET[disableRTE]', $this->MOD_SETTINGS['disableRTE'], 'db_layout.php', '', 'id="checkDisableRTE"') . '<label for="checkDisableRTE">' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.disableRTE', 1) . '</label>';
        }
        // Add the function menus to bottom:
        $content .= $this->doc->section('', $h_func_b, 0, 0);
        $content .= $this->doc->spacer(10);
        // Select element matrix:
        if ($this->eRParts[0] == 'tt_content' && t3lib_div::testInt($this->eRParts[1])) {
            $posMap = t3lib_div::makeInstance('ext_posMap');
            $posMap->backPath = $BACK_PATH;
            $posMap->cur_sys_language = $this->current_sys_language;
            $HTMLcode = '';
            // CSH:
            $HTMLcode .= t3lib_BEfunc::cshItem($this->descrTable, 'quickEdit_selElement', $BACK_PATH, '|<br />');
            $HTMLcode .= $posMap->printContentElementColumns($this->id, $this->eRParts[1], $this->colPosList, $this->MOD_SETTINGS['tt_content_showHidden'], $this->R_URI);
            $content .= $this->doc->spacer(20);
            $content .= $this->doc->section($LANG->getLL('CEonThisPage'), $HTMLcode, 0, 1);
            $content .= $this->doc->spacer(20);
        }
        // Finally, if comments were generated in TCEforms object, print these as a HTML comment:
        if (count($tceforms->commentMessages)) {
            $content .= '
	<!-- TCEFORM messages
	' . htmlspecialchars(implode(LF, $tceforms->commentMessages)) . '
	-->
	';
        }
        return $content;
    }
コード例 #14
0
 /**
  * Returns the path (visually) of a page $uid, fx. "/First page/Second page/Another subpage"
  * Each part of the path will be limited to $titleLimit characters
  * Deleted pages are filtered out.
  *
  * @param	integer		Page uid for which to create record path
  * @param	string		$clause is additional where clauses, eg. "
  * @param	integer		Title limit
  * @param	integer		Title limit of Full title (typ. set to 1000 or so)
  * @return	mixed		Path of record (string) OR array with short/long title if $fullTitleLimit is set.
  */
 public static function getRecordPath($uid, $clause = '', $titleLimit = 1000, $fullTitleLimit = 0)
 {
     $loopCheck = 100;
     $output = $fullOutput = '/';
     while ($uid != 0 && $loopCheck > 0) {
         $loopCheck--;
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,pid,title,deleted,t3ver_oid,t3ver_wsid,t3ver_swapmode', 'pages', 'uid=' . intval($uid) . (strlen(trim($clause)) ? ' AND ' . $clause : ''));
         if (is_resource($res)) {
             $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
             $GLOBALS['TYPO3_DB']->sql_free_result($res);
             t3lib_BEfunc::workspaceOL('pages', $row);
             if (is_array($row)) {
                 t3lib_BEfunc::fixVersioningPid('pages', $row);
                 if ($row['_ORIG_pid'] && $row['t3ver_swapmode'] > 0) {
                     // Branch points
                     $output = ' [#VEP#]' . $output;
                     // Adding visual token - Versioning Entry Point - that tells that THIS position was where the versionized branch got connected to the main tree. I will have to find a better name or something...
                 }
                 $uid = $row['pid'];
                 $output = '/' . t3lib_div::fixed_lgd_cs(strip_tags($row['title']), $titleLimit) . $output;
                 if ($row['deleted']) {
                     $output = '<span class="deletedPath">' . $output . '</span>';
                 }
                 if ($fullTitleLimit) {
                     $fullOutput = '/' . t3lib_div::fixed_lgd_cs(strip_tags($row['title']), $fullTitleLimit) . $fullOutput;
                 }
             } else {
                 break;
             }
         } else {
             break;
         }
     }
     if ($fullTitleLimit) {
         return array($output, $fullOutput);
     } else {
         return $output;
     }
 }
コード例 #15
0
 /**
  * Finds page UIDs for the element from table <code>$table</code> with UIDs from <code>$idList</code>
  *
  * @param string $table Table to search
  * @param array $idList List of records' UIDs
  * @param integer $workspaceId Workspace ID. We need this parameter because user can be in LIVE but he still can publisg DRAFT from ws module!
  * @param array $pageIdList List of found page UIDs
  * @param array $elementList List of found element UIDs. Key is table name, value is list of UIDs
  * @return void
  */
 public function findPageIdsForVersionStateChange($table, array $idList, $workspaceId, array &$pageIdList, array &$elementList)
 {
     if ($workspaceId != 0) {
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('DISTINCT B.pid', $table . ' A,' . $table . ' B', 'A.pid=-1' . ' AND A.t3ver_wsid=' . $workspaceId . ' AND A.uid IN (' . implode(',', $idList) . ') AND A.t3ver_oid=B.uid' . t3lib_BEfunc::deleteClause($table, 'A') . t3lib_BEfunc::deleteClause($table, 'B'));
         while (FALSE !== ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res))) {
             $pageIdList[] = $row[0];
             // Find ws version
             // Note: cannot use t3lib_BEfunc::getRecordWSOL()
             // here because it does not accept workspace id!
             $rec = t3lib_BEfunc::getRecord('pages', $row[0]);
             t3lib_BEfunc::workspaceOL('pages', $rec, $workspaceId);
             if ($rec['_ORIG_uid']) {
                 $elementList['pages'][$row[0]] = $rec['_ORIG_uid'];
             }
         }
         $GLOBALS['TYPO3_DB']->sql_free_result($res);
         // The line below is necessary even with DISTINCT
         // because several elements can be passed by caller
         $pageIdList = array_unique($pageIdList);
     }
 }
コード例 #16
0
 /**
  * Adds records from a foreign table (for selector boxes)
  *
  * @param	array		The array of items (label,value,icon)
  * @param	array		The 'columns' array for the field (from TCA)
  * @param	array		TSconfig for the table/row
  * @param	string		The fieldname
  * @param	boolean		If set, then we are fetching the 'neg_' foreign tables.
  * @return	array		The $items array modified.
  * @see addSelectOptionsToItemArray(), t3lib_BEfunc::exec_foreign_table_where_query()
  */
 function foreignTable($items, $fieldValue, $TSconfig, $field, $pFFlag = 0)
 {
     global $TCA;
     // Init:
     $pF = $pFFlag ? 'neg_' : '';
     $f_table = $fieldValue['config'][$pF . 'foreign_table'];
     $uidPre = $pFFlag ? '-' : '';
     // Get query:
     $res = t3lib_BEfunc::exec_foreign_table_where_query($fieldValue, $field, $TSconfig, $pF);
     // Perform lookup
     if ($GLOBALS['TYPO3_DB']->sql_error()) {
         echo $GLOBALS['TYPO3_DB']->sql_error() . "\n\nThis may indicate a table defined in tables.php is not existing in the database!";
         return array();
     }
     // Get label prefix.
     $lPrefix = $this->sL($fieldValue['config'][$pF . 'foreign_table_prefix']);
     // Get icon field + path if any:
     $iField = $TCA[$f_table]['ctrl']['selicon_field'];
     $iPath = trim($TCA[$f_table]['ctrl']['selicon_field_path']);
     // Traverse the selected rows to add them:
     while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
         t3lib_BEfunc::workspaceOL($f_table, $row);
         if (is_array($row)) {
             // Prepare the icon if available:
             if ($iField && $iPath && $row[$iField]) {
                 $iParts = t3lib_div::trimExplode(',', $row[$iField], 1);
                 $icon = '../' . $iPath . '/' . trim($iParts[0]);
             } elseif (t3lib_div::inList('singlebox,checkbox', $fieldValue['config']['renderMode'])) {
                 $icon = t3lib_iconWorks::mapRecordTypeToSpriteIconName($f_table, $row);
             } else {
                 $icon = 'empty-empty';
             }
             // Add the item:
             $items[] = array($lPrefix . htmlspecialchars(t3lib_BEfunc::getRecordTitle($f_table, $row)), $uidPre . $row['uid'], $icon);
         }
     }
     return $items;
 }
コード例 #17
0
 /**
  * Getting the tree data: next entry
  *
  * @param	mixed		data handle
  * @param	string		CSS class for sub elements (workspace related)
  * @return	array		item data array OR FALSE if end of elements.
  * @access private
  * @see getDataInit()
  */
 function getDataNext(&$res, $subCSSclass = '')
 {
     if (is_array($this->data)) {
         if ($res < 0) {
             $row = FALSE;
         } else {
             list(, $row) = each($this->dataLookup[$res][$this->subLevelID]);
             // Passing on default <td> class for subelements:
             if (is_array($row) && $subCSSclass !== '') {
                 $row['_CSSCLASS'] = $row['_SUBCSSCLASS'] = $subCSSclass;
             }
         }
         return $row;
     } else {
         while ($row = @$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             t3lib_BEfunc::workspaceOL($this->table, $row, $this->BE_USER->workspace, TRUE);
             if (is_array($row)) {
                 break;
             }
         }
         // Passing on default <td> class for subelements:
         if (is_array($row) && $subCSSclass !== '') {
             if ($this->table === 'pages' && $this->highlightPagesWithVersions && !isset($row['_CSSCLASS']) && count(t3lib_BEfunc::countVersionsOfRecordsOnPage($this->BE_USER->workspace, $row['uid'], TRUE))) {
                 $row['_CSSCLASS'] = 'ver-versions';
             }
             if (!isset($row['_CSSCLASS'])) {
                 $row['_CSSCLASS'] = $subCSSclass;
             }
             if (!isset($row['_SUBCSSCLASS'])) {
                 $row['_SUBCSSCLASS'] = $subCSSclass;
             }
         }
         return $row;
     }
 }
コード例 #18
0
 /**
  * Creating localization index for a single record (which must be default/international language and an online version!)
  *
  * @param  string       $table      Table name
  * @param  integer      $uid        Record UID
  * @param  integer|NULL $languageID Language ID of the record
  * @return  mixed    FALSE if the input record is not one that can be translated. Otherwise an array holding information about the status.
  */
 function indexDetailsRecord($table, $uid, $languageID = NULL)
 {
     $rec = $table == 'pages' ? t3lib_BEfunc::getRecord($table, $uid) : $this->getSingleRecordToTranslate($table, $uid);
     if (is_array($rec) && $rec['pid'] != -1) {
         $pid = $table == 'pages' ? $rec['uid'] : $rec['pid'];
         if ($this->bypassFilter || $this->filterIndex($table, $uid, $pid)) {
             t3lib_BEfunc::workspaceOL($table, $rec);
             $items = array();
             foreach ($this->sys_languages as $r) {
                 if (is_null($languageID) || $r['uid'] === $languageID) {
                     $items['fullDetails'][$r['uid']] = $this->translationDetails($table, $rec, $r['uid']);
                     $items['indexRecord'][$r['uid']] = $this->compileIndexRecord($table, $items['fullDetails'][$r['uid']], $r['uid'], $pid);
                 }
             }
             return $items;
         } else {
             return FALSE;
         }
     } else {
         return FALSE;
     }
 }
コード例 #19
0
 /**
  * @param string $table Table name
  * @param array $row Record array passed by reference. As minimum, the "uid" and  "pid" fields must exist! Fake fields cannot exist since the fields in the array is used as field names in the SQL look up. It would be nice to have fields like "t3ver_state" and "t3ver_mode_id" as well to avoid a new lookup inside movePlhOL().
  * @param int $wsid Workspace ID, if not specified will use static::getBackendUserAuthentication()->workspace
  * @param bool $unsetMovePointers If TRUE the function does not return a "pointer" row for moved records in a workspace
  * @return void
  * @see fixVersioningPid()
  */
 public function workspaceOL($table, &$row, $wsid = -99, $unsetMovePointers = FALSE)
 {
     /** @noinspection PhpDeprecationInspection PhpUndefinedClassInspection */
     t3lib_BEfunc::workspaceOL($table, $row, $wsid, $unsetMovePointers);
 }
 /**
  * Overlay the given record with its workspace-version, if any
  *
  * @param array The record to get the workspace version for
  * @return void (passed by reference)
  */
 protected function makeWorkspaceOverlay(&$row)
 {
     // check for workspace-versions
     if ($GLOBALS['BE_USER']->workspace != 0 && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS'] == TRUE) {
         t3lib_BEfunc::workspaceOL($this->mmForeignTable ? $this->mmForeignTable : $this->table, $row);
     }
 }
コード例 #21
0
 function getAvailableLanguages($id = 0, $onlyIsoCoded = true, $setDefault = true, $setMulti = false)
 {
     global $LANG, $TYPO3_DB, $BE_USER, $TCA, $BACK_PATH;
     t3lib_div::loadTCA('sys_language');
     $flagAbsPath = t3lib_div::getFileAbsFileName($TCA['sys_language']['columns']['flag']['config']['fileFolder']);
     $flagIconPath = $BACK_PATH . '../' . substr($flagAbsPath, strlen(PATH_site));
     $output = array();
     $excludeHidden = $BE_USER->isAdmin() ? '1' : 'sys_language.hidden=0';
     if ($id) {
         $excludeHidden .= ' AND pages_language_overlay.deleted=0';
         $res = $TYPO3_DB->exec_SELECTquery('DISTINCT sys_language.*', 'pages_language_overlay,sys_language', 'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid=' . intval($id) . ' AND ' . $excludeHidden, '', 'sys_language.title');
     } else {
         $res = $TYPO3_DB->exec_SELECTquery('sys_language.*', 'sys_language', $excludeHidden, '', 'sys_language.title');
     }
     if ($setDefault) {
         $output[0] = array('uid' => 0, 'title' => strlen($this->modSharedTSconfig['properties']['defaultLanguageLabel']) ? $this->modSharedTSconfig['properties']['defaultLanguageLabel'] : $LANG->getLL('defaultLanguage'), 'ISOcode' => 'DEF', 'flagIcon' => strlen($this->modSharedTSconfig['properties']['defaultLanguageFlag']) ? $this->modSharedTSconfig['properties']['defaultLanguageFlag'] : null);
     }
     if ($setMulti) {
         $output[-1] = array('uid' => -1, 'title' => $LANG->getLL('multipleLanguages'), 'ISOcode' => 'DEF', 'flagIcon' => 'multiple');
     }
     while (TRUE == ($row = $TYPO3_DB->sql_fetch_assoc($res))) {
         t3lib_BEfunc::workspaceOL('sys_language', $row);
         $output[$row['uid']] = $row;
         if ($row['static_lang_isocode']) {
             $staticLangRow = t3lib_BEfunc::getRecord('static_languages', $row['static_lang_isocode'], 'lg_iso_2');
             if ($staticLangRow['lg_iso_2']) {
                 $output[$row['uid']]['ISOcode'] = $staticLangRow['lg_iso_2'];
             }
         }
         if (strlen($row['flag'])) {
             $output[$row['uid']]['flagIcon'] = $row['flag'];
         }
         if ($onlyIsoCoded && !$output[$row['uid']]['ISOcode']) {
             unset($output[$row['uid']]);
         }
     }
     return $output;
 }
コード例 #22
0
	/**
	 * MAIN function for cache information
	 *
	 * @return	string		Output HTML for the module.
	 */
	function main()	{
		global $BACK_PATH,$LANG,$SOBE;

		if ($this->pObj->id)	{
			$theOutput = '';

				// Depth selector:
			$h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[type]',$this->pObj->MOD_SETTINGS['type'],$this->pObj->MOD_MENU['type'],'index.php').'<br/>';
			if (!t3lib_div::inList('uniqalias,log,redirects', $this->pObj->MOD_SETTINGS['type']))	{
				$h_func.= t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[depth]',$this->pObj->MOD_SETTINGS['depth'],$this->pObj->MOD_MENU['depth'],'index.php');
			}
			$theOutput.= $h_func;

			if ($this->pObj->MOD_SETTINGS['type']!='uniqalias')	{
					// Showing the tree:
					// Initialize starting point of page tree:
				$treeStartingPoint = intval($this->pObj->id);
				$treeStartingRecord = t3lib_BEfunc::getRecord('pages', $treeStartingPoint);
				t3lib_BEfunc::workspaceOL('pages',$treeStartingRecord);
				$depth = $this->pObj->MOD_SETTINGS['depth'];

					// Initialize tree object:
				$tree = t3lib_div::makeInstance('t3lib_pageTree');
				$tree->addField('nav_title',1);
				$tree->addField('alias',1);
				$tree->addField('tx_realurl_pathsegment',1);
				$tree->init('AND '.$GLOBALS['BE_USER']->getPagePermsClause(1));

					// Creating top icon; the current page
				$HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'],'align="top"');
				$tree->tree[] = array(
					'row' => $treeStartingRecord,
					'HTML' => $HTML
				);

					// Create the tree from starting point:
				if ($depth>0)	{
					$tree->getTree($treeStartingPoint, $depth, '');
				}
			}

				// Add CSS needed:
			$this->pObj->content = str_replace('/*###POSTCSSMARKER###*/','
				TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; }
				TABLE#tx-realurl-pathcacheTable TD { vertical-align: top; }
			',$this->pObj->content);


				// Branching:
			switch($this->pObj->MOD_SETTINGS['type'])	{
				case 'pathcache':

						// Save editing if any:
					$this->edit_save();

						// Render information table:
					$treeHTML = $this->renderModule($tree);

						// Render Search Form:
					$theOutput.= $this->renderSearchForm();

						// Add tree table:
					$theOutput.= $treeHTML;
				break;
				case 'encode':
					$theOutput.= $this->encodeView($tree);
				break;
				case 'decode':
					$theOutput.= $this->decodeView($tree);
				break;
				case 'uniqalias':
					$this->edit_save_uniqAlias();
					$theOutput.= $this->uniqueAlias();
				break;
				case 'config':
					$theOutput.= $this->configView();
				break;
				case 'redirects':
					$theOutput.= $this->redirectView();
				break;
				case 'log':
					$theOutput.= $this->logView();
				break;
			}
		}

		return $theOutput;
	}
コード例 #23
0
    /**
     * Main function creating the content for the module.
     *
     * @return	string		HTML content for the module, actually a "section" made through the parent object in $this->pObj
     */
    function main()
    {
        global $SOBE, $LANG;
        $theCode = '';
        $m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(8);
        // create new pages here?
        $pRec = t3lib_BEfunc::getRecord('pages', $this->pObj->id, 'uid', ' AND ' . $m_perms_clause);
        $sys_pages = t3lib_div::makeInstance('t3lib_pageSelect');
        $menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', 0);
        if (is_array($pRec)) {
            $data = t3lib_div::_GP('data');
            if (is_array($data['pages'])) {
                if (t3lib_div::_GP('createInListEnd')) {
                    $endI = end($menuItems);
                    $thePid = -intval($endI['uid']);
                    if (!$thePid) {
                        $thePid = $this->pObj->id;
                    }
                } else {
                    $thePid = $this->pObj->id;
                }
                $firstRecord = true;
                foreach ($data['pages'] as $identifier => $dat) {
                    if (!trim($dat['title'])) {
                        unset($data['pages'][$identifier]);
                    } else {
                        $data['pages'][$identifier]['hidden'] = t3lib_div::_GP('hidePages') ? 1 : 0;
                        if ($firstRecord) {
                            $firstRecord = false;
                            $data['pages'][$identifier]['pid'] = $thePid;
                        } else {
                            $data['pages'][$identifier]['pid'] = '-' . $previousIdentifier;
                        }
                        $previousIdentifier = $identifier;
                    }
                }
                if (count($data['pages'])) {
                    reset($data);
                    $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                    $tce->stripslashes_values = 0;
                    // set default TCA values specific for the user
                    $TCAdefaultOverride = $GLOBALS['BE_USER']->getTSConfigProp('TCAdefaults');
                    if (is_array($TCAdefaultOverride)) {
                        $tce->setDefaultsFromUserTS($TCAdefaultOverride);
                    }
                    $tce->start($data, array());
                    $tce->process_datamap();
                    t3lib_BEfunc::setUpdateSignal('updatePageTree');
                    $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', '', $GLOBALS['LANG']->getLL('wiz_newPages_create'));
                } else {
                    $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', '', $GLOBALS['LANG']->getLL('wiz_newPages_noCreate'), t3lib_FlashMessage::ERROR);
                }
                $theCode .= $flashMessage->render();
                // Display result:
                $menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', 0);
                $lines = array();
                foreach ($menuItems as $rec) {
                    t3lib_BEfunc::workspaceOL('pages', $rec);
                    if (is_array($rec)) {
                        $lines[] = '<nobr>' . t3lib_iconWorks::getSpriteIconForRecord('pages', $rec, array('title' => t3lib_BEfunc::titleAttribForPages($rec, '', FALSE))) . htmlspecialchars(t3lib_div::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</nobr>';
                    }
                }
                $theCode .= '<h4>' . $LANG->getLL('wiz_newPages_currentMenu') . '</h4>' . implode('<br />', $lines);
            } else {
                // Create loremIpsum code:
                if (t3lib_extMgm::isLoaded('lorem_ipsum')) {
                    $loremIpsumObj = t3lib_div::getUserObj('EXT:lorem_ipsum/class.tx_loremipsum_wiz.php:tx_loremipsum_wiz');
                }
                // Display create form
                $lines = array();
                for ($a = 0; $a < 9; $a++) {
                    $lines[] = '<label for="page_new_' . $a . '"> ' . $LANG->getLL('wiz_newPages_page') . ' ' . ($a + 1) . ':&nbsp;</label><input type="text" id="page_new_' . $a . '" name="data[pages][NEW' . $a . '][title]"' . $this->pObj->doc->formWidth(35) . ' />' . (is_object($loremIpsumObj) ? '<a href="#" onclick="' . htmlspecialchars($loremIpsumObj->getHeaderTitleJS('document.forms[0][\'data[pages][NEW' . $a . '][title]\'].value', 'title')) . '">' . $loremIpsumObj->getIcon('', $this->pObj->doc->backPath) . '</a>' : '');
                }
                $theCode .= '<h4>' . $LANG->getLL('wiz_newPages') . ':</h4>' . implode('<br />', $lines) . '<br /><br />
				<input type="checkbox" name="createInListEnd" id="createInListEnd" value="1" /> <label for="createInListEnd">' . $LANG->getLL('wiz_newPages_listEnd') . '</label><br />
				<input type="checkbox" name="hidePages" id="hidePages" value="1" /> <label for="hidePages">' . $LANG->getLL('wiz_newPages_hidePages') . '</label><br /><br />
				<input type="submit" name="create" value="' . $LANG->getLL('wiz_newPages_lCreate') . '" onclick="return confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('wiz_newPages_lCreate_msg1')) . ')" />&nbsp;<input type="reset" value="' . $LANG->getLL('wiz_newPages_lReset') . '" /><br />';
            }
        } else {
            $theCode .= $GLOBALS['TBE_TEMPLATE']->rfw($LANG->getLL('wiz_newPages_errorMsg1'));
        }
        // CSH
        $theCode .= t3lib_BEfunc::cshItem('_MOD_web_func', 'tx_wizardcrpages', $GLOBALS['BACK_PATH'], '<br />|');
        $out = $this->pObj->doc->section($LANG->getLL('wiz_crMany'), $theCode, 0, 1);
        return $out;
    }
コード例 #24
0
 /**
  * Determine whether this page for the current
  *
  * @param  $pageUid
  * @param  $workspaceUid
  * @return void
  */
 public function canCreatePreviewLink($pageUid, $workspaceUid)
 {
     $result = TRUE;
     if ($pageUid > 0 && $workspaceUid > 0) {
         $pageRecord = t3lib_BEfunc::getRecord('pages', $pageUid);
         t3lib_BEfunc::workspaceOL('pages', $pageRecord, $workspaceUid);
         if (!t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'], $pageRecord['doktype'])) {
             $result = FALSE;
         }
     } else {
         $result = FALSE;
     }
     return $result;
 }
コード例 #25
0
ファイル: index.php プロジェクト: NaveedWebdeveloper/Test
    /**
     * 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;
            }
            $this->content .= $this->doc->section('Data Structure Object', $content, 0, 1);
        } else {
            $this->content .= $this->doc->section('Data Structure Object ERROR', 'No UID was found pointing to a Data Structure Object record.', 0, 1, 3);
        }
    }
コード例 #26
0
 /**
  * [Describe function...]
  *
  * @param	[type]		$id: ...
  * @return	[type]		...
  */
 function ext_getAllTemplates($id)
 {
     // Query is taken from the runThroughTemplates($theRootLine) function in the parent class.
     if (intval($id)) {
         $outRes = array();
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_template', 'pid=' . intval($id) . ' ' . $this->whereClause, '', 'sorting');
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             t3lib_BEfunc::workspaceOL('sys_template', $row);
             if (is_array($row)) {
                 $outRes[] = $row;
             }
         }
         $GLOBALS['TYPO3_DB']->sql_free_result($res);
         return $outRes;
         // Returns the template rows in an array.
     }
 }
コード例 #27
0
	/**
	 * Initializes the page tree.
	 *
	 * @return t3lib_pageTree
	 */
	protected function initializeTree() {
		$tree = t3lib_div::makeInstance('t3lib_pageTree');
		/** @var t3lib_pageTree $tree */
		$tree->addField('nav_title', true);
		$tree->addField('alias', true);
		$tree->addField('tx_realurl_pathsegment', true);
		$tree->init('AND '.$GLOBALS['BE_USER']->getPagePermsClause(1));

		$treeStartingPoint = intval($this->pObj->id);
		$treeStartingRecord = t3lib_BEfunc::getRecord('pages', $treeStartingPoint);
		t3lib_BEfunc::workspaceOL('pages',$treeStartingRecord);

			// Creating top icon; the current page
		$tree->tree[] = array(
			'row' => $treeStartingRecord,
			'HTML' => t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align="top"')
		);

			// Create the tree from starting point:
		if ($this->pObj->MOD_SETTINGS['depth'] > 0) {
			$tree->getTree($treeStartingPoint, $this->pObj->MOD_SETTINGS['depth'], '');
		}
		return $tree;
	}
コード例 #28
0
 /**
  * Creates HTML for inserting/moving content elements.
  *
  * @param	integer		page id onto which to insert content element.
  * @param	integer		Move-uid (tt_content element uid?)
  * @param	string		List of columns to show
  * @param	boolean		If not set, then hidden/starttime/endtime records are filtered out.
  * @param	string		Request URI
  * @return	string		HTML
  */
 function printContentElementColumns($pid, $moveUid, $colPosList, $showHidden, $R_URI)
 {
     $this->R_URI = $R_URI;
     $this->moveUid = $moveUid;
     $colPosArray = t3lib_div::trimExplode(',', $colPosList, 1);
     $lines = array();
     foreach ($colPosArray as $kk => $vv) {
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . intval($pid) . ($showHidden ? '' : t3lib_BEfunc::BEenableFields('tt_content')) . ' AND colPos=' . intval($vv) . (strcmp($this->cur_sys_language, '') ? ' AND sys_language_uid=' . intval($this->cur_sys_language) : '') . t3lib_BEfunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'sorting');
         $lines[$kk] = array();
         $lines[$kk][] = $this->insertPositionIcon('', $vv, $kk, $moveUid, $pid);
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             t3lib_BEfunc::workspaceOL('tt_content', $row);
             if (is_array($row)) {
                 $lines[$kk][] = $this->wrapRecordHeader($this->getRecordHeader($row), $row);
                 $lines[$kk][] = $this->insertPositionIcon($row, $vv, $kk, $moveUid, $pid);
             }
         }
         $GLOBALS['TYPO3_DB']->sql_free_result($res);
     }
     return $this->printRecordMap($lines, $colPosArray);
 }
コード例 #29
0
 /**
  * If "editPage" value is sent to script and it points to an accessible page, the internal var $this->theEditRec is set to the page record which should be loaded.
  * Returns void
  *
  * @return	void
  */
 function editPageIdFunc()
 {
     global $BE_USER, $LANG;
     if (!t3lib_extMgm::isLoaded('cms')) {
         return;
     }
     // EDIT page:
     $this->editPage = trim($LANG->csConvObj->conv_case($LANG->charSet, $this->editPage, 'toLower'));
     $this->editError = '';
     $this->theEditRec = '';
     $this->searchFor = '';
     if ($this->editPage) {
         // First, test alternative value consisting of [table]:[uid] and if not found, proceed with traditional page ID resolve:
         $this->alternativeTableUid = explode(':', $this->editPage);
         if (!(count($this->alternativeTableUid) == 2 && $BE_USER->isAdmin())) {
             // We restrict it to admins only just because I'm not really sure if alt_doc.php properly checks permissions of passed records for editing. If alt_doc.php does that, then we can remove this.
             $where = ' AND (' . $BE_USER->getPagePermsClause(2) . ' OR ' . $BE_USER->getPagePermsClause(16) . ')';
             if (t3lib_div::testInt($this->editPage)) {
                 $this->theEditRec = t3lib_BEfunc::getRecordWSOL('pages', $this->editPage, '*', $where);
             } else {
                 $records = t3lib_BEfunc::getRecordsByField('pages', 'alias', $this->editPage, $where);
                 if (is_array($records)) {
                     reset($records);
                     $this->theEditRec = current($records);
                     t3lib_BEfunc::workspaceOL('pages', $this->theEditRec);
                 }
             }
             if (!is_array($this->theEditRec)) {
                 unset($this->theEditRec);
                 $this->searchFor = $this->editPage;
             } elseif (!$BE_USER->isInWebMount($this->theEditRec['uid'])) {
                 unset($this->theEditRec);
                 $this->editError = $LANG->getLL('shortcut_notEditable');
             } else {
                 // Visual path set:
                 $perms_clause = $BE_USER->getPagePermsClause(1);
                 $this->editPath = t3lib_BEfunc::getRecordPath($this->theEditRec['pid'], $perms_clause, 30);
                 if (!$BE_USER->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree')) {
                     // Expanding page tree:
                     t3lib_BEfunc::openPageTree($this->theEditRec['pid'], !$BE_USER->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded'));
                 }
             }
         }
     }
 }
 /**
  * Returns ready initialised "element" object. Depending on the element the correct element class is used. (e.g. page/content/fce)
  *
  * @param $table	table
  * @param $uid	identifier
  * @param $overlay_ids boolean parameter to overlay uids if the user is in workspace context
  *
  * @throws Unknown_Element_Exception
  **/
 function getElementForTable($table, $uid, $overlay_ids = true)
 {
     if (!is_numeric($uid)) {
         //no uid => maybe NEW element in BE
         $row = array();
     } else {
         /***
          ** WORKSPACE NOTE
          * the diffrent usecases has to be defined and checked..
          **/
         if (is_object($GLOBALS['BE_USER']) && $GLOBALS['BE_USER']->workspace != 0 && $overlay_ids) {
             $row = $this->dao->getRecord($uid, $table);
             if (is_object($GLOBALS['TSFE'])) {
                 $GLOBALS['TSFE']->sys_page->versionOL($table, $row);
             } else {
                 t3lib_BEfunc::workspaceOL($table, $row);
             }
         } else {
             $row = $this->dao->getRecord($uid, $table);
         }
     }
     //@todo isSupported table
     /* @var $element tx_languagevisibility_element */
     switch ($table) {
         case 'pages':
             if (version_compare(TYPO3_version, '4.3.0', '<')) {
                 require_once t3lib_extMgm::extPath("languagevisibility") . 'classes/class.tx_languagevisibility_pageelement.php';
                 $elementclass = t3lib_div::makeInstanceClassName('tx_languagevisibility_pageelement');
                 $element = new $elementclass($row);
             } else {
                 $element = t3lib_div::makeInstance('tx_languagevisibility_pageelement', $row);
             }
             break;
         case 'tt_news':
             if (version_compare(TYPO3_version, '4.3.0', '<')) {
                 require_once t3lib_extMgm::extPath("languagevisibility") . 'classes/class.tx_languagevisibility_ttnewselement.php';
                 $elementclass = t3lib_div::makeInstanceClassName('tx_languagevisibility_ttnewselement');
                 $element = new $elementclass($row);
             } else {
                 $element = t3lib_div::makeInstance('tx_languagevisibility_ttnewselement', $row);
             }
             break;
         case 'tt_content':
             if ($row['CType'] == 'templavoila_pi1') {
                 //read DS:
                 $srcPointer = $row['tx_templavoila_ds'];
                 $DS = $this->_getTVDS($srcPointer);
                 if (is_array($DS)) {
                     if ($DS['meta']['langDisable'] == 1 && $DS['meta']['langDatabaseOverlay'] == 1) {
                         //handle as special FCE with normal tt_content overlay:
                         if (version_compare(TYPO3_version, '4.3.0', '<')) {
                             require_once t3lib_extMgm::extPath("languagevisibility") . 'classes/class.tx_languagevisibility_fceoverlayelement.php';
                             $elementclass = t3lib_div::makeInstanceClassName('tx_languagevisibility_fceoverlayelement');
                             $element = new $elementclass($row);
                         } else {
                             $element = t3lib_div::makeInstance('tx_languagevisibility_fceoverlayelement', $row);
                         }
                     } else {
                         if (version_compare(TYPO3_version, '4.3.0', '<')) {
                             require_once t3lib_extMgm::extPath("languagevisibility") . 'classes/class.tx_languagevisibility_fceelement.php';
                             $elementclass = t3lib_div::makeInstanceClassName('tx_languagevisibility_fceelement');
                             $element = new $elementclass($row, $DS);
                         } else {
                             $element = t3lib_div::makeInstance('tx_languagevisibility_fceelement', $row, $DS);
                         }
                     }
                 } else {
                     throw new UnexpectedValueException($table . ' uid:' . $row['uid'] . ' has no valid Datastructure ', 1195039394);
                 }
             } else {
                 if (version_compare(TYPO3_version, '4.3.0', '<')) {
                     require_once t3lib_extMgm::extPath("languagevisibility") . 'classes/class.tx_languagevisibility_celement.php';
                     $elementclass = t3lib_div::makeInstanceClassName('tx_languagevisibility_celement');
                     $element = new $elementclass($row);
                 } else {
                     $element = t3lib_div::makeInstance('tx_languagevisibility_celement', $row);
                 }
             }
             break;
         default:
             if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['languagevisibility']['getElementForTable'][$table])) {
                 $hookObj = t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['languagevisibility']['getElementForTable'][$table]);
                 if (method_exists($hookObj, 'getElementForTable')) {
                     $element = $hookObj->getElementForTable($table, $uid, $row, $overlay_ids);
                 }
             } elseif (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['languagevisibility']['recordElementSupportedTables'][$table])) {
                 $element = $this->getElementInstance('tx_languagevisibility_recordelement', $row);
             } else {
                 throw new UnexpectedValueException($table . ' not supported ', 1195039394);
             }
             break;
     }
     $element->setTable($table);
     return $element;
 }