本文整理汇总了PHP中t3lib_iconWorks::getSpriteIconForRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_iconWorks::getSpriteIconForRecord方法的具体用法?PHP t3lib_iconWorks::getSpriteIconForRecord怎么用?PHP t3lib_iconWorks::getSpriteIconForRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_iconWorks
的用法示例。
在下文中一共展示了t3lib_iconWorks::getSpriteIconForRecord方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Render javascript in header
*
* @return string the rendered page info icon
* @see template::getPageInfo() Note: can't call this method as it's protected!
*/
public function render()
{
$doc = $this->getDocInstance();
$id = t3lib_div::_GP('id');
$pageRecord = t3lib_BEfunc::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
// Add icon with clickmenu, etc:
if ($pageRecord['uid']) {
// If there IS a real page
$alttext = t3lib_BEfunc::getRecordIconAltText($pageRecord, 'pages');
$iconImg = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord, array('title' => htmlspecialchars($alttext)));
// Make Icon:
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
} else {
// On root-level of page tree
// Make Icon
$iconImg = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/i/_icon_website.gif') . ' alt="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '" />';
if ($BE_USER->user['admin']) {
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
} else {
$theIcon = $iconImg;
}
}
// Setting icon with clickmenu + uid
$pageInfo = $theIcon . '<em>[pid: ' . $pageRecord['uid'] . ']</em>';
return $pageInfo;
}
示例2: render
/**
* Render the sprite icon
*
* @param string $table table name
* @param integer $uid uid of record
* @param string $title title
* @return string sprite icon
*/
public function render($table, $uid, $title)
{
$icon = '';
$row = t3lib_BEfunc::getRecord($table, $uid);
if (is_array($row)) {
$icon = t3lib_iconWorks::getSpriteIconForRecord($table, $row, array('title' => htmlspecialchars($title)));
}
return $icon;
}
示例3: workspaceSelector
/**
* Create selector for workspaces and change workspace if command is given to do that.
*
* @return string HTML
*/
function workspaceSelector()
{
global $TYPO3_DB, $BE_USER, $LANG;
// Changing workspace and if so, reloading entire backend:
if (strlen($this->changeWorkspace)) {
$BE_USER->setWorkspace($this->changeWorkspace);
return $this->doc->wrapScriptTags('top.location.href="' . t3lib_BEfunc::getBackendScript() . '";');
}
// Changing workspace and if so, reloading entire backend:
if (strlen($this->changeWorkspacePreview)) {
$BE_USER->setWorkspacePreview($this->changeWorkspacePreview);
}
// Create options array:
$options = array();
if ($BE_USER->checkWorkspace(array('uid' => 0))) {
$options[0] = '[' . $LANG->getLL('shortcut_onlineWS') . ']';
}
if ($BE_USER->checkWorkspace(array('uid' => -1))) {
$options[-1] = '[' . $LANG->getLL('shortcut_offlineWS') . ']';
}
// Add custom workspaces (selecting all, filtering by BE_USER check):
$workspaces = $TYPO3_DB->exec_SELECTgetRows('uid,title,adminusers,members,reviewers', 'sys_workspace', 'pid=0' . t3lib_BEfunc::deleteClause('sys_workspace'), '', 'title');
if (count($workspaces)) {
foreach ($workspaces as $rec) {
if ($BE_USER->checkWorkspace($rec)) {
$options[$rec['uid']] = $rec['uid'] . ': ' . $rec['title'];
}
}
}
// Build selector box:
if (count($options)) {
foreach ($options as $value => $label) {
$selected = (int) $BE_USER->workspace === $value ? ' selected="selected"' : '';
$options[$value] = '<option value="' . htmlspecialchars($value) . '"' . $selected . '>' . htmlspecialchars($label) . '</option>';
}
} else {
$options[] = '<option value="-99">' . $LANG->getLL('shortcut_noWSfound', 1) . '</option>';
}
$selector = '';
// Preview:
if ($BE_USER->workspace !== 0) {
$selector .= '<label for="workspacePreview">Frontend Preview:</label> <input type="checkbox" name="workspacePreview" id="workspacePreview" onclick="changeWorkspacePreview(' . ($BE_USER->user['workspace_preview'] ? 0 : 1) . ')"; ' . ($BE_USER->user['workspace_preview'] ? 'checked="checked"' : '') . '/> ';
}
$selector .= '<a href="mod/user/ws/index.php" target="content">' . t3lib_iconWorks::getSpriteIconForRecord('sys_workspace', array()) . '</a>';
if (count($options) > 1) {
$selector .= '<select name="_workspaceSelector" onchange="changeWorkspace(this.options[this.selectedIndex].value);">' . implode('', $options) . '</select>';
}
return $selector;
}
示例4: main
/**
* Creating the module output.
*
* @return void
* @todo provide position mapping if no position is given already. Like the columns selector but for our cascading element style ...
*/
function main()
{
global $LANG, $BACK_PATH;
if ($this->id && $this->access) {
// Creating content
$this->content = $this->doc->header($LANG->getLL('newContentElement'));
$this->content .= $this->doc->spacer(5);
$elRow = t3lib_BEfunc::getRecordWSOL('pages', $this->id);
$header = t3lib_iconWorks::getSpriteIconForRecord('pages', $elRow);
$header .= t3lib_BEfunc::getRecordTitle('pages', $elRow, 1);
$this->content .= $this->doc->section('', $header, 0, 1);
$this->content .= $this->doc->spacer(10);
// Wizard
$wizardCode = '';
$tableRows = array();
$wizardItems = $this->getWizardItems();
// Wrapper for wizards
$this->elementWrapper['sectionHeader'] = array('<h3 class="bgColor5">', '</h3>');
$this->elementWrapper['section'] = array('<table border="0" cellpadding="1" cellspacing="2">', '</table>');
$this->elementWrapper['wizard'] = array('<tr>', '</tr>');
$this->elementWrapper['wizardPart'] = array('<td>', '</td>');
// copy wrapper for tabs
$this->elementWrapperForTabs = $this->elementWrapper;
// Hook for manipulating wizardItems, wrapper, onClickEvent etc.
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['templavoila']['db_new_content_el']['wizardItemsHook'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['templavoila']['db_new_content_el']['wizardItemsHook'] as $classData) {
$hookObject = t3lib_div::getUserObj($classData);
if (!$hookObject instanceof cms_newContentElementWizardsHook) {
throw new UnexpectedValueException('$hookObject must implement interface cms_newContentElementWizardItemsHook', 1227834741);
}
$hookObject->manipulateWizardItems($wizardItems, $this);
}
}
if ($this->config['renderMode'] == 'tabs' && $this->elementWrapperForTabs != $this->elementWrapper) {
// restore wrapper for tabs if they are overwritten in hook
$this->elementWrapper = $this->elementWrapperForTabs;
}
// add document inline javascript
$this->doc->JScode = $this->doc->wrapScriptTags('
function goToalt_doc() { //
' . $this->onClickEvent . '
}
Event.observe(window, \'load\', function() {
if(top.refreshMenu) {
top.refreshMenu();
} else {
top.TYPO3ModuleMenu.refreshMenu();
}
if(top.shortcutFrame) {
top.shortcutFrame.refreshShortcuts();
}
});
');
// Traverse items for the wizard.
// An item is either a header or an item rendered with a title/description and icon:
$counter = 0;
foreach ($wizardItems as $k => $wInfo) {
if ($wInfo['header']) {
$menuItems[] = array('label' => htmlspecialchars($wInfo['header']), 'content' => $this->elementWrapper['section'][0]);
$key = count($menuItems) - 1;
} else {
$content = '';
// href URI for icon/title:
$newRecordLink = 'index.php?' . $this->linkParams() . '&createNewRecord=' . rawurlencode($this->parentRecord) . $wInfo['params'];
// Icon:
$iInfo = @getimagesize($wInfo['icon']);
$content .= $this->elementWrapper['wizardPart'][0] . '<a href="' . htmlspecialchars($newRecordLink) . '">
<img' . t3lib_iconWorks::skinImg($this->doc->backPath, $wInfo['icon'], '') . ' alt="" /></a>' . $this->elementWrapper['wizardPart'][1];
// Title + description:
$content .= $this->elementWrapper['wizardPart'][0] . '<a href="' . htmlspecialchars($newRecordLink) . '"><strong>' . htmlspecialchars($wInfo['title']) . '</strong><br />' . nl2br(htmlspecialchars(trim($wInfo['description']))) . '</a>' . $this->elementWrapper['wizardPart'][1];
// Finally, put it together in a container:
$menuItems[$key]['content'] .= $this->elementWrapper['wizard'][0] . $content . $this->elementWrapper['wizard'][1];
}
}
// add closing section-tag
foreach ($menuItems as $key => $val) {
$menuItems[$key]['content'] .= $this->elementWrapper['section'][1];
}
// Add the wizard table to the content, wrapped in tabs:
if ($this->config['renderMode'] == 'tabs') {
$this->doc->inDocStylesArray[] = '
.typo3-dyntabmenu-divs { background-color: #fafafa; border: 1px solid #000; width: 680px; }
.typo3-dyntabmenu-divs table { margin: 15px; }
.typo3-dyntabmenu-divs table td { padding: 3px; }
';
$code = $LANG->getLL('sel1', 1) . '<br /><br />' . $this->doc->getDynTabMenu($menuItems, 'new-content-element-wizard', false, false, 100);
} else {
$code = $LANG->getLL('sel1', 1) . '<br /><br />';
foreach ($menuItems as $section) {
$code .= $this->elementWrapper['sectionHeader'][0] . $section['label'] . $this->elementWrapper['sectionHeader'][1] . $section['content'];
}
}
//.........这里部分代码省略.........
示例5: main
/**
* Creating the module output.
*
* @return void
*/
function main()
{
global $LANG, $BACK_PATH, $BE_USER;
if ($this->page_id) {
// Get record for element:
$elRow = t3lib_BEfunc::getRecordWSOL($this->table, $this->moveUid);
// Headerline: Icon, record title:
$hline = t3lib_iconWorks::getSpriteIconForRecord($this->table, $elRow, array('id' => "c-recIcon", 'title' => htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($elRow, $this->table))));
$hline .= t3lib_BEfunc::getRecordTitle($this->table, $elRow, TRUE);
// Make-copy checkbox (clicking this will reload the page with the GET var makeCopy set differently):
$onClick = 'window.location.href=\'' . t3lib_div::linkThisScript(array('makeCopy' => !$this->makeCopy)) . '\';';
$hline .= '<br /><input type="hidden" name="makeCopy" value="0" /><input type="checkbox" name="makeCopy" id="makeCopy" value="1"' . ($this->makeCopy ? ' checked="checked"' : '') . ' onclick="' . htmlspecialchars($onClick) . '" /> <label for="makeCopy">' . $LANG->getLL('makeCopy', 1) . '</label>';
// Add the header-content to the module content:
$this->content .= $this->doc->section($LANG->getLL('moveElement') . ':', $hline, 0, 1);
$this->content .= $this->doc->spacer(20);
// Reset variable to pick up the module content in:
$code = '';
// IF the table is "pages":
if ((string) $this->table == 'pages') {
// Get page record (if accessible):
$pageinfo = t3lib_BEfunc::readPageAccess($this->page_id, $this->perms_clause);
if (is_array($pageinfo) && $BE_USER->isInWebMount($pageinfo['pid'], $this->perms_clause)) {
// Initialize the position map:
$posMap = t3lib_div::makeInstance('ext_posMap_pages');
$posMap->moveOrCopy = $this->makeCopy ? 'copy' : 'move';
// Print a "go-up" link IF there is a real parent page (and if the user has read-access to that page).
if ($pageinfo['pid']) {
$pidPageInfo = t3lib_BEfunc::readPageAccess($pageinfo['pid'], $this->perms_clause);
if (is_array($pidPageInfo)) {
if ($BE_USER->isInWebMount($pidPageInfo['pid'], $this->perms_clause)) {
$code .= '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('uid' => intval($pageinfo['pid']), 'moveUid' => $this->moveUid))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-up') . t3lib_BEfunc::getRecordTitle('pages', $pidPageInfo, TRUE) . '</a><br />';
} else {
$code .= t3lib_iconWorks::getSpriteIconForRecord('pages', $pidPageInfo) . t3lib_BEfunc::getRecordTitle('pages', $pidPageInfo, TRUE) . '<br />';
}
}
}
// Create the position tree:
$code .= $posMap->positionTree($this->page_id, $pageinfo, $this->perms_clause, $this->R_URI);
}
}
// IF the table is "tt_content":
if ((string) $this->table == 'tt_content') {
// First, get the record:
$tt_content_rec = t3lib_BEfunc::getRecord('tt_content', $this->moveUid);
// ?
if (!$this->input_moveUid) {
$this->page_id = $tt_content_rec['pid'];
}
// Checking if the parent page is readable:
$pageinfo = t3lib_BEfunc::readPageAccess($this->page_id, $this->perms_clause);
if (is_array($pageinfo) && $BE_USER->isInWebMount($pageinfo['pid'], $this->perms_clause)) {
// Initialize the position map:
$posMap = t3lib_div::makeInstance('ext_posMap_tt_content');
$posMap->moveOrCopy = $this->makeCopy ? 'copy' : 'move';
$posMap->cur_sys_language = $this->sys_language;
// Headerline for the parent page: Icon, record title:
$hline = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageinfo, array('title' => htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($pageinfo, 'pages'))));
$hline .= t3lib_BEfunc::getRecordTitle('pages', $pageinfo, TRUE);
// Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
$modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->page_id, 'mod.SHARED');
// SHARED page-TSconfig settings.
$colPosList = strcmp(trim($modTSconfig_SHARED['properties']['colPos_list']), '') ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3';
$colPosList = implode(',', array_unique(t3lib_div::intExplode(',', $colPosList)));
// Removing duplicates, if any
// Adding parent page-header and the content element columns from position-map:
$code = $hline . '<br />';
$code .= $posMap->printContentElementColumns($this->page_id, $this->moveUid, $colPosList, 1, $this->R_URI);
// Print a "go-up" link IF there is a real parent page (and if the user has read-access to that page).
$code .= '<br />';
$code .= '<br />';
if ($pageinfo['pid']) {
$pidPageInfo = t3lib_BEfunc::readPageAccess($pageinfo['pid'], $this->perms_clause);
if (is_array($pidPageInfo)) {
if ($BE_USER->isInWebMount($pidPageInfo['pid'], $this->perms_clause)) {
$code .= '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('uid' => intval($pageinfo['pid']), 'moveUid' => $this->moveUid))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-up') . t3lib_BEfunc::getRecordTitle('pages', $pidPageInfo, TRUE) . '</a><br />';
} else {
$code .= t3lib_iconWorks::getSpriteIconForRecord('pages', $pidPageInfo) . t3lib_BEfunc::getRecordTitle('pages', $pidPageInfo, TRUE) . '<br />';
}
}
}
// Create the position tree (for pages):
$code .= $posMap->positionTree($this->page_id, $pageinfo, $this->perms_clause, $this->R_URI);
}
}
// Add the $code content as a new section to the module:
$this->content .= $this->doc->section($LANG->getLL('selectPositionOfElement') . ':', $code, 0, 1);
}
// 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($LANG->getLL('movingElement'));
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
$this->content .= $this->doc->endPage();
//.........这里部分代码省略.........
示例6: exportData
/**
* Export part of module
*
* @param array Content of POST VAR tx_impexp[]..
* @return void Setting content in $this->content
*/
function exportData($inData)
{
global $TCA, $LANG;
// BUILDING EXPORT DATA:
// Processing of InData array values:
$inData['pagetree']['maxNumber'] = t3lib_div::intInRange($inData['pagetree']['maxNumber'], 1, 10000, 100);
$inData['listCfg']['maxNumber'] = t3lib_div::intInRange($inData['listCfg']['maxNumber'], 1, 10000, 100);
$inData['maxFileSize'] = t3lib_div::intInRange($inData['maxFileSize'], 1, 10000, 1000);
$inData['filename'] = trim(preg_replace('/[^[:alnum:]._-]*/', '', preg_replace('/\\.(t3d|xml)$/', '', $inData['filename'])));
if (strlen($inData['filename'])) {
$inData['filename'] .= $inData['filetype'] == 'xml' ? '.xml' : '.t3d';
}
// Set exclude fields in export object:
if (!is_array($inData['exclude'])) {
$inData['exclude'] = array();
}
// Saving/Loading/Deleting presets:
$this->processPresets($inData);
// Create export object and configure it:
$this->export = t3lib_div::makeInstance('tx_impexp');
$this->export->init(0, 'export');
$this->export->setCharset($LANG->charSet);
$this->export->maxFileSize = $inData['maxFileSize'] * 1024;
$this->export->excludeMap = (array) $inData['exclude'];
$this->export->softrefCfg = (array) $inData['softrefCfg'];
$this->export->extensionDependencies = (array) $inData['extension_dep'];
$this->export->showStaticRelations = $inData['showStaticRelations'];
$this->export->includeExtFileResources = !$inData['excludeHTMLfileResources'];
// Static tables:
if (is_array($inData['external_static']['tables'])) {
$this->export->relStaticTables = $inData['external_static']['tables'];
}
// Configure which tables external relations are included for:
if (is_array($inData['external_ref']['tables'])) {
$this->export->relOnlyTables = $inData['external_ref']['tables'];
}
$this->export->setHeaderBasics();
// Meta data setting:
$this->export->setMetaData($inData['meta']['title'], $inData['meta']['description'], $inData['meta']['notes'], $GLOBALS['BE_USER']->user['username'], $GLOBALS['BE_USER']->user['realName'], $GLOBALS['BE_USER']->user['email']);
if ($inData['meta']['thumbnail']) {
$tempDir = $this->userTempFolder();
if ($tempDir) {
$thumbnails = t3lib_div::getFilesInDir($tempDir, 'png,gif,jpg', 1);
$theThumb = $thumbnails[$inData['meta']['thumbnail']];
if ($theThumb) {
$this->export->addThumbnail($theThumb);
}
}
}
// Configure which records to export
if (is_array($inData['record'])) {
foreach ($inData['record'] as $ref) {
$rParts = explode(':', $ref);
$this->export->export_addRecord($rParts[0], t3lib_BEfunc::getRecord($rParts[0], $rParts[1]));
}
}
// Configure which tables to export
if (is_array($inData['list'])) {
foreach ($inData['list'] as $ref) {
$rParts = explode(':', $ref);
if ($GLOBALS['BE_USER']->check('tables_select', $rParts[0])) {
$res = $this->exec_listQueryPid($rParts[0], $rParts[1], t3lib_div::intInRange($inData['listCfg']['maxNumber'], 1));
while ($subTrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$this->export->export_addRecord($rParts[0], $subTrow);
}
}
}
}
// Pagetree
if (isset($inData['pagetree']['id'])) {
if ($inData['pagetree']['levels'] == -1) {
// Based on click-expandable tree
$pagetree = t3lib_div::makeInstance('localPageTree');
$tree = $pagetree->ext_tree($inData['pagetree']['id'], $this->filterPageIds($this->export->excludeMap));
$this->treeHTML = $pagetree->printTree($tree);
$idH = $pagetree->buffer_idH;
} elseif ($inData['pagetree']['levels'] == -2) {
// Only tables on page
$this->addRecordsForPid($inData['pagetree']['id'], $inData['pagetree']['tables'], $inData['pagetree']['maxNumber']);
} else {
// Based on depth
// Drawing tree:
// If the ID is zero, export root
if (!$inData['pagetree']['id'] && $GLOBALS['BE_USER']->isAdmin()) {
$sPage = array('uid' => 0, 'title' => 'ROOT');
} else {
$sPage = t3lib_BEfunc::getRecordWSOL('pages', $inData['pagetree']['id'], '*', ' AND ' . $this->perms_clause);
}
if (is_array($sPage)) {
$pid = $inData['pagetree']['id'];
$tree = t3lib_div::makeInstance('t3lib_pageTree');
$tree->init('AND ' . $this->perms_clause . $this->filterPageIds($this->export->excludeMap));
$HTML = t3lib_iconWorks::getSpriteIconForRecord('pages', $sPage);
$tree->tree[] = array('row' => $sPage, 'HTML' => $HTML);
//.........这里部分代码省略.........
示例7: getPageInfo
/**
* Setting page icon with clickmenu + uid for docheader
*
* @param array Current page
* @return string Page info
*/
protected function getPageInfo($pageRecord)
{
global $BE_USER;
// Add icon with clickmenu, etc:
if ($pageRecord['uid']) {
// If there IS a real page
$alttext = t3lib_BEfunc::getRecordIconAltText($pageRecord, 'pages');
$iconImg = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord, array('title' => $alttext));
// Make Icon:
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
$uid = $pageRecord['uid'];
$title = t3lib_BEfunc::getRecordTitle('pages', $pageRecord);
} else {
// On root-level of page tree
// Make Icon
$iconImg = t3lib_iconWorks::getSpriteIcon('apps-pagetree-root', array('title' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']));
if ($BE_USER->user['admin']) {
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
} else {
$theIcon = $iconImg;
}
$uid = '0';
$title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
}
// Setting icon with clickmenu + uid
$pageInfo = $theIcon . '<strong>' . htmlspecialchars($title) . ' [' . $uid . ']</strong>';
return $pageInfo;
}
示例8: render_outline_localizations
/**
* Renders localized elements of a record
*
* @param array $contentTreeArr: Part of the contentTreeArr for the element
* @param array $entries: Entries accumulated in this array (passed by reference)
* @param integer $indentLevel: Indentation level
* @return string HTML
* @access protected
* @see render_framework_singleSheet()
*/
function render_outline_localizations($contentTreeArr, &$entries, $indentLevel)
{
global $LANG, $BE_USER;
if ($contentTreeArr['el']['table'] == 'tt_content' && $contentTreeArr['el']['sys_language_uid'] <= 0) {
// Traverse the available languages of the page (not default and [All])
foreach ($this->translatedLanguagesArr as $sys_language_uid => $sLInfo) {
if ($sys_language_uid > 0 && $BE_USER->checkLanguageAccess($sys_language_uid)) {
switch ((string) $contentTreeArr['localizationInfo'][$sys_language_uid]['mode']) {
case 'exists':
// Get localized record:
$olrow = t3lib_BEfunc::getRecordWSOL('tt_content', $contentTreeArr['localizationInfo'][$sys_language_uid]['localization_uid']);
// Put together the records icon including content sensitive menu link wrapped around it:
$recordIcon_l10n = $this->getRecordStatHookValue('tt_content', $olrow['uid']) . t3lib_iconWorks::getSpriteIconForRecord('tt_content', $olrow);
if (!$this->translatorMode) {
$recordIcon_l10n = $this->doc->wrapClickMenuOnIcon($recordIcon_l10n, 'tt_content', $olrow['uid'], 1, '&callingScriptId=' . rawurlencode($this->doc->scriptID), 'new,copy,cut,pasteinto,pasteafter');
}
list($flagLink_begin, $flagLink_end) = explode('|*|', $this->link_edit('|*|', 'tt_content', $olrow['uid'], TRUE));
// Create entry for this element:
$entries[] = array('indentLevel' => $indentLevel, 'icon' => $recordIcon_l10n, 'title' => t3lib_BEfunc::getRecordTitle('tt_content', $olrow), 'table' => 'tt_content', 'uid' => $olrow['uid'], 'flag' => $flagLink_begin . tx_templavoila_icons::getFlagIconForLanguage($sLInfo['flagIcon'], array('title' => $sLInfo['title'], 'alt' => $sLInfo['title'])) . $flagLink_end, 'isNewVersion' => $olrow['_ORIG_uid'] ? TRUE : FALSE);
break;
}
}
}
}
}
示例9: renderTO
/**
* Renders the display of Template Objects.
*
* @return void
*/
function renderTO() {
if (intval($this->displayUid)>0) {
$row = t3lib_BEfunc::getRecordWSOL('tx_templavoila_tmplobj',$this->displayUid);
if (is_array($row)) {
$tRows=array();
$tRows[]='
<tr class="bgColor5">
<td colspan="2"><strong>' . $GLOBALS['LANG']->getLL('renderTO_toDetails') . ':</strong>'.
$this->cshItem('xMOD_tx_templavoila','mapping_to',$this->doc->backPath,'').
'</td>
</tr>';
// Get title and icon:
$icon = t3lib_iconWorks::getSpriteIconForRecord('tx_templavoila_tmplobj', $row);
$title = t3lib_BEfunc::getRecordTitle('tx_templavoila_tmplobj', $row);
$title = t3lib_BEFunc::getRecordTitlePrep($GLOBALS['LANG']->sL($title));
$tRows[]='
<tr class="bgColor4">
<td>'.$GLOBALS['LANG']->getLL('templateObject').':</td>
<td>' . $this->doc->wrapClickMenuOnIcon($icon, 'tx_templavoila_tmplobj', $row['uid'], 1) . $title . '</td>
</tr>';
// Session data
$sessionKey = $this->MCONF['name'] . '_validatorInfo:' . $row['uid'];
$sesDat = array('displayFile' => $row['fileref']);
$GLOBALS['BE_USER']->setAndSaveSessionData($sessionKey, $sesDat);
// Find the file:
$theFile = t3lib_div::getFileAbsFileName($row['fileref'],1);
if ($theFile && @is_file($theFile)) {
$relFilePath = substr($theFile,strlen(PATH_site));
$onCl = 'return top.openUrlInWindow(\''.t3lib_div::getIndpEnv('TYPO3_SITE_URL').$relFilePath.'\',\'FileView\');';
$tRows[]='
<tr class="bgColor4">
<td rowspan="2">'.$GLOBALS['LANG']->getLL('templateFile').':</td>
<td><a href="#" onclick="'.htmlspecialchars($onCl).'">'.htmlspecialchars($relFilePath).'</a></td>
</tr>
<tr class="bgColor4">
<td>
<a href="#" onclick ="openValidator(\'' . $sessionKey . '\');return false;">
' . t3lib_iconWorks::getSpriteIcon('extensions-templavoila-htmlvalidate') . '
' . $GLOBALS['LANG']->getLL('validateTpl') . '
</a>
</td>
</tr>';
// Finding Data Structure Record:
$DSOfile='';
$dsValue = $row['datastructure'];
if ($row['parent']) {
$parentRec = t3lib_BEfunc::getRecordWSOL('tx_templavoila_tmplobj',$row['parent'],'datastructure');
$dsValue=$parentRec['datastructure'];
}
if (tx_templavoila_div::canBeInterpretedAsInteger($dsValue)) {
$DS_row = t3lib_BEfunc::getRecordWSOL('tx_templavoila_datastructure',$dsValue);
} else {
$DSOfile = t3lib_div::getFileAbsFileName($dsValue);
}
if (is_array($DS_row) || @is_file($DSOfile)) {
// Get main DS array:
if (is_array($DS_row)) {
// Get title and icon:
$icon = t3lib_iconWorks::getSpriteIconForRecord('tx_templavoila_datastructure',$DS_row);
$title = t3lib_BEfunc::getRecordTitle('tx_templavoila_datastructure', $DS_row);
$title = t3lib_BEFunc::getRecordTitlePrep($GLOBALS['LANG']->sL($title));
$tRows[]='
<tr class="bgColor4">
<td>' . $GLOBALS['LANG']->getLL('renderTO_dsRecord') . ':</td>
<td>' . $this->doc->wrapClickMenuOnIcon($icon, 'tx_templavoila_datastructure', $DS_row['uid'] , 1) . $title . '</td>
</tr>';
// Link to updating DS/TO:
$onCl = 'index.php?file=' . rawurlencode($theFile) . '&_load_ds_xml=1&_load_ds_xml_to=' . $row['uid'] . '&uid=' . $DS_row['uid'] . '&returnUrl=' . $this->returnUrl;
$onClMsg = '
if (confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('renderTO_updateWarningConfirm')) . ')) {
document.location=\''.$onCl.'\';
}
return false;
';
$tRows[]='
<tr class="bgColor4">
<td> </td>
<td><input type="submit" name="_" value="' . $GLOBALS['LANG']->getLL('renderTO_editDSTO') . '" onclick="'.htmlspecialchars($onClMsg).'"/>'.
$this->cshItem('xMOD_tx_templavoila','mapping_to_modifyDSTO',$this->doc->backPath,'').
'</td>
</tr>';
// Read Data Structure:
$dataStruct = $this->getDataStructFromDSO($DS_row['dataprot']);
//.........这里部分代码省略.........
示例10: getTableMenu
/**
* Creates a menu of the tables that can be listed by this function
* Only tables which has records on the page will be included.
* Notice: The function also fills in the internal variable $this->activeTables with icon/titles.
*
* @param integer Page id from which we are listing records (the function will look up if there are records on the page)
* @return string HTML output.
*/
function getTableMenu($id)
{
global $TCA;
// Initialize:
$this->activeTables = array();
$theTables = explode(',', 'tt_content,fe_users,tt_address,tt_links,tt_board,tt_guest,tt_calender,tt_products,tt_news');
// NOTICE: This serves double function: Both being tables names (all) and for most others also being extension keys for the extensions they are related to!
// External tables:
if (is_array($this->externalTables)) {
$theTables = array_unique(array_merge($theTables, array_keys($this->externalTables)));
}
// Traverse tables to check:
foreach ($theTables as $tName) {
// Check access and whether the proper extensions are loaded:
if ($GLOBALS['BE_USER']->check('tables_select', $tName) && (t3lib_extMgm::isLoaded($tName) || t3lib_div::inList('fe_users,tt_content', $tName) || isset($this->externalTables[$tName]))) {
// Make query to count records from page:
$c = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', $tName, 'pid=' . intval($id) . t3lib_BEfunc::deleteClause($tName) . t3lib_BEfunc::versioningPlaceholderClause($tName));
// If records were found (or if "tt_content" is the table...):
if ($c || t3lib_div::inList('tt_content', $tName)) {
// Add row to menu:
$out .= '
<td><a href="#' . $tName . '"></a>' . t3lib_iconWorks::getSpriteIconForRecord($tName, array(), array('title' => $GLOBALS['LANG']->sL($TCA[$tName]['ctrl']['title'], 1))) . '</td>';
// ... and to the internal array, activeTables we also add table icon and title (for use elsewhere)
$this->activeTables[$tName] = t3lib_iconWorks::getSpriteIconForRecord($tName, array(), array('title' => $GLOBALS['LANG']->sL($TCA[$tName]['ctrl']['title'], 1) . ': ' . $c . ' ' . $GLOBALS['LANG']->getLL('records', 1))) . ' ' . $GLOBALS['LANG']->sL($TCA[$tName]['ctrl']['title'], 1);
}
}
}
// Wrap cells in table tags:
$out = '
<!--
Menu of tables on the page (table menu)
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-page-tblMenu">
<tr>' . $out . '
</tr>
</table>';
// Return the content:
return $out;
}
示例11: renderList
function renderList($pArray, $lines = array(), $c = 0)
{
if (is_array($pArray)) {
reset($pArray);
static $i;
foreach ($pArray as $k => $v) {
if (t3lib_div::testInt($k)) {
if (isset($pArray[$k . "_"])) {
$lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
<td nowrap><img src="clear.gif" width="1" height="1" hspace=' . $c * 10 . ' align="top">' . '<a href="' . t3lib_div::linkThisScript(array('id' => $k)) . '">' . t3lib_iconWorks::getSpriteIconForRecord('pages', t3lib_BEfunc::getRecordWSOL('pages', $k), array("title" => 'ID: ' . $k)) . t3lib_div::fixed_lgd_cs($pArray[$k], 30) . '</a></td>
<td align="center">' . $pArray[$k . '_']['count'] . '</td>
<td align="center" class="bgColor5">' . ($pArray[$k . '_']['root_max_val'] > 0 ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : " ") . '</td>
<td align="center">' . ($pArray[$k . '_']['root_min_val'] == 0 ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : " ") . '</td>
</tr>';
} else {
$lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
<td nowrap ><img src="clear.gif" width="1" height="1" hspace=' . $c * 10 . ' align=top>' . t3lib_iconWorks::getSpriteIconForRecord('pages', t3lib_BEfunc::getRecordWSOL('pages', $k)) . t3lib_div::fixed_lgd_cs($pArray[$k], 30) . '</td>
<td align="center"></td>
<td align="center" class="bgColor5"></td>
<td align="center"></td>
</tr>';
}
$lines = $this->renderList($pArray[$k . '.'], $lines, $c + 1);
}
}
}
return $lines;
}
示例12: getIcon
/**
* Get icon for the row.
* If $this->iconPath and $this->iconName is set, try to get icon based on those values.
*
* @param array Item row.
* @return string Image tag.
*/
function getIcon($row)
{
if ($this->iconPath && $this->iconName) {
$icon = '<img' . t3lib_iconWorks::skinImg('', $this->iconPath . $this->iconName, 'width="18" height="16"') . ' alt=""' . ($this->showDefaultTitleAttribute ? ' title="UID: ' . $row['uid'] . '"' : '') . ' />';
} else {
$icon = t3lib_iconWorks::getSpriteIconForRecord($this->table, $row, array('title' => $this->showDefaultTitleAttribute ? 'UID: ' . $row['uid'] : $this->getTitleAttrib($row), 'class' => 'c-recIcon'));
}
return $this->wrapIcon($icon, $row);
}
示例13: getRecordHeader
/**
* Create record header (includes teh record icon, record title etc.)
*
* @param array Record row.
* @return string HTML
*/
function getRecordHeader($row)
{
$line = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $row, array('title' => htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($row, 'tt_content'))));
$line .= t3lib_BEfunc::getRecordTitle('tt_content', $row, TRUE);
return $this->wrapRecordTitle($line, $row);
}
示例14: sidebar_renderNonUsedElements
/**
* Displays a list of local content elements on the page which were NOT used in the hierarchical structure of the page.
*
* @param $pObj: Reference to the parent object ($this)
* @return string HTML output
* @access protected
*/
function sidebar_renderNonUsedElements()
{
global $LANG, $TYPO3_DB, $BE_USER;
$output = '';
$elementRows = array();
$usedUids = array_keys($this->pObj->global_tt_content_elementRegister);
$usedUids[] = 0;
$pid = $this->pObj->id;
// If workspaces should evaluated non-used elements it must consider the id: For "element" and "branch" versions it should accept the incoming id, for "page" type versions it must be remapped (because content elements are then related to the id of the offline version)
$res = $TYPO3_DB->exec_SELECTquery(t3lib_BEfunc::getCommonSelectFields('tt_content', '', array('uid', 'header', 'bodytext', 'sys_language_uid')), 'tt_content', 'pid=' . intval($pid) . ' ' . 'AND uid NOT IN (' . implode(',', $usedUids) . ') ' . 'AND ( t3ver_state NOT IN (1,3) OR (t3ver_wsid > 0 AND t3ver_wsid = ' . intval($GLOBALS['BE_USER']->workspace) . ') )' . t3lib_BEfunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'uid');
$this->deleteUids = array();
// Used to collect all those tt_content uids with no references which can be deleted
while (false !== ($row = $TYPO3_DB->sql_fetch_assoc($res))) {
$elementPointerString = 'tt_content:' . $row['uid'];
// Prepare the language icon:
$languageLabel = htmlspecialchars($this->pObj->allAvailableLanguages[$row['sys_language_uid']]['title']);
if ($this->pObj->allAvailableLanguages[$row['sys_language_uid']]['flagIcon']) {
$languageIcon = tx_templavoila_icons::getFlagIconForLanguage($this->pObj->allAvailableLanguages[$row['sys_language_uid']]['flagIcon'], array('title' => $languageLabel, 'alt' => $languageLabel));
} else {
$languageIcon = $languageLabel && $row['sys_language_uid'] ? '[' . $languageLabel . ']' : '';
}
// Prepare buttons:
$cutButton = $this->element_getSelectButtons($elementPointerString, 'ref');
$recordIcon = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $row);
$recordButton = $this->pObj->doc->wrapClickMenuOnIcon($recordIcon, 'tt_content', $row['uid'], 1, '&callingScriptId=' . rawurlencode($this->pObj->doc->scriptID), 'new,copy,cut,pasteinto,pasteafter,delete');
if ($GLOBALS['BE_USER']->workspace) {
$wsRow = t3lib_BEfunc::getRecordWSOL('tt_content', $row['uid']);
$isDeletedInWorkspace = $wsRow['t3ver_state'] == 2;
} else {
$isDeletedInWorkspace = FALSE;
}
if (!$isDeletedInWorkspace) {
$elementRows[] = '
<tr id="' . $elementPointerString . '" class="tpm-nonused-element">
<td class="tpm-nonused-controls">' . $cutButton . $languageIcon . '</td>
<td class="tpm-nonused-ref">' . $this->renderReferenceCount($row['uid']) . '</td>
<td class="tpm-nonused-preview">' . $recordButton . htmlspecialchars(t3lib_BEfunc::getRecordTitle('tt_content', $row)) . '</td>
</tr>
';
}
}
if (count($elementRows)) {
// Control for deleting all deleteable records:
$deleteAll = '';
if (count($this->deleteUids)) {
$params = '';
foreach ($this->deleteUids as $deleteUid) {
$params .= '&cmd[tt_content][' . $deleteUid . '][delete]=1';
}
$label = $LANG->getLL('rendernonusedelements_deleteall');
$deleteAll = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(\'' . $this->doc->issueCommand($params, -1) . '\');') . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-delete', array('title' => htmlspecialchars($label))) . htmlspecialchars($label) . '</a>';
}
// Create table and header cell:
$output = '
<table class="tpm-nonused-elements lrPadding" border="0" cellpadding="0" cellspacing="1" width="100%">
<tr class="bgColor4-20">
<td colspan="3">' . $LANG->getLL('inititemno_elementsNotBeingUsed', '1') . ':</td>
</tr>
' . implode('', $elementRows) . '
<tr class="bgColor4">
<td colspan="3" class="tpm-nonused-deleteall">' . $deleteAll . '</td>
</tr>
</table>
';
}
return $output;
}
示例15: 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;
}