本文整理汇总了PHP中t3lib_BEfunc::getRecordPath方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::getRecordPath方法的具体用法?PHP t3lib_BEfunc::getRecordPath怎么用?PHP t3lib_BEfunc::getRecordPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_BEfunc
的用法示例。
在下文中一共展示了t3lib_BEfunc::getRecordPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notifyStageChange
//.........这里部分代码省略.........
$emails = $this->getEmailsForStageChangeNotification($workspaceRec['adminusers'], TRUE);
$emails = t3lib_div::array_merge($emails, $this->getEmailsForStageChangeNotification($workspaceRec['reviewers']));
$emails = t3lib_div::array_merge($emails, $this->getEmailsForStageChangeNotification($workspaceRec['members']));
break;
}
} else {
$emails = array();
foreach ($notificationAlternativeRecipients as $emailAddress) {
$emails[] = array('email' => $emailAddress);
}
}
// prepare and then send the emails
if (count($emails)) {
// Path to record is found:
list($elementTable, $elementUid) = explode(':', $elementName);
$elementUid = intval($elementUid);
$elementRecord = t3lib_BEfunc::getRecord($elementTable, $elementUid);
$recordTitle = t3lib_BEfunc::getRecordTitle($elementTable, $elementRecord);
if ($elementTable == 'pages') {
$pageUid = $elementUid;
} else {
t3lib_BEfunc::fixVersioningPid($elementTable, $elementRecord);
$pageUid = $elementUid = $elementRecord['pid'];
}
// fetch the TSconfig settings for the email
// old way, options are TCEMAIN.notificationEmail_body/subject
$TCEmainTSConfig = $tcemainObj->getTCEMAIN_TSconfig($pageUid);
// these options are deprecated since TYPO3 4.5, but are still
// used in order to provide backwards compatibility
$emailMessage = trim($TCEmainTSConfig['notificationEmail_body']);
$emailSubject = trim($TCEmainTSConfig['notificationEmail_subject']);
// new way, options are
// pageTSconfig: tx_version.workspaces.stageNotificationEmail.subject
// userTSconfig: page.tx_version.workspaces.stageNotificationEmail.subject
$pageTsConfig = t3lib_BEfunc::getPagesTSconfig($pageUid);
$emailConfig = $pageTsConfig['tx_version.']['workspaces.']['stageNotificationEmail.'];
$markers = array('###RECORD_TITLE###' => $recordTitle, '###RECORD_PATH###' => t3lib_BEfunc::getRecordPath($elementUid, '', 20), '###SITE_NAME###' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'], '###SITE_URL###' => t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir, '###WORKSPACE_TITLE###' => $workspaceRec['title'], '###WORKSPACE_UID###' => $workspaceRec['uid'], '###ELEMENT_NAME###' => $elementName, '###NEXT_STAGE###' => $newStage, '###COMMENT###' => $comment, '###USER_REALNAME###' => $tcemainObj->BE_USER->user['realName'], '###USER_USERNAME###' => $tcemainObj->BE_USER->user['username']);
// sending the emails the old way with sprintf(),
// because it was set explicitly in TSconfig
if ($emailMessage && $emailSubject) {
t3lib_div::deprecationLog('This TYPO3 installation uses Workspaces staging notification by setting the TSconfig options "TCEMAIN.notificationEmail_subject" / "TCEMAIN.notificationEmail_body". Please use the more flexible marker-based options tx_version.workspaces.stageNotificationEmail.message / tx_version.workspaces.stageNotificationEmail.subject');
$emailSubject = sprintf($emailSubject, $elementName);
$emailMessage = sprintf($emailMessage, $markers['###SITE_NAME###'], $markers['###SITE_URL###'], $markers['###WORKSPACE_TITLE###'], $markers['###WORKSPACE_UID###'], $markers['###ELEMENT_NAME###'], $markers['###NEXT_STAGE###'], $markers['###COMMENT###'], $markers['###USER_REALNAME###'], $markers['###USER_USERNAME###'], $markers['###RECORD_PATH###'], $markers['###RECORD_TITLE###']);
// filter out double email addresses
$emailRecipients = array();
foreach ($emails as $recip) {
$emailRecipients[$recip['email']] = $recip['email'];
}
$emailRecipients = implode(',', $emailRecipients);
// Send one email to everybody
t3lib_div::plainMailEncoded($emailRecipients, $emailSubject, $emailMessage);
} else {
// send an email to each individual user, to ensure the
// multilanguage version of the email
$emailHeaders = $emailConfig['additionalHeaders'];
$emailRecipients = array();
// an array of language objects that are needed
// for emails with different languages
$languageObjects = array($GLOBALS['LANG']->lang => $GLOBALS['LANG']);
// loop through each recipient and send the email
foreach ($emails as $recipientData) {
// don't send an email twice
if (isset($emailRecipients[$recipientData['email']])) {
continue;
}
$emailSubject = $emailConfig['subject'];
$emailMessage = $emailConfig['message'];
$emailRecipients[$recipientData['email']] = $recipientData['email'];
// check if the email needs to be localized
// in the users' language
if (t3lib_div::isFirstPartOfStr($emailSubject, 'LLL:') || t3lib_div::isFirstPartOfStr($emailMessage, 'LLL:')) {
$recipientLanguage = $recipientData['lang'] ? $recipientData['lang'] : 'default';
if (!isset($languageObjects[$recipientLanguage])) {
// a LANG object in this language hasn't been
// instantiated yet, so this is done here
/** @var $languageObject language */
$languageObject = t3lib_div::makeInstance('language');
$languageObject->init($recipientLanguage);
$languageObjects[$recipientLanguage] = $languageObject;
} else {
$languageObject = $languageObjects[$recipientLanguage];
}
if (t3lib_div::isFirstPartOfStr($emailSubject, 'LLL:')) {
$emailSubject = $languageObject->sL($emailSubject);
}
if (t3lib_div::isFirstPartOfStr($emailMessage, 'LLL:')) {
$emailMessage = $languageObject->sL($emailMessage);
}
}
$emailSubject = t3lib_parseHtml::substituteMarkerArray($emailSubject, $markers, '', TRUE, TRUE);
$emailMessage = t3lib_parseHtml::substituteMarkerArray($emailMessage, $markers, '', TRUE, TRUE);
// Send an email to the recipient
t3lib_div::plainMailEncoded($recipientData['email'], $emailSubject, $emailMessage, $emailHeaders);
}
$emailRecipients = implode(',', $emailRecipients);
}
$tcemainObj->newlog2('Notification email for stage change was sent to "' . $emailRecipients . '"', $table, $id);
}
}
}
示例2: main
/**
* The main function in the class
*
* @return string HTML content
*/
function main()
{
$output = 'Enter [table]:[uid]:[fieldlist (optional)] <input name="table_uid" value="' . htmlspecialchars(t3lib_div::_POST('table_uid')) . '" />';
$output .= '<input type="submit" name="_" value="REFRESH" /><br/>';
// Show record:
if (t3lib_div::_POST('table_uid')) {
list($table, $uid, $fieldName) = t3lib_div::trimExplode(':', t3lib_div::_POST('table_uid'), 1);
if ($GLOBALS['TCA'][$table]) {
$rec = t3lib_BEfunc::getRecordRaw($table, 'uid=' . intval($uid), $fieldName ? $fieldName : '*');
if (count($rec)) {
$pidOfRecord = $rec['pid'];
$output .= '<input type="checkbox" name="show_path" value="1"' . (t3lib_div::_POST('show_path') ? ' checked="checked"' : '') . '/> Show path and rootline of record<br/>';
if (t3lib_div::_POST('show_path')) {
$output .= '<br/>Path of PID ' . $pidOfRecord . ': <em>' . t3lib_BEfunc::getRecordPath($pidOfRecord, '', 30) . '</em><br/>';
$output .= 'RL:' . Tx_Extdeveval_Compatibility::viewArray(t3lib_BEfunc::BEgetRootLine($pidOfRecord)) . '<br/>';
$output .= 'FLAGS:' . ($rec['deleted'] ? ' <b>DELETED</b>' : '') . ($rec['pid'] == -1 ? ' <b>OFFLINE VERSION of ' . $rec['t3ver_oid'] . '</b>' : '') . '<br/><hr/>';
}
if (t3lib_div::_POST('_EDIT')) {
$output .= '<hr/>Edit:<br/><br/>';
$output .= '<input type="submit" name="_SAVE" value="SAVE" /><br/>';
foreach ($rec as $field => $value) {
$output .= '<b>' . htmlspecialchars($field) . ':</b><br/>';
if (count(explode(chr(10), $value)) > 1) {
$output .= '<textarea name="record[' . $table . '][' . $uid . '][' . $field . ']" cols="100" rows="10">' . t3lib_div::formatForTextarea($value) . '</textarea><br/>';
} else {
$output .= '<input name="record[' . $table . '][' . $uid . '][' . $field . ']" value="' . htmlspecialchars($value) . '" size="100" /><br/>';
}
}
} elseif (t3lib_div::_POST('_SAVE')) {
$incomingData = t3lib_div::_POST('record');
$GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid=' . intval($uid), $incomingData[$table][$uid]);
$output .= '<br/>Updated ' . $table . ':' . $uid . '...';
$this->updateRefIndex($table, $uid);
} else {
if (t3lib_div::_POST('_DELETE')) {
$GLOBALS['TYPO3_DB']->exec_DELETEquery($table, 'uid=' . intval($uid));
$output .= '<br/>Deleted ' . $table . ':' . $uid . '...';
$this->updateRefIndex($table, $uid);
} else {
$output .= '<input type="submit" name="_EDIT" value="EDIT" />';
$output .= '<input type="submit" name="_DELETE" value="DELETE" onclick="return confirm(\'Are you sure you wish to delete?\');" />';
$output .= '<br/>' . md5(implode($rec));
$output .= Tx_Extdeveval_Compatibility::viewArray($rec);
}
}
} else {
$output .= 'No record existed!';
}
}
}
return $output;
}
示例3: main
/**
* Main Task center module
*
* @return string HTML content.
*/
function main()
{
if ($id = t3lib_div::_GP('display')) {
return $this->urlInIframe($this->backPath . t3lib_extMgm::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export&preset[load]=1&preset[select]=' . $id, 1);
} else {
// Thumbnail folder and files:
$tempDir = $this->userTempFolder();
if ($tempDir) {
$thumbnails = t3lib_div::getFilesInDir($tempDir, 'png,gif,jpg', 1);
}
$clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
$usernames = t3lib_BEfunc::getUserNames();
// Create preset links:
$presets = $this->getPresets();
$opt = array();
$opt[] = '
<tr class="bgColor5 tableheader">
<td>Icon:</td>
<td>Preset Title:</td>
<td>Public</td>
<td>Owner:</td>
<td>Page:</td>
<td>Path:</td>
<td>Meta data:</td>
</tr>';
if (is_array($presets)) {
foreach ($presets as $presetCfg) {
$configuration = unserialize($presetCfg['preset_data']);
$thumbnailFile = $thumbnails[$configuration['meta']['thumbnail']];
$title = strlen($presetCfg['title']) ? $presetCfg['title'] : '[' . $presetCfg['uid'] . ']';
$opt[] = '
<tr class="bgColor4">
<td>' . ($thumbnailFile ? '<img src="' . $this->backPath . '../' . substr($tempDir, strlen(PATH_site)) . basename($thumbnailFile) . '" hspace="2" width="70" style="border: solid black 1px;" alt="" /><br />' : ' ') . '</td>
<td nowrap="nowrap"><a href="index.php?SET[function]=tx_impexp&display=' . $presetCfg['uid'] . '">' . htmlspecialchars(t3lib_div::fixed_lgd_cs($title, 30)) . '</a> </td>
<td>' . ($presetCfg['public'] ? 'Yes' : ' ') . '</td>
<td>' . ($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid'] ? 'Own' : '[' . $usernames[$presetCfg['user_uid']]['username'] . ']') . '</td>
<td>' . ($configuration['pagetree']['id'] ? $configuration['pagetree']['id'] : ' ') . '</td>
<td>' . htmlspecialchars($configuration['pagetree']['id'] ? t3lib_BEfunc::getRecordPath($configuration['pagetree']['id'], $clause, 20) : '[Single Records]') . '</td>
<td>
<strong>' . htmlspecialchars($configuration['meta']['title']) . '</strong><br />' . htmlspecialchars($configuration['meta']['description']) . ($configuration['meta']['notes'] ? '<br /><br /><strong>Notes:</strong> <em>' . htmlspecialchars($configuration['meta']['notes']) . '</em>' : '') . '
</td>
</tr>';
}
$content = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding">' . implode('', $opt) . '</table>';
}
}
// Output:
$theOutput .= $this->pObj->doc->spacer(5);
$theOutput .= $this->pObj->doc->section('Export presets', $content, 0, 1);
return $theOutput;
}
示例4: moduleContent
/**
* [Describe function...]
*
* @param [type] $table: ...
* @param [type] $uid: ...
* @return [type] ...
*/
function moduleContent($table, $uid)
{
if ($GLOBALS['TCA'][$table]) {
$this->l10nMgrTools = GeneralUtility::makeInstance(\Localizationteam\L10nmgr\Model\Tools\Tools::class);
$this->l10nMgrTools->verbose = false;
// Otherwise it will show records which has fields but none editable.
$output = '';
if (GeneralUtility::_POST('_updateIndex')) {
$output .= $this->l10nMgrTools->updateIndexForRecord($table, $uid);
t3lib_BEfunc::setUpdateSignal('updatePageTree');
}
$inputRecord = t3lib_BEfunc::getRecord($table, $uid, 'pid');
$pathShown = t3lib_BEfunc::getRecordPath($table == 'pages' ? $uid : $inputRecord['pid'], '', 20);
$this->sysLanguages = $this->l10nMgrTools->t8Tools->getSystemLanguages($table == 'pages' ? $uid : $inputRecord['pid']);
$languageListArray = explode(',', $GLOBALS['BE_USER']->groupData['allowed_languages'] ? $GLOBALS['BE_USER']->groupData['allowed_languages'] : implode(',', array_keys($this->sysLanguages)));
$limitLanguageList = trim(GeneralUtility::_GP('languageList'));
foreach ($languageListArray as $kkk => $val) {
if ($limitLanguageList && !GeneralUtility::inList($limitLanguageList, $val)) {
unset($languageListArray[$kkk]);
}
}
if (!count($languageListArray)) {
$languageListArray[] = 0;
}
$languageList = implode(',', $languageListArray);
// Fetch translation index records:
if ($table != 'pages') {
$records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_l10nmgr_index', 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'tx_l10nmgr_index') . ' AND recuid=' . (int) $uid . ' AND translation_lang IN (' . $GLOBALS['TYPO3_DB']->cleanIntList($languageList) . ')' . ' AND workspace=' . (int) $GLOBALS['BE_USER']->workspace . ' AND (flag_new>0 OR flag_update>0 OR flag_noChange>0 OR flag_unknown>0)', '', 'translation_lang, tablename, recuid');
} else {
$records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_l10nmgr_index', 'recpid=' . (int) $uid . ' AND translation_lang IN (' . $GLOBALS['TYPO3_DB']->cleanIntList($languageList) . ')' . ' AND workspace=' . (int) $GLOBALS['BE_USER']->workspace . ' AND (flag_new>0 OR flag_update>0 OR flag_noChange>0 OR flag_unknown>0)', '', 'translation_lang, tablename, recuid');
}
# \TYPO3\CMS\Core\Utility\GeneralUtility::debugRows($records,'Index entries for '.$table.':'.$uid);
$tRows = array();
$tRows[] = '<tr class="bgColor2 tableheader">
<td colspan="2">Base element:</td>
<td colspan="2">Translation:</td>
<td>Action:</td>
<td><img src="../flags_new.png" width="10" height="16" alt="New" title="New" /></td>
<td><img src="../flags_unknown.png" width="10" height="16" alt="Unknown" title="Unknown" /></td>
<td><img src="../flags_update.png" width="10" height="16" alt="Update" title="Update" /></td>
<td><img src="../flags_ok.png" width="10" height="16" alt="OK" title="OK" /></td>
<td>Diff:</td>
</tr>';
//\TYPO3\CMS\Core\Utility\GeneralUtility::debugRows($records);
foreach ($records as $rec) {
if ($rec['tablename'] == 'pages') {
$tRows[] = $this->makeTableRow($rec);
}
}
if (count($tRows) > 1) {
$tRows[] = '<tr><td colspan="8"> </td></tr>';
}
foreach ($records as $rec) {
if ($rec['tablename'] != 'pages') {
$tRows[] = $this->makeTableRow($rec);
}
}
$output .= 'Path: <i>' . $pathShown . '</i><br><table border="0" cellpadding="1" cellspacing="1">' . implode('', $tRows) . '</table>';
// Updating index
if ($GLOBALS['BE_USER']->isAdmin()) {
$output .= '<br><br>Functions for "' . $table . ':' . $uid . '":<br/>
<input type="submit" name="_updateIndex" value="Update Index" /><br>
<input type="submit" name="_" value="Flush Translations" onclick="' . htmlspecialchars('document.location="../cm3/index.php?table=' . htmlspecialchars($table) . '&id=' . (int) $uid . '&cmd=flushTranslations";return false;') . '"/><br>
<input type="submit" name="_" value="Create priority" onclick="' . htmlspecialchars('document.location="' . $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . rawurlencode('db_list.php?id=0&table=tx_l10nmgr_priorities') . '&edit[tx_l10nmgr_priorities][0]=new&defVals[tx_l10nmgr_priorities][element]=' . rawurlencode($table . '_' . $uid) . '";return false;') . '"/><br>
';
}
return $output;
}
}
示例5: getRecordInfoEditLink
/**
* Returns a record icon with title and edit link
*
* @param string Table name (tt_content,...)
* @param array Record array
* @param boolean For pages records the rootline will be rendered
* @return string Rendered icon
*/
function getRecordInfoEditLink($refTable, $row, $showRootline = FALSE)
{
global $BACK_PATH, $LANG, $TCA;
// Create record title or rootline for pages if option is selected
if ($refTable === 'pages' and $showRootline) {
$elementTitle = t3lib_BEfunc::getRecordPath($row['uid'], '1=1', 0);
$elementTitle = t3lib_div::fixed_lgd_cs($elementTitle, -$BE_USER->uc['titleLen']);
} else {
$elementTitle = t3lib_BEfunc::getRecordTitle($refTable, $row, 1);
}
// Create icon for record
if ($refTable === 'tx_dam') {
$elementIcon = tx_dam_guiFunc::icon_getFileTypeImgTag($row, 'class="c-recicon" align="top"');
} else {
$iconAltText = t3lib_BEfunc::getRecordIconAltText($row, $refTable);
// Prepend table description for non-pages tables
if (!($refTable === 'pages')) {
$iconAltText = htmlspecialchars($LANG->sl($TCA[$refTable]['ctrl']['title']) . ': ') . $iconAltText;
}
$elementIcon = t3lib_iconworks::getIconImage($refTable, $row, $BACK_PATH, 'class="c-recicon" align="top" title="' . $iconAltText . '"');
}
// Return item with edit link
return tx_dam_SCbase::wrapLink_edit($elementIcon . $elementTitle, $refTable, $row['uid']);
}
示例6: ext_non_readAccessPages
/**
* Based on the content of ->ext_non_readAccessPageArray (see returnWebmounts()) it generates visually formatted information about these non-readable mounts.
*
* @return string HTML content showing which DB-mounts were not accessible for the user
*/
function ext_non_readAccessPages()
{
$lines = array();
foreach ($this->ext_non_readAccessPageArray as $pA) {
if ($pA) {
$lines[] = t3lib_BEfunc::getRecordPath($pA['uid'], '', 15);
}
}
if (count($lines)) {
return '<table bgcolor="red" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><font color="white"><strong>' . $GLOBALS['LANG']->getLL('noReadAccess', true) . '</strong></font></td>
</tr>
<tr>
<td>' . implode('</td></tr><tr><td>', $lines) . '</td>
</tr>
</table>';
}
}
示例7: getRecordPath
/**
* Returns the page title path of a PID value. Results are cached internally
*
* @param integer Record PID to check
* @return string The path for the input PID
*/
function getRecordPath($pid)
{
if (!isset($this->cache_getRecordPath[$pid])) {
$clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
$this->cache_getRecordPath[$pid] = (string) t3lib_BEfunc::getRecordPath($pid, $clause, 20);
}
return $this->cache_getRecordPath[$pid];
}
示例8: moduleContent
/**
* Generates and returns the content of the module
*
* @return string HTML to display
*/
protected function moduleContent()
{
$content = '';
$content .= $this->doc->header($GLOBALS['LANG']->getLL('general.title'));
// Get the available configurations
$l10nConfigurations = $this->getAllConfigurations();
// No configurations, issue a simple message
if (count($l10nConfigurations) == 0) {
$content .= $this->doc->section('', nl2br($GLOBALS['LANG']->getLL('general.no_date')));
// List all configurations
} else {
$content .= $this->doc->section('', nl2br($GLOBALS['LANG']->getLL('general.description.message')));
$content .= $this->doc->section($GLOBALS['LANG']->getLL('general.list.configuration.title'), '');
$content .= '<table class="typo3-dblist" border="0" cellpadding="0" cellspacing="0">';
// Assemble the header row
$content .= '<thead>';
$content .= '<tr class="t3-row-header">';
$content .= '<td>' . $GLOBALS['LANG']->getLL('general.list.headline.info.title') . '</td>';
$content .= '<td>' . $GLOBALS['LANG']->getLL('general.list.headline.title.title') . '</td>';
$content .= '<td>' . $GLOBALS['LANG']->getLL('general.list.headline.path.title') . '</td>';
$content .= '<td>' . $GLOBALS['LANG']->getLL('general.list.headline.depth.title') . '</td>';
$content .= '<td>' . $GLOBALS['LANG']->getLL('general.list.headline.tables.title') . '</td>';
$content .= '<td>' . $GLOBALS['LANG']->getLL('general.list.headline.exclude.title') . '</td>';
$content .= '<td>' . $GLOBALS['LANG']->getLL('general.list.headline.include.title') . '</td>';
$content .= '<td>' . $GLOBALS['LANG']->getLL('general.list.headline.incfcewithdefaultlanguage.title') . '</td>';
$content .= '</tr>';
$content .= '</thead>';
$content .= '<tbody>';
$informationIcon = t3lib_iconWorks::getSpriteIcon('actions-document-info');
foreach ($l10nConfigurations as $record) {
$configurationDetails = '<a class="tooltip" href="#tooltip_' . $record['uid'] . '">' . $informationIcon . '</a>';
$configurationDetails .= '<div style="display:none;" id="tooltip_' . $record['uid'] . '" class="infotip">';
$configurationDetails .= $this->renderConfigurationDetails($record);
$configurationDetails .= '</div>';
$content .= '<tr class="db_list_normal">';
$content .= '<td>' . $configurationDetails . '</td>';
$content .= '<td><a href="' . t3lib_div::resolveBackPath($this->doc->backPath . t3lib_extMgm::extRelPath('l10nmgr')) . 'cm1/index.php?id=' . $record['uid'] . '&srcPID=' . intval($this->id) . '">' . $record['title'] . '</a>' . '</td>';
// Get the full page path
// If very long, make sure to still display the full path
$pagePath = t3lib_BEfunc::getRecordPath($record['pid'], '1', 20, 50);
$path = is_array($pagePath) ? $pagePath[1] : $pagePath;
$content .= '<td>' . $path . '</td>';
$content .= '<td>' . $record['depth'] . '</td>';
$content .= '<td>' . $record['tablelist'] . '</td>';
$content .= '<td>' . $record['exclude'] . '</td>';
$content .= '<td>' . $record['include'] . '</td>';
$content .= '<td>' . $record['incfcewithdefaultlanguage'] . '</td>';
$content .= '</tr>';
}
$content .= '</tbody>';
}
return $content;
}
示例9: getTable_sys_note
/**
* Renders records from the sys_notes table from page id
* NOTICE: Requires the sys_note extension to be loaded.
*
* @param integer Page id
* @return string HTML for the listing
*/
function getTable_sys_note($id)
{
global $TCA;
if (!t3lib_extMgm::isLoaded('sys_note')) {
return '';
}
// INIT:
$perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
$tree = $this->getTreeObject($id, intval($GLOBALS['SOBE']->MOD_SETTINGS['pages_levels']), $perms_clause);
$this->itemLabels = array();
foreach ($TCA['sys_note']['columns'] as $name => $val) {
$this->itemLabels[$name] = $GLOBALS['LANG']->sL($val['label']);
}
// If page ids were found, select all sys_notes from the page ids:
$out = '';
if (count($tree->ids)) {
$delClause = t3lib_BEfunc::deleteClause('sys_note') . t3lib_BEfunc::versioningPlaceholderClause('sys_note');
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_note', 'pid IN (' . implode(',', $tree->ids) . ') AND (personal=0 OR cruser=' . intval($GLOBALS['BE_USER']->user['uid']) . ')' . $delClause);
$dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
// If sys_notes were found, render them:
if ($dbCount) {
$this->fieldArray = explode(',', '__cmds__,info,note');
// header line is drawn
$theData = array();
$theData['__cmds__'] = '';
$theData['info'] = '<strong>Info</strong><br /><img src="clear.gif" height="1" width="220" alt="" />';
$theData['note'] = '<strong>Note</strong>';
$out .= $this->addelement(1, '', $theData, ' class="t3-row-header"', 20);
// half line is drawn
$theData = array();
$theData['info'] = $this->widthGif;
$out .= $this->addelement(0, '', $theData);
$this->no_noWrap = 1;
// Items
$this->eCounter = $this->firstElementNumber;
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
t3lib_BEfunc::workspaceOL('sys_note', $row);
if (is_array($row)) {
list($flag, $code) = $this->fwd_rwd_nav();
$out .= $code;
if ($flag) {
$color = array(0 => '', 1 => ' class="bgColor4"', 2 => ' class="bgColor2"', 3 => '', 4 => ' class="bgColor5"');
$tdparams = $color[$row['category']];
$info = array();
$theData = array();
$this->getProcessedValue('sys_note', 'subject,category,author,email,personal', $row, $info);
$cont = implode('<br />', $info);
$head = '<strong>Page:</strong> ' . t3lib_BEfunc::getRecordPath($row['pid'], $perms_clause, 10) . '<br />';
$theData['__cmds__'] = $this->getIcon('sys_note', $row);
$theData['info'] = $head . $cont;
$theData['note'] = nl2br($row['message']);
$out .= $this->addelement(1, '', $theData, $tdparams, 20);
// half line is drawn
$theData = array();
$theData['info'] = $this->widthGif;
$out .= $this->addelement(0, '', $theData);
}
$this->eCounter++;
}
}
// Wrap it all in a table:
$out = '
<table border="0" cellpadding="1" cellspacing="2" width="480" class="typo3-page-sysnote">
' . $out . '
</table>';
}
}
return $out;
}
示例10: ext_getTemplateHierarchyArr
/**
* [Describe function...]
*
* @param [type] $arr: ...
* @param [type] $depthData: ...
* @param [type] $keyArray: ...
* @param [type] $first: ...
* @return [type] ...
*/
function ext_getTemplateHierarchyArr($arr, $depthData, $keyArray, $first = 0)
{
$keyArr = array();
foreach ($arr as $key => $value) {
$key = preg_replace('/\\.$/', '', $key);
if (substr($key, -1) != '.') {
$keyArr[$key] = 1;
}
}
$a = 0;
$c = count($keyArr);
static $i;
foreach ($keyArr as $key => $value) {
$HTML = '';
$a++;
$deeper = is_array($arr[$key . '.']);
$row = $arr[$key];
$PM = 'join';
$LN = $a == $c ? 'blank' : 'line';
$BTM = $a == $c ? 'top' : '';
$PM = 'join';
$HTML .= $depthData;
$alttext = '[' . $row['templateID'] . ']';
$alttext .= $row['pid'] ? ' - ' . t3lib_BEfunc::getRecordPath($row['pid'], $GLOBALS['SOBE']->perms_clause, 20) : '';
$icon = substr($row['templateID'], 0, 3) == 'sys' ? t3lib_iconWorks::getSpriteIconForRecord('sys_template', $row, array('title' => $alttext)) : t3lib_iconWorks::getSpriteIcon('mimetypes-x-content-template-static', array('title' => $alttext));
if (in_array($row['templateID'], $this->clearList_const) || in_array($row['templateID'], $this->clearList_setup)) {
$A_B = '<a href="index.php?id=' . $GLOBALS['SOBE']->id . '&template=' . $row['templateID'] . '">';
$A_E = '</a>';
if (t3lib_div::_GP('template') == $row['templateID']) {
$A_B = '<strong>' . $A_B;
$A_E .= '</strong>';
}
} else {
$A_B = '';
$A_E = '';
}
$HTML .= ($first ? '' : '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/ol/' . $PM . $BTM . '.gif" width="18" height="16" align="top" border="0" />') . $icon . $A_B . t3lib_div::fixed_lgd_cs($row['title'], $GLOBALS['BE_USER']->uc['titleLen']) . $A_E . ' ';
$RL = $this->ext_getRootlineNumber($row['pid']);
$keyArray[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
<td nowrap>' . $HTML . '</td>
<td align="center">' . ($row['root'] ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : '') . ' </td>
<td align="center">' . ($row['clConf'] ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : '') . ' ' . '</td>
<td align="center">' . ($row['clConst'] ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : '') . ' ' . '</td>
<td align="center">' . ($row['pid'] ? $row['pid'] : '') . '</td>
<td align="center">' . (strcmp($RL, '') ? $RL : '') . '</td>
<td>' . ($row['next'] ? ' ' . $row['next'] . ' ' : '') . '</td>
</tr>';
if ($deeper) {
$keyArray = $this->ext_getTemplateHierarchyArr($arr[$key . '.'], $depthData . ($first ? '' : '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/ol/' . $LN . '.gif" width="18" height="16" align="top" />'), $keyArray);
}
}
return $keyArray;
}
示例11: editPageIdFunc
/**
* 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'));
}
}
}
}
}
示例12: main
//.........这里部分代码省略.........
$this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array, array(substr($this->MOD_SETTINGS['users'], 3)), 1);
if (is_array($this->be_user_Array)) {
foreach ($this->be_user_Array as $val) {
if ($val['uid'] != $BE_USER->user['uid']) {
$selectUsers[] = $val['uid'];
}
}
}
$selectUsers[] = 0;
$where_part .= ' AND userid in (' . implode($selectUsers, ',') . ')';
} elseif (substr($this->MOD_SETTINGS['users'], 0, 3) == "us-") {
// All users
$selectUsers[] = intval(substr($this->MOD_SETTINGS['users'], 3));
$where_part .= ' AND userid in (' . implode($selectUsers, ',') . ')';
} elseif ($this->MOD_SETTINGS['users'] == -1) {
$where_part .= ' AND userid=' . $BE_USER->user['uid'];
// Self user
}
// Workspace
if ($GLOBALS['BE_USER']->workspace !== 0) {
$where_part .= ' AND workspace=' . intval($GLOBALS['BE_USER']->workspace);
} elseif ($this->MOD_SETTINGS['workspaces'] != -99) {
$where_part .= ' AND workspace=' . intval($this->MOD_SETTINGS['workspaces']);
}
// Finding out which page ids are in the log:
$logPids = array();
if ($this->MOD_SETTINGS['groupByPage']) {
$log = $GLOBALS['TYPO3_DB']->exec_SELECTquery('event_pid', 'sys_log', '1=1' . $where_part, 'event_pid');
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($log)) {
$logPids[] = $row['event_pid'];
}
// Overview:
$overviewList = array();
foreach ($logPids as $pid) {
if ((int) $pid > 0) {
$overviewList[] = htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('pagenameWithUID'), t3lib_BEfunc::getRecordPath($pid, '', 20), $pid));
}
}
sort($overviewList);
$this->content .= $this->doc->divider(5);
$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('overview'), sprintf($GLOBALS['LANG']->getLL('timeInfo'), date($this->dateFormat, $starttime), date($this->dateFormat, $endtime)) . '<br /><br /><br />' . implode('<br />', $overviewList), 1, 1, 0);
$this->content .= $this->doc->spacer(30);
} else {
$logPids[] = '_SINGLE';
}
foreach ($logPids as $pid) {
$codeArr = $this->lF->initArray();
$this->lF->reset();
$oldHeader = '';
$this->content .= $this->doc->divider(5);
switch ($pid) {
case '_SINGLE':
$insertMsg = '';
break;
case '-1':
$insertMsg = ' ' . $GLOBALS['LANG']->getLL('forNonPageRelatedActions') . ' ';
break;
case '0':
$insertMsg = ' ' . $GLOBALS['LANG']->getLL('forRootLevel') . ' ';
break;
default:
$insertMsg = ' ' . sprintf($GLOBALS['LANG']->getLL('forPage'), t3lib_BEfunc::getRecordPath($pid, '', 20), $pid) . ' ';
break;
}
$this->content .= $this->doc->section(sprintf($GLOBALS['LANG']->getLL('logForNonPageRelatedActionsOrRootLevelOrPage'), $insertMsg, date($this->dateFormat, $starttime), date($this->dateFormat, $endtime)), '', 1, 1, 0);
$log = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_log', '1=1' . $where_part . ($pid != '_SINGLE' ? ' AND event_pid=' . intval($pid) : ''), '', 'uid DESC', intval($this->MOD_SETTINGS['max']));
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($log)) {
$header = $this->doc->formatTime($row['tstamp'], 10);
if (!$oldHeader) {
$oldHeader = $header;
}
if ($header != $oldHeader) {
$this->content .= $this->doc->spacer(10);
$this->content .= $this->doc->section($oldHeader, $this->doc->table($codeArr));
$codeArr = $this->lF->initArray();
$oldHeader = $header;
$this->lF->reset();
}
$i++;
$codeArr[$i][] = $this->lF->getTimeLabel($row['tstamp']);
$codeArr[$i][] = $this->lF->getUserLabel($row['userid'], $row['workspace']);
$codeArr[$i][] = $this->lF->getTypeLabel($row['type']);
$codeArr[$i][] = $row['error'] ? $this->lF->getErrorFormatting($this->lF->errorSign[$row['error']], $row['error']) : '';
$codeArr[$i][] = $this->lF->getActionLabel($row['type'] . '_' . $row['action']);
$codeArr[$i][] = $this->lF->formatDetailsForList($row);
}
$this->content .= $this->doc->spacer(10);
$this->content .= $this->doc->section($header, $this->doc->table($codeArr));
$GLOBALS['TYPO3_DB']->sql_free_result($log);
}
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
//$markers['CSH'] = $docHeaderButtons['csh'];
$markers['CONTENT'] = $this->content;
// Build the <body> for the module
$this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('adminLog'));
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例13: getRecordPath
/**
* Returns the path for a record. Is the whole path for all records except pages - for these the last part is cut
* off, because it contains the pagetitle itself, which would be double information
*
* The path is returned uncut, cutting has to be done by calling function.
*
* @param array $row The row
* @param array $record The record
* @return string The record-path
*/
protected function getRecordPath(&$row, $uid)
{
$titleLimit = max($this->config['maxPathTitleLength'], 0);
if (($this->mmForeignTable ? $this->mmForeignTable : $this->table) == 'pages') {
$path = t3lib_BEfunc::getRecordPath($uid, '', $titleLimit);
// for pages we only want the first (n-1) parts of the path, because the n-th part is the page itself
$path = substr($path, 0, strrpos($path, '/', -2)) . '/';
} else {
$path = t3lib_BEfunc::getRecordPath($row['pid'], '', $titleLimit);
}
return $path;
}
示例14: getRecordPath
/**
* Return record path (visually formatted, using t3lib_BEfunc::getRecordPath() )
*
* @param string Table name
* @param array Record array
* @return string The record path.
* @see t3lib_BEfunc::getRecordPath()
*/
function getRecordPath($table, $rec)
{
t3lib_BEfunc::fixVersioningPid($table, $rec);
list($tscPID, $thePidValue) = $this->getTSCpid($table, $rec['uid'], $rec['pid']);
if ($thePidValue >= 0) {
return t3lib_BEfunc::getRecordPath($tscPID, $this->readPerms(), 15);
}
}
示例15: viewEditRecord
/**
* Action to edit records
*
* @param array $record: sys_action record
* @return string list of records
*/
protected function viewEditRecord($record)
{
$content = '';
$actionList = array();
$dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup');
$dbAnalysis->fromTC = 0;
$dbAnalysis->start($record['t4_recordsToEdit'], '*');
$dbAnalysis->getFromDB();
// collect the records
foreach ($dbAnalysis->itemArray as $el) {
$path = t3lib_BEfunc::getRecordPath($el['id'], $this->taskObject->perms_clause, $GLOBALS['BE_USER']->uc['titleLen']);
$record = t3lib_BEfunc::getRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
$title = t3lib_BEfunc::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
$description = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$el['table']]['ctrl']['title'], 1);
if (isset($record['crdate'])) {
// @todo: which information could be needfull
$description .= ' - ' . t3lib_BEfunc::dateTimeAge($record['crdate']);
}
$actionList[$el['id']] = array('title' => $title, 'description' => t3lib_BEfunc::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]), 'descriptionHtml' => $description, 'link' => $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")) . '&edit[' . $el['table'] . '][' . $el['id'] . ']=edit', 'icon' => t3lib_iconworks::getSpriteIconForRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']], array('title' => htmlspecialchars($path))));
}
// render the record list
$content .= $this->taskObject->renderListMenu($actionList);
return $content;
}