本文整理汇总了PHP中t3lib_BEfunc::BEenableFields方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::BEenableFields方法的具体用法?PHP t3lib_BEfunc::BEenableFields怎么用?PHP t3lib_BEfunc::BEenableFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_BEfunc
的用法示例。
在下文中一共展示了t3lib_BEfunc::BEenableFields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initializes the Module
* @return void
*/
function init()
{
/*{{{*/
global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
parent::init();
$this->enableFields_tickets = t3lib_BEfunc::deleteClause($this->tickets_table) . t3lib_BEfunc::BEenableFields($this->tickets_table);
$this->enableFields_fe_users = t3lib_BEfunc::deleteClause($this->users_table) . t3lib_BEfunc::BEenableFields($this->users_table);
$this->enableFields_category = t3lib_BEfunc::deleteClause($this->category_table) . t3lib_BEfunc::BEenableFields($this->category_table);
$this->enableFields_address = t3lib_BEfunc::deleteClause($this->address_table) . t3lib_BEfunc::BEenableFields($this->address_table);
$this->enableFields_pages = t3lib_BEfunc::deleteClause($this->pages_table) . t3lib_BEfunc::BEenableFields($this->pages_table);
$this->lib = t3lib_div::makeInstance('tx_ketroubletickets_lib');
// get the page ts config
$this->pageTSConfig = t3lib_BEfunc::getPagesTSconfig($this->id);
/*
if (t3lib_div::_GP('clear_all_cache')) {
$this->include_once[] = PATH_t3lib.'class.t3lib_tcemain.php';
}
*/
}
示例2: getRecordOverlay
/**
* Import from t3lib_page in order to eate backend version
* Creates language-overlay for records in general (where translation is found in records from the same table)
*
* @param string $table: Table name
* @param array $row: Record to overlay. Must containt uid, pid and $table]['ctrl']['languageField']
* @param integer $sys_language_content: Pointer to the sys_language uid for content on the site.
* @param string $OLmode: Overlay mode. If "hideNonTranslated" then records without translation will not be returned un-translated but unset (and return value is false)
* @return mixed Returns the input record, possibly overlaid with a translation. But if $OLmode is "hideNonTranslated" then it will return false if no translation is found.
*/
function getRecordOverlay($table, $row, $sys_language_content, $OLmode = '')
{
global $TCA, $TYPO3_DB;
if ($row['uid'] > 0 && $row['pid'] > 0) {
if ($TCA[$table] && $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField']) {
if (!$TCA[$table]['ctrl']['transOrigPointerTable']) {
// Will try to overlay a record only if the sys_language_content value is larger that zero.
if ($sys_language_content > 0) {
// Must be default language or [All], otherwise no overlaying:
if ($row[$TCA[$table]['ctrl']['languageField']] <= 0) {
// Select overlay record:
$res = $TYPO3_DB->exec_SELECTquery('*', $table, 'pid=' . intval($row['pid']) . ' AND ' . $TCA[$table]['ctrl']['languageField'] . '=' . intval($sys_language_content) . ' AND ' . $TCA[$table]['ctrl']['transOrigPointerField'] . '=' . intval($row['uid']) . t3lib_BEfunc::BEenableFields($table) . t3lib_BEfunc::deleteClause($table), '', '', '1');
$olrow = $TYPO3_DB->sql_fetch_assoc($res);
// Merge record content by traversing all fields:
if (is_array($olrow)) {
foreach ($row as $fN => $fV) {
if ($fN != 'uid' && $fN != 'pid' && isset($olrow[$fN])) {
if ($TCA[$table]['l10n_mode'][$fN] != 'exclude' && ($TCA[$table]['l10n_mode'][$fN] != 'mergeIfNotBlank' || strcmp(trim($olrow[$fN]), ''))) {
$row[$fN] = $olrow[$fN];
}
}
}
} elseif ($OLmode === 'hideNonTranslated' && $row[$TCA[$table]['ctrl']['languageField']] == 0) {
// Unset, if non-translated records should be hidden. ONLY done if the source record really is default language and not [All] in which case it is allowed.
unset($row);
}
// Otherwise, check if sys_language_content is different from the value of the record - that means a japanese site might try to display french content.
} elseif ($sys_language_content != $row[$TCA[$table]['ctrl']['languageField']]) {
unset($row);
}
} else {
// When default language is displayed, we never want to return a record carrying another language!:
if ($row[$TCA[$table]['ctrl']['languageField']] > 0) {
unset($row);
}
}
}
}
}
return $row;
}
示例3: checkCliUser
/**
* Make sure a backend user exists and is configured properly.
*
* @access protected
*
* @param boolean $checkOnly: Just check the user or change it, too?
* @param integer $groupUid: UID of the corresponding usergroup
*
* @return integer UID of user or 0 if something is wrong
*/
protected function checkCliUser($checkOnly, $groupUid)
{
// Set default return value.
$usrUid = 0;
// Check if user "_cli_dlf" exists, is no admin and is not disabled.
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,admin,usergroup', 'be_users', 'username=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_users') . t3lib_BEfunc::deleteClause('be_users'));
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
// Explode comma-separated list.
$resArray['usergroup'] = explode(',', $resArray['usergroup']);
// Check if user is not disabled.
$result2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('1', 'be_users', 'uid=' . intval($resArray['uid']) . t3lib_BEfunc::BEenableFields('be_users'));
// Check if user is configured properly.
if (count(array_diff(array($groupUid), $resArray['usergroup'])) == 0 && !$resArray['admin'] && $GLOBALS['TYPO3_DB']->sql_num_rows($result2) > 0) {
$usrUid = $resArray['uid'];
$message = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('cliUserGroup.usrOkayMsg'), $GLOBALS['LANG']->getLL('cliUserGroup.usrOkay'), t3lib_FlashMessage::OK, FALSE);
} else {
if (!$checkOnly && $groupUid) {
// Keep exisiting values and add the new ones.
$usergroup = array_unique(array_merge(array($groupUid), $resArray['usergroup']));
// Try to configure user.
$data['be_users'][$resArray['uid']] = array('admin' => 0, 'usergroup' => implode(',', $usergroup), $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['disabled'] => 0, $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['starttime'] => 0, $GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['endtime'] => 0);
tx_dlf_helper::processDBasAdmin($data);
// Check if configuration was successful.
if ($this->checkCliUser(TRUE, $groupUid)) {
$usrUid = $resArray['uid'];
$message = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('cliUserGroup.usrConfiguredMsg'), $GLOBALS['LANG']->getLL('cliUserGroup.usrConfigured'), t3lib_FlashMessage::INFO, FALSE);
} else {
$message = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'), $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'), t3lib_FlashMessage::ERROR, FALSE);
}
} else {
$message = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'), $GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'), t3lib_FlashMessage::ERROR, FALSE);
}
}
} else {
if (!$checkOnly && $groupUid) {
// Try to create user.
$tempUid = uniqid('NEW');
$data['be_users'][$tempUid] = array('pid' => 0, 'username' => '_cli_dlf', 'password' => md5($tempUid), 'realName' => $GLOBALS['LANG']->getLL('cliUserGroup.usrRealName'), 'usergroup' => intval($groupUid));
$substUid = tx_dlf_helper::processDBasAdmin($data);
// Check if creation was successful.
if (!empty($substUid[$tempUid])) {
$usrUid = $substUid[$tempUid];
$message = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('cliUserGroup.usrCreatedMsg'), $GLOBALS['LANG']->getLL('cliUserGroup.usrCreated'), t3lib_FlashMessage::INFO, FALSE);
} else {
$message = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'), $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'), t3lib_FlashMessage::ERROR, FALSE);
}
} else {
$message = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'), $GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'), t3lib_FlashMessage::ERROR, FALSE);
}
}
$this->content = $message->render();
return $usrUid;
}
示例4: simulateUser
/**
* Will make the simulate-user selector if the logged in user is administrator.
* It will also set the GLOBAL(!) BE_USER to the simulated user selected if any (and set $this->OLD_BE_USER to logged in user)
*
* @return void
*/
public function simulateUser()
{
global $BE_USER, $LANG, $BACK_PATH;
// *******************************************************************************
// If admin, allow simulation of another user
// *******************************************************************************
$this->simUser = 0;
$this->simulateSelector = '';
unset($this->OLD_BE_USER);
if ($BE_USER->isAdmin()) {
$this->simUser = intval(t3lib_div::_GP('simUser'));
// Make user-selector:
$users = t3lib_BEfunc::getUserNames('username,usergroup,usergroup_cached_list,uid,realName', t3lib_BEfunc::BEenableFields('be_users'));
$opt = array();
foreach ($users as $rr) {
if ($rr['uid'] != $BE_USER->user['uid']) {
$opt[] = '<option value="' . $rr['uid'] . '"' . ($this->simUser == $rr['uid'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($rr['username'] . ' (' . $rr['realName'] . ')') . '</option>';
}
}
if (count($opt)) {
$this->simulateSelector = '<select id="field_simulate" name="simulateUser" onchange="window.location.href=\'index.php?simUser=\'+this.options[this.selectedIndex].value;"><option></option>' . implode('', $opt) . '</select>';
}
}
if ($this->simUser > 0) {
// This can only be set if the previous code was executed.
$this->OLD_BE_USER = $BE_USER;
// Save old user...
unset($BE_USER);
// Unset current
$BE_USER = t3lib_div::makeInstance('t3lib_beUserAuth');
// New backend user object
$BE_USER->OS = TYPO3_OS;
$BE_USER->setBeUserByUid($this->simUser);
$BE_USER->fetchGroupData();
$BE_USER->backendSetUC();
$GLOBALS['BE_USER'] = $BE_USER;
// Must do this, because unsetting $BE_USER before apparently unsets the reference to the global variable by this name!
}
}
示例5: getDsRecords
/**
*
* @param array $conf
*/
protected function getDsRecords($conf) {
$updateMessage = '';
$writeDsIds = array();
$writeIds = t3lib_div::_GP('staticDSwizard');
$options = t3lib_div::_GP('staticDSwizardoptions');
$checkAll = t3lib_div::_GP('sdw-checkall');
if (count($writeIds)) {
$writeDsIds = array_keys($writeIds);
}
$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'*',
'tx_templavoila_datastructure',
'deleted=0',
'',
'scope, title'
);
$out = '<table id="staticDSwizard_getdsrecords"><thead>
<tr class="bgColor5">
<td style="vertical-align:middle;">' . $GLOBALS['LANG']->sL('LLL:EXT:templavoila/res1/language/template_conf.xml:staticDS.wizard.uid') . '</td>
<td style="vertical-align:middle;">' . $GLOBALS['LANG']->sL('LLL:EXT:templavoila/res1/language/template_conf.xml:staticDS.wizard.pid') . '</td>
<td style="vertical-align:middle;">' . $GLOBALS['LANG']->sL('LLL:EXT:templavoila/res1/language/template_conf.xml:staticDS.wizard.title') . '</td>
<td style="vertical-align:middle;">' . $GLOBALS['LANG']->sL('LLL:EXT:templavoila/res1/language/template_conf.xml:staticDS.wizard.scope') . '</td>
<td style="vertical-align:middle;">' . $GLOBALS['LANG']->sL('LLL:EXT:templavoila/res1/language/template_conf.xml:staticDS.wizard.usage') . '</td>
<td>
<label for="sdw-checkall">' . $GLOBALS['LANG']->sL('LLL:EXT:templavoila/res1/language/template_conf.xml:staticDS.wizard.selectall') . '</label>
<input type="checkbox" class="checkbox" id="sdw-checkall" name="sdw-checkall" onclick="$$(\'.staticDScheck\').each(function(e){e.checked=$(\'sdw-checkall\').checked;});" value="1" ' . ($checkAll
? 'checked="checked"' : '') . ' /></td>
</tr></thead><tbody>';
foreach ($rows as $row) {
$dirPath = t3lib_div::getFileAbsFileName($row['scope'] == 2 ? $conf['path_fce'] : $conf['path_page']);
$dirPath = $dirPath . (substr($dirPath, -1) == '/' ? '' : '/');
$title = preg_replace('|[/,\."\']+|', '_', $row['title']);
$path = $dirPath . $title . ' (' . ($row['scope'] == 1 ? 'page' : 'fce') . ').xml';
$outPath = substr($path, strlen(PATH_site));
$usage = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'count(*)',
'tx_templavoila_tmplobj',
'datastructure=' . (int)$row['uid'] . t3lib_BEfunc::BEenableFields('tx_templavoila_tmplobj')
);
if (count($writeDsIds) && in_array($row['uid'], $writeDsIds)) {
t3lib_div::writeFile($path, $row['dataprot']);
if ($row['previewicon']) {
copy(t3lib_div::getFileAbsFileName('uploads/tx_templavoila/' . $row['previewicon']), $dirPath . $title . ' (' . ($row['scope'] == 1
? 'page' : 'fce') . ').gif');
}
if ($options['updateRecords']) {
// remove DS records
$GLOBALS['TYPO3_DB']->exec_UPDATEquery(
'tx_templavoila_datastructure',
'uid="' . $row['uid'] . '"',
array('deleted' => 1)
);
// update TO records
$GLOBALS['TYPO3_DB']->exec_UPDATEquery(
'tx_templavoila_tmplobj',
'datastructure="' . $row['uid'] . '"',
array('datastructure' => $outPath)
);
// update page records
$GLOBALS['TYPO3_DB']->exec_UPDATEquery(
'pages',
'tx_templavoila_ds="' . $row['uid'] . '"',
array('tx_templavoila_ds' => $outPath)
);
$GLOBALS['TYPO3_DB']->exec_UPDATEquery(
'pages',
'tx_templavoila_next_ds="' . $row['uid'] . '"',
array('tx_templavoila_next_ds' => $outPath)
);
// update tt_content records
$GLOBALS['TYPO3_DB']->exec_UPDATEquery(
'tt_content',
'tx_templavoila_ds="' . $row['uid'] . '"',
array('tx_templavoila_ds' => $outPath)
);
// delete DS records
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_templavoila_datastructure', 'uid=' . $row['uid'], array('deleted' => 1));
$updateMessage = $GLOBALS['LANG']->sL('LLL:EXT:templavoila/res1/language/template_conf.xml:staticDS.wizard.updated');
$this->step = 3;
}
}
$out .= '<tr class="bgColor' . ($row['scope'] == 1 ? 3 : 6) . '">
<td style="text-align: center;padding: 0,3px;">' . $row['uid'] . '</td>
<td style="text-align: center;padding: 0,3px;">' . $row['pid'] . '</td>
<td style="padding: 0,3px;">' . htmlspecialchars($row['title']) . '</td>
<td style="padding: 0,3px;">' . ($row['scope'] == 1 ? 'Page' : 'FCE') . '</td>
<td style="text-align: center;padding: 0,3px;">' . $usage[0]['count(*)'] . '</td>';
if (count($writeDsIds) && in_array($row['uid'], $writeDsIds)) {
$out .= '<td class="nobr" style="text-align: right;padding: 0,3px;">written to "' . $outPath . '"</td>';
} else {
$out .= '<td class="nobr" style="text-align: right;padding: 0,3px;"><input type="checkbox" class="checkbox staticDScheck" name="staticDSwizard[' . $row['uid'] . ']" value="1" /></td>';
}
//.........这里部分代码省略.........
示例6: getLanguages
/**
* Getting all languages into an array
* where the key is the ISO alpha-2 code of the language
* and where the value are the name of the language in the current language
* Note: we exclude sacred and constructed languages
*
* @return array An array of names of languages
*/
function getLanguages()
{
$where = '1=1';
$table = 'static_languages';
$lang = tx_staticinfotables_div::getCurrentLanguage();
$nameArray = array();
$titleFields = tx_staticinfotables_div::getTCAlabelField($table, TRUE, $lang);
$prefixedTitleFields = array();
foreach ($titleFields as $titleField) {
$prefixedTitleFields[] = $table . '.' . $titleField;
}
$labelFields = implode(',', $prefixedTitleFields);
// Restrict to certain languages
if (is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['language.']) && isset($this->thisConfig['buttons.']['language.']['restrictToItems'])) {
$languageList = implode("','", t3lib_div::trimExplode(',', $GLOBALS['TYPO3_DB']->fullQuoteStr(strtoupper($this->thisConfig['buttons.']['language.']['restrictToItems']), $table)));
$where .= ' AND ' . $table . '.lg_iso_2 IN (' . $languageList . ')';
}
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($table . '.lg_iso_2,' . $table . '.lg_country_iso_2,' . $labelFields, $table, $where . ' AND lg_constructed = 0 ' . ($this->htmlAreaRTE->is_FE() ? $GLOBALS['TSFE']->sys_page->enableFields($table) : t3lib_BEfunc::BEenableFields($table) . t3lib_BEfunc::deleteClause($table)));
$prefixLabelWithCode = !$this->thisConfig['buttons.']['language.']['prefixLabelWithCode'] ? false : true;
$postfixLabelWithCode = !$this->thisConfig['buttons.']['language.']['postfixLabelWithCode'] ? false : true;
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$code = strtolower($row['lg_iso_2']) . ($row['lg_country_iso_2'] ? '-' . strtoupper($row['lg_country_iso_2']) : '');
foreach ($titleFields as $titleField) {
if ($row[$titleField]) {
$nameArray[$code] = $prefixLabelWithCode ? $code . ' - ' . $row[$titleField] : ($postfixLabelWithCode ? $row[$titleField] . ' - ' . $code : $row[$titleField]);
break;
}
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
if ($this->htmlAreaRTE->is_FE()) {
$GLOBALS['TSFE']->csConvObj->convArray($nameArray, $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['static_info_tables']['charset'], $this->htmlAreaRTE->OutputCharset);
} else {
$GLOBALS['LANG']->csConvObj->convArray($nameArray, $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['static_info_tables']['charset'], $GLOBALS['LANG']->charSet);
}
uasort($nameArray, 'strcoll');
return $nameArray;
}
示例7: crawler_execute_type1
/**
* Indexing records from a table
*
* @param array Indexing Configuration Record
* @param array Session data for the indexing session spread over multiple instances of the script. Passed by reference so changes hereto will be saved for the next call!
* @param array Parameters from the log queue.
* @param object Parent object (from "crawler" extension!)
* @return void
*/
function crawler_execute_type1($cfgRec, &$session_data, $params, &$pObj)
{
if ($cfgRec['table2index'] && isset($GLOBALS['TCA'][$cfgRec['table2index']])) {
// Init session data array if not already:
if (!is_array($session_data)) {
$session_data = array('uid' => 0);
}
// Init:
$pid = intval($cfgRec['alternative_source_pid']) ? intval($cfgRec['alternative_source_pid']) : $cfgRec['pid'];
$numberOfRecords = $cfgRec['recordsbatch'] ? t3lib_div::intInRange($cfgRec['recordsbatch'], 1) : 100;
// Get root line:
$rl = $this->getUidRootLineForClosestTemplate($cfgRec['pid']);
// Select
$recs = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', $cfgRec['table2index'], 'pid = ' . intval($pid) . '
AND uid > ' . intval($session_data['uid']) . t3lib_BEfunc::deleteClause($cfgRec['table2index']) . t3lib_BEfunc::BEenableFields($cfgRec['table2index']), '', 'uid', $numberOfRecords);
// Traverse:
if (count($recs)) {
foreach ($recs as $r) {
// Index single record:
$this->indexSingleRecord($r, $cfgRec, $rl);
// Update the UID we last processed:
$session_data['uid'] = $r['uid'];
}
// Finally, set entry for next indexing of batch of records:
$nparams = array('indexConfigUid' => $cfgRec['uid'], 'url' => 'Records from UID#' . ($r['uid'] + 1) . '-?', 'procInstructions' => array('[Index Cfg UID#' . $cfgRec['uid'] . ']'));
$pObj->addQueueEntry_callBack($cfgRec['set_id'], $nparams, $this->callBack, $cfgRec['pid']);
}
}
}
示例8: getTitleStr
/**
* Returns the title for the input record. If blank, a "no title" label (localized) will be returned.
* Do NOT htmlspecialchar the string from this function - has already been done.
*
* @param array The input row array (where the key "title" is used for the title)
* @param integer Title length (30)
* @return string The title.
*/
function getTitleStr($row, $titleLen = 30)
{
// get the basic title from the parent implementation in t3lib_treeview
$title = parent::getTitleStr($row, $titleLen);
if (isset($row['is_siteroot']) && $row['is_siteroot'] != 0 && $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('domainName,sorting', 'sys_domain', 'pid=' . $GLOBALS['TYPO3_DB']->quoteStr($row['uid'] . t3lib_BEfunc::deleteClause('sys_domain') . t3lib_BEfunc::BEenableFields('sys_domain'), 'sys_domain'), '', 'sorting', 1);
if (is_array($rows) && count($rows) > 0) {
$title = sprintf('%s [%s]', $title, htmlspecialchars($rows[0]['domainName']));
}
}
return $title;
}
示例9: printContentElementColumns
/**
* 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);
}
示例10: getSystemNews
/**
* Gets news from sys_news and converts them into a format suitable for
* showing them at the login screen.
*
* @return array An array of login news.
*/
protected function getSystemNews()
{
$systemNewsTable = 'sys_news';
$systemNews = array();
$systemNewsRecords = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('title, content, crdate', $systemNewsTable, '1=1' . t3lib_BEfunc::BEenableFields($systemNewsTable) . t3lib_BEfunc::deleteClause($systemNewsTable), '', 'crdate DESC');
foreach ($systemNewsRecords as $systemNewsRecord) {
$systemNews[] = array('date' => date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $systemNewsRecord['crdate']), 'header' => $systemNewsRecord['title'], 'content' => $systemNewsRecord['content']);
}
return $systemNews;
}
示例11: drawRTE
/**
* Draws the RTE as an iframe
*
* @param object Reference to parent object, which is an instance of the TCEforms.
* @param string The table name
* @param string The field name
* @param array The current row from which field is being rendered
* @param array Array of standard content for rendering form fields from TCEforms. See TCEforms for details on this. Includes for instance the value and the form field name, java script actions and more.
* @param array "special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
* @param array Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
* @param string Record "type" field value.
* @param string Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
* @param integer PID value of record (true parent page id)
* @return string HTML code for RTE!
*/
function drawRTE($parentObject, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue)
{
global $BE_USER, $LANG, $TYPO3_DB, $TYPO3_CONF_VARS;
$this->TCEform = $parentObject;
$inline = $this->TCEform->inline;
$LANG->includeLLFile('EXT:' . $this->ID . '/locallang.xml');
$this->client = $this->clientInfo();
$this->typoVersion = t3lib_div::int_from_ver(TYPO3_version);
$this->userUid = 'BE_' . $BE_USER->user['uid'];
// Draw form element:
if ($this->debugMode) {
// Draws regular text area (debug mode)
$item = parent::drawRTE($this->TCEform, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue);
} else {
// Draw real RTE
/* =======================================
* INIT THE EDITOR-SETTINGS
* =======================================
*/
// Set backPath
$this->backPath = $this->TCEform->backPath;
// Get the path to this extension:
$this->extHttpPath = $this->backPath . t3lib_extMgm::extRelPath($this->ID);
// Get the site URL
$this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL');
// Get the host URL
$this->hostURL = $this->siteURL . TYPO3_mainDir;
// Element ID + pid
$this->elementId = $PA['itemFormElName'];
// Form element name
$this->elementParts = explode('][', preg_replace('/\\]$/', '', preg_replace('/^(TSFE_EDIT\\[data\\]\\[|data\\[)/', '', $this->elementId)));
// Find the page PIDs:
list($this->tscPID, $this->thePid) = t3lib_BEfunc::getTSCpid(trim($this->elementParts[0]), trim($this->elementParts[1]), $thePidValue);
// Record "types" field value:
$this->typeVal = $RTEtypeVal;
// TCA "types" value for record
// Find "thisConfig" for record/editor:
unset($this->RTEsetup);
$this->RTEsetup = $BE_USER->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($this->tscPID));
$this->thisConfig = $thisConfig;
// Special configuration and default extras:
$this->specConf = $specConf;
if ($this->thisConfig['forceHTTPS']) {
$this->extHttpPath = preg_replace('/^(http|https)/', 'https', $this->extHttpPath);
$this->siteURL = preg_replace('/^(http|https)/', 'https', $this->siteURL);
$this->hostURL = preg_replace('/^(http|https)/', 'https', $this->hostURL);
}
/* =======================================
* LANGUAGES & CHARACTER SETS
* =======================================
*/
// Languages: interface and content
$this->language = $LANG->lang;
if ($this->language == 'default' || !$this->language) {
$this->language = 'en';
}
$this->contentTypo3Language = $this->language;
$this->contentISOLanguage = 'en';
$this->contentLanguageUid = $row['sys_language_uid'] > 0 ? $row['sys_language_uid'] : 0;
if (t3lib_extMgm::isLoaded('static_info_tables')) {
if ($this->contentLanguageUid) {
$tableA = 'sys_language';
$tableB = 'static_languages';
$languagesUidsList = $this->contentLanguageUid;
$selectFields = $tableA . '.uid,' . $tableB . '.lg_iso_2,' . $tableB . '.lg_country_iso_2,' . $tableB . '.lg_typo3';
$tableAB = $tableA . ' LEFT JOIN ' . $tableB . ' ON ' . $tableA . '.static_lang_isocode=' . $tableB . '.uid';
$whereClause = $tableA . '.uid IN (' . $languagesUidsList . ') ';
$whereClause .= t3lib_BEfunc::BEenableFields($tableA);
$whereClause .= t3lib_BEfunc::deleteClause($tableA);
$res = $TYPO3_DB->exec_SELECTquery($selectFields, $tableAB, $whereClause);
while ($languageRow = $TYPO3_DB->sql_fetch_assoc($res)) {
$this->contentISOLanguage = strtolower(trim($languageRow['lg_iso_2']) . (trim($languageRow['lg_country_iso_2']) ? '_' . trim($languageRow['lg_country_iso_2']) : ''));
$this->contentTypo3Language = strtolower(trim($languageRow['lg_typo3']));
}
} else {
$this->contentISOLanguage = trim($this->thisConfig['defaultContentLanguage']) ? trim($this->thisConfig['defaultContentLanguage']) : 'en';
$selectFields = 'lg_iso_2, lg_typo3';
$tableAB = 'static_languages';
$whereClause = 'lg_iso_2 = ' . $TYPO3_DB->fullQuoteStr(strtoupper($this->contentISOLanguage), $tableAB);
$res = $TYPO3_DB->exec_SELECTquery($selectFields, $tableAB, $whereClause);
while ($languageRow = $TYPO3_DB->sql_fetch_assoc($res)) {
$this->contentTypo3Language = strtolower(trim($languageRow['lg_typo3']));
}
}
}
//.........这里部分代码省略.........
示例12: getNumberOfHiddenElements
/**
* Returns the number of hidden elements (including those hidden by start/end times) on the current page (for the current sys_language)
*
* @return void
*/
function getNumberOfHiddenElements()
{
return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'tt_content', 'pid=' . intval($this->id) . ' AND sys_language_uid=' . intval($this->current_sys_language) . t3lib_BEfunc::BEenableFields('tt_content', 1) . t3lib_BEfunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'));
}
示例13: checkSchedulerUser
/**
* This method checks the status of the '_cli_scheduler' user
* It will differentiate between a non-existing user and an existing,
* but disabled user (as per enable fields)
*
* @return integer -1 if user doesn't exist
* 0 if user exists, but is disabled
* 1 if user exists and is not disabled
*/
protected function checkSchedulerUser()
{
$schedulerUserStatus = -1;
// Assemble base WHERE clause
$where = 'username = \'_cli_scheduler\' AND admin = 0' . t3lib_BEfunc::deleteClause('be_users');
// Check if user exists at all
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('1', 'be_users', $where);
if ($GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$schedulerUserStatus = 0;
// Check if user exists and is enabled
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('1', 'be_users', $where . t3lib_BEfunc::BEenableFields('be_users'));
if ($GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$schedulerUserStatus = 1;
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
return $schedulerUserStatus;
}
示例14: processCmdmap_preProcess
/**
* This method is called by a hook in the TYPO3 Core Engine (TCEmain) when a command was executed (copy,move,delete...).
* For tt_news it is used to disable saving of the current record if it has an editlock or if it has categories assigned that are not allowed for the current BE user.
*
* @param string $command: The TCEmain command, fx. 'delete'
* @param string $table: The table TCEmain is currently processing
* @param string $id: The records id (if any)
* @param array $value: The new value of the field which has been changed
* @param object $pObj: Reference to the parent object (TCEmain)
* @return void
* @access public
*/
function processCmdmap_preProcess($command, &$table, &$id, $value, &$pObj)
{
if ($table == 'tt_news' && !$GLOBALS['BE_USER']->isAdmin()) {
$rec = t3lib_BEfunc::getRecord($table, $id, 'editlock');
// get record to check if it has an editlock
if ($rec['editlock']) {
$pObj->log($table, $id, 2, 0, 1, "processCmdmap [editlock]: Attempt to " . $command . " a record from table '%s' which is locked by an 'editlock' (= record can only be edited by admins).", 1, array($table));
$error = true;
}
if (is_int($id)) {
// get categories from the (untranslated) record in db
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('tt_news_cat.uid, tt_news_cat.deleted, tt_news_cat_mm.sorting AS mmsorting', 'tt_news', 'tt_news_cat_mm', 'tt_news_cat', ' AND tt_news_cat.deleted=0 AND tt_news_cat_mm.uid_local=' . (is_int($id) ? $id : 0) . t3lib_BEfunc::BEenableFields('tt_news_cat'));
$categories = array();
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$categories[] = $row['uid'];
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$notAllowedItems = array();
if ($categories[0]) {
// original record has no categories
$treeIDs = tx_ttnews_div::getAllowedTreeIDs();
if (count($treeIDs)) {
$allowedItems = $treeIDs;
} else {
$allowedItems = t3lib_div::intExplode(',', $GLOBALS['BE_USER']->getTSConfigVal('tt_newsPerms.tt_news_cat.allowedItems'));
}
foreach ($categories as $k) {
if (!in_array($k, $allowedItems)) {
$notAllowedItems[] = $k;
}
}
}
if ($notAllowedItems[0]) {
$pObj->log($table, $id, 2, 0, 1, "tt_news processCmdmap: Attempt to " . $command . " a record from table '%s' without permission. Reason: the record has one or more categories assigned that are not defined in your BE usergroup (tablename.allowedItems).", 1, array($table));
$error = true;
}
if ($error) {
$table = '';
// unset table to prevent saving
}
}
}
}
示例15: getDomainName
/**
* Returns the first configured domain name for a page
*
* @static
* @param integer $uid
* @return string
*/
public static function getDomainName($uid)
{
$whereClause = $GLOBALS['TYPO3_DB']->quoteStr('pid=' . intval($uid) . t3lib_BEfunc::deleteClause('sys_domain') . t3lib_BEfunc::BEenableFields('sys_domain'), 'sys_domain');
$domain = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('domainName', 'sys_domain', $whereClause, '', 'sorting');
return htmlspecialchars($domain['domainName']);
}