本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::cshItem方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility::cshItem方法的具体用法?PHP BackendUtility::cshItem怎么用?PHP BackendUtility::cshItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Utility\BackendUtility
的用法示例。
在下文中一共展示了BackendUtility::cshItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* MAIN function for page information of localization
*
* @return string Output HTML for the module.
* @todo Define visibility
*/
public function main()
{
global $BACK_PATH, $LANG, $SOBE;
$theOutput = $this->pObj->doc->header($LANG->sL('LLL:EXT:cms/web_info/locallang.xlf:lang_title'));
if ($this->pObj->id) {
// Depth selector:
$h_func = BackendUtility::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']);
$h_func .= BackendUtility::getFuncMenu($this->pObj->id, 'SET[lang]', $this->pObj->MOD_SETTINGS['lang'], $this->pObj->MOD_MENU['lang']);
$theOutput .= $h_func;
// Add CSH:
$theOutput .= BackendUtility::cshItem('_MOD_web_info', 'lang', $GLOBALS['BACK_PATH'], '|<br />');
// Showing the tree:
// Initialize starting point of page tree:
$treeStartingPoint = (int) $this->pObj->id;
$treeStartingRecord = BackendUtility::getRecordWSOL('pages', $treeStartingPoint);
$depth = $this->pObj->MOD_SETTINGS['depth'];
// Initialize tree object:
$tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView');
$tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));
$tree->addField('l18n_cfg');
// Creating top icon; the current page
$HTML = IconUtility::getSpriteIconForRecord('pages', $treeStartingRecord);
$tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => $HTML);
// Create the tree from starting point:
if ($depth) {
$tree->getTree($treeStartingPoint, $depth, '');
}
// Render information table:
$theOutput .= $this->renderL10nTable($tree);
}
return $theOutput;
}
示例2: main
/**
* MAIN function for page information display
*
* @return string Output HTML for the module.
*/
public function main()
{
$theOutput = $this->pObj->doc->header($this->getLanguageService()->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:page_title'));
$dblist = GeneralUtility::makeInstance(PageLayoutView::class);
$dblist->descrTable = '_MOD_web_info';
$dblist->thumbs = 0;
$dblist->script = BackendUtility::getModuleUrl('web_info');
$dblist->showIcon = 0;
$dblist->setLMargin = 0;
$dblist->agePrefixes = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears');
$dblist->pI_showUser = 1;
// PAGES:
$this->pObj->MOD_SETTINGS['pages_levels'] = $this->pObj->MOD_SETTINGS['depth'];
// ONLY for the sake of dblist module which uses this value.
$h_func = BackendUtility::getDropdownMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']);
$h_func .= BackendUtility::getDropdownMenu($this->pObj->id, 'SET[pages]', $this->pObj->MOD_SETTINGS['pages'], $this->pObj->MOD_MENU['pages']);
$dblist->start($this->pObj->id, 'pages', 0);
$dblist->generateList();
// CSH
$theOutput .= $this->pObj->doc->section('', BackendUtility::cshItem($dblist->descrTable, 'pagetree_overview', null, '|<br />') . '<div class="form-inline form-inline-spaced">' . $h_func . '</div>' . $dblist->HTMLcode, 0, 1);
// Additional footer content
$footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook'];
if (is_array($footerContentHook)) {
foreach ($footerContentHook as $hook) {
$params = array();
$theOutput .= GeneralUtility::callUserFunction($hook, $params, $this);
}
}
return $theOutput;
}
示例3: main
/**
* MAIN function for page information display
*
* @return string Output HTML for the module.
* @todo Define visibility
*/
public function main()
{
global $BACK_PATH, $LANG, $SOBE;
$dblist = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\View\\PageLayoutView');
$dblist->descrTable = '_MOD_' . $GLOBALS['MCONF']['name'];
$dblist->backPath = $BACK_PATH;
$dblist->thumbs = 0;
$dblist->script = 'index.php';
$dblist->showIcon = 0;
$dblist->setLMargin = 0;
$dblist->agePrefixes = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears');
$dblist->pI_showUser = 1;
// PAGES:
$this->pObj->MOD_SETTINGS['pages_levels'] = $this->pObj->MOD_SETTINGS['depth'];
// ONLY for the sake of dblist module which uses this value.
$h_func = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php');
$h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[pages]', $this->pObj->MOD_SETTINGS['pages'], $this->pObj->MOD_MENU['pages'], 'index.php');
$dblist->start($this->pObj->id, 'pages', 0);
$dblist->generateList();
// CSH
$theOutput .= $this->pObj->doc->header($LANG->getLL('page_title'));
$theOutput .= $this->pObj->doc->section('', \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem($dblist->descrTable, 'pagetree_overview', $GLOBALS['BACK_PATH'], '|<br />') . $h_func . $dblist->HTMLcode, 0, 1);
// Additional footer content
$footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook'];
if (is_array($footerContentHook)) {
foreach ($footerContentHook as $hook) {
$params = array();
$theOutput .= \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hook, $params, $this);
}
}
return $theOutput;
}
示例4: render
/**
* Render context sensitive help (CSH) for the given table
*
* @param string $table Table name ('_MOD_'+module name). If not set, the current module name will be used
* @param string $field Field name (CSH locallang main key)
* @param boolean $iconOnly If set, the full text will never be shown (only icon)
* @param string $styleAttributes Additional style-attribute content for wrapping table (full text mode only)
* @return string the rendered CSH icon
*/
public function render($table = NULL, $field = '', $iconOnly = FALSE, $styleAttributes = '')
{
if ($table === NULL) {
$currentRequest = $this->controllerContext->getRequest();
$moduleName = $currentRequest->getPluginName();
$table = '_MOD_' . $moduleName;
}
$cshButton = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem($table, $field, $GLOBALS['BACK_PATH'], '', $iconOnly, $styleAttributes);
return '<div class="docheader-csh">' . $cshButton . '</div>';
}
示例5: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array All available buttons as an assoc. array
*/
protected function getButtons()
{
$buttons = array('csh' => '', 'back' => '');
// CSH
$buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'history_log', $GLOBALS['BACK_PATH'], '', TRUE);
// Start history object
$historyObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\History\\RecordHistory');
if ($historyObj->returnUrl) {
$buttons['back'] = '<a href="' . htmlspecialchars($historyObj->returnUrl) . '" class="typo3-goBack">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
}
return $buttons;
}
示例6: renderStatic
/**
* @param array $arguments
* @param callable $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$table = $arguments['table'];
$field = $arguments['field'];
$wrap = $arguments['wrap'];
if ($table === null) {
$currentRequest = $renderingContext->getControllerContext()->getRequest();
$moduleName = $currentRequest->getPluginName();
$table = '_MOD_' . $moduleName;
}
return '<div class="docheader-csh">' . BackendUtility::cshItem($table, $field, '', $wrap) . '</div>';
}
示例7: getButtons
/**
* Create the panel of buttons for submitting the form
* or otherwise perform operations.
*
* @param array $row Data
*
* @return array all available buttons as an assoc. array
*/
public function getButtons(array $row)
{
$language = $this->getLanguageService();
$buttons = array('csh' => '', 'view' => '', 'edit' => '', 'hide_unhide' => '', 'move' => '', 'new_record' => '', 'paste' => '', 'level_up' => '', 'cache' => '', 'reload' => '', 'shortcut' => '', 'back' => '', 'csv' => '', 'export' => '');
// Get users permissions for this row:
$localCalcPerms = $this->getBackendUser()->calcPerms($row);
// CSH
if (!strlen($this->id)) {
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_commerce', 'list_module_noId', $GLOBALS['BACK_PATH'], '', TRUE);
} elseif (!$this->id) {
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_commerce', 'list_module_root', $GLOBALS['BACK_PATH'], '', TRUE);
} else {
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_commerce', 'list_module', $GLOBALS['BACK_PATH'], '', TRUE);
}
if (isset($this->id)) {
// New record
if (!$GLOBALS['SOBE']->modTSconfig['properties']['noCreateRecordsLink']) {
$params = '&parentCategory=' . $this->parentUid;
$buttons['new_record'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'db_new.php?id=' . $this->id . $params . '\');') . '" title="' . $language->getLL('newRecordGeneral', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-new') . '</a>';
}
// If edit permissions are set, see
// \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
if ($localCalcPerms & 2 && !empty($this->id)) {
// Edit
$params = '&edit[tx_commerce_categories][' . $this->pageRow['uid'] . ']=edit';
$buttons['edit'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->backPath, -1)) . '" title="' . $language->getLL('editPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>';
}
// Paste
if (($localCalcPerms & 8 || $localCalcPerms & 16) && $this->parentUid) {
$elFromTable = $this->clipObj->elFromTable('');
if (count($elFromTable)) {
$buttons['paste'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('', $this->id)) . '" onclick="' . htmlspecialchars('return ' . $this->clipObj->confirmMsg('tx_commerce_categories', $this->pageRow, 'into', $elFromTable)) . '" title="' . $language->getLL('clip_paste', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
}
}
if ($this->table && (!isset($GLOBALS['SOBE']->modTSconfig['properties']['noExportRecordsLinks']) || isset($GLOBALS['SOBE']->modTSconfig['properties']['noExportRecordsLinks']) && !$GLOBALS['SOBE']->modTSconfig['properties']['noExportRecordsLinks'])) {
// CSV
$buttons['csv'] = '<a href="' . htmlspecialchars($this->listURL() . '&csv=1') . '" title="' . $language->sL('LLL:EXT:lang/locallang_core.xlf:labels.csv', TRUE) . '">' . IconUtility::getSpriteIcon('mimetypes-text-csv') . '</a>';
// Export
if (ExtensionManagementUtility::isLoaded('impexp')) {
$url = BackendUtility::getModuleUrl('xMOD_tximpexp', array('tx_impexp[action]' => 'export'));
$buttons['export'] = '<a href="' . htmlspecialchars($url . '&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id)) . '" title="' . $language->sL('LLL:EXT:lang/locallang_core.xlf:rm.export', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-export-t3d') . '</a>';
}
}
// Reload
$buttons['reload'] = '<a href="' . htmlspecialchars($this->listURL()) . '" title="' . $language->sL('LLL:EXT:lang/locallang_core.xlf:labels.reload', TRUE) . '">' . IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
// Shortcut
if ($this->getBackendUser()->mayMakeShortcut()) {
$buttons['shortcut'] = $this->getDocumentTemplate()->makeShortcutIcon('id, imagemode, pointer, table, search_field, search_levels, showLimit, sortField, sortRev', implode(',', array_keys($this->MOD_MENU)), 'web_list');
}
// Back
if ($this->returnUrl) {
$buttons['back'] = '<a href="' . htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl, array('id' => $this->id))) . '" class="typo3-goBack" title="' . $language->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
}
if (!empty($this->parentUid)) {
// Setting title of page + the "Go up" link:
$temp = $this->parentUid;
$this->parentUid = $this->pageRow['pid'];
$buttons['level_up'] = '<a href="' . htmlspecialchars($this->listURL($this->id)) . '" onclick="setHighlight(' . $this->pageRow['pid'] . ')" title="' . $language->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel', TRUE) . '">' . IconUtility::getSpriteIcon('actions-view-go-up') . '</a>';
$this->parentUid = $temp;
}
}
return $buttons;
}
示例8: main
//.........这里部分代码省略.........
if ($this->groupLabels[abs($sc_group)] && strcmp('1', $this->groupLabels[abs($sc_group)])) {
$label = $this->groupLabels[abs($sc_group)];
} else {
$label = $GLOBALS['LANG']->getLL('shortcut_group_' . abs($sc_group), 1);
// Fallback label
if (!$label) {
$label = $GLOBALS['LANG']->getLL('shortcut_group', 1) . ' ' . abs($sc_group);
}
}
if ($sc_group >= 0) {
$onC = 'if (confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('bookmark_delAllInCat')) . ')){window.location.href=\'alt_shortcut.php?deleteCategory=' . $sc_group . '\';}return false;';
$this->linesPre[] = '<td> </td><td class="bgColor5"><a href="#" onclick="' . htmlspecialchars($onC) . '" title="' . $GLOBALS['LANG']->getLL('bookmark_delAllInCat', 1) . '">' . $label . '</a></td>';
} else {
// Fallback label
$label = $GLOBALS['LANG']->getLL('bookmark_global', 1) . ': ' . ($label ? $label : abs($sc_group));
$this->lines[] = '<td> </td><td class="bgColor5">' . $label . '</td>';
}
unset($label);
}
}
$bgColorClass = $row['uid'] == $this->editSC ? 'bgColor5' : ($row['sc_group'] < 0 ? 'bgColor6' : 'bgColor4');
if ($row['description'] && $row['uid'] != $this->editSC) {
$label = $row['description'];
} else {
$label = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs(rawurldecode($qParts['query']), 150);
}
$titleA = $this->itemLabel($label, $row['module_name'], $row['M_module_name']);
$editSH = $row['sc_group'] >= 0 || $GLOBALS['BE_USER']->isAdmin() ? 'editSh(' . intval($row['uid']) . ');' : 'alert(\'' . $GLOBALS['LANG']->getLL('bookmark_onlyAdmin') . '\')';
$jumpSC = 'jump(unescape(\'' . rawurlencode($row['url']) . '\'),\'' . implode('_', $mParts) . '\',\'' . $mParts[0] . '\');';
$onC = 'if (document.shForm.editShortcut_check && document.shForm.editShortcut_check.checked){' . $editSH . '}else{' . $jumpSC . '}return false;';
// user defined groups show up first
if ($sc_group >= 0) {
$this->linesPre[] = '<td class="' . $bgColorClass . '"><a href="#" onclick="' . htmlspecialchars($onC) . '"><img src="' . $this->getIcon($row['module_name']) . '" title="' . htmlspecialchars($titleA) . '" alt="" /></a></td>';
} else {
$this->lines[] = '<td class="' . $bgColorClass . '"><a href="#" onclick="' . htmlspecialchars($onC) . '"><img src="' . $this->getIcon($row['module_name']) . '" title="' . htmlspecialchars($titleA) . '" alt="" /></a></td>';
}
if (trim($row['description'])) {
$kkey = strtolower(substr($row['description'], 0, 20)) . '_' . $row['uid'];
$this->selOpt[$kkey] = '<option value="' . htmlspecialchars($jumpSC) . '">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['description'], 50)) . '</option>';
}
$formerGr = $row['sc_group'];
}
ksort($this->selOpt);
array_unshift($this->selOpt, '<option>[' . $GLOBALS['LANG']->getLL('bookmark_selSC', 1) . ']</option>');
$this->editLoadedFunc();
$this->editPageIdFunc();
if (!$this->editLoaded && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
$editIdCode = '<td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('bookmark_editID', 1) . ': <input type="text" value="' . ($this->editError ? htmlspecialchars($this->editPage) : '') . '" name="editPage"' . $this->doc->formWidth(15) . ' onchange="submitEditPage(this.value);" />' . ($this->editError ? ' <strong><span class="typo3-red">' . htmlspecialchars($this->editError) . '</span></strong>' : '') . (is_array($this->theEditRec) ? ' <strong>' . $GLOBALS['LANG']->getLL('bookmark_loadEdit', 1) . ' \'' . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $this->theEditRec, TRUE) . '\'</strong> (' . htmlspecialchars($this->editPath) . ')' : '') . ($this->searchFor ? ' ' . $GLOBALS['LANG']->getLL('bookmark_searchFor', 1) . ' <strong>\'' . htmlspecialchars($this->searchFor) . '\'</strong>' : '') . '</td>';
} else {
$editIdCode = '';
}
// Adding CSH:
$editIdCode .= '<td> ' . \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'bookmarks', $GLOBALS['BACK_PATH'], '', TRUE) . '</td>';
// Compile it all:
$this->content .= '
<table border="0" cellpadding="0" cellspacing="0" width="99%">
<tr>
<td>
<!--
Shortcut Display Table:
-->
<table border="0" cellpadding="0" cellspacing="2" id="typo3-shortcuts">
<tr>
';
if ($GLOBALS['BE_USER']->getTSConfigVal('options.enableBookmarks')) {
$this->content .= implode('
', $this->lines);
}
$this->content .= $editIdCode . '
</tr>
</table>
</td>
<td align="right">';
if ($this->hasWorkspaceAccess()) {
$this->content .= $this->workspaceSelector() . \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'workspaceSelector', $GLOBALS['BACK_PATH'], '', TRUE);
}
$this->content .= '
</td>
</tr>
</table>
';
// Launch Edit page:
if ($this->theEditRec['uid']) {
$this->content .= $this->doc->wrapScriptTags('top.loadEditId(' . $this->theEditRec['uid'] . ');');
}
// Load alternative table/uid into editing form.
if (count($this->alternativeTableUid) == 2 && isset($GLOBALS['TCA'][$this->alternativeTableUid[0]]) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->alternativeTableUid[1])) {
$JSaction = \TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[' . $this->alternativeTableUid[0] . '][' . $this->alternativeTableUid[1] . ']=edit', '', 'dummy.php');
$this->content .= $this->doc->wrapScriptTags('function editArbitraryElement() { top.content.' . $JSaction . '; } editArbitraryElement();');
}
// Load search for something.
if ($this->searchFor) {
$urlParameters = array();
$urlParameters['id'] = intval($GLOBALS['WEBMOUNTS'][0]);
$urlParameters['search_field'] = $this->searchFor;
$urlParameters['search_levels'] = 4;
$this->content .= $this->doc->wrapScriptTags('jump(unescape("' . rawurlencode(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_list', $urlParameters, '')) . '"), "web_list", "web");');
}
}
示例9: main
/**
* The main function.
*
* @return void
*/
public function main()
{
$this->CMD = GeneralUtility::_GP('CMD');
$this->pages_uid = intval(GeneralUtility::_GP('pages_uid'));
$this->sys_dmail_uid = intval(GeneralUtility::_GP('sys_dmail_uid'));
$this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
$access = is_array($this->pageinfo) ? 1 : 0;
if ($this->id && $access || $GLOBALS["BE_USER"]->user['admin'] && !$this->id) {
// Draw the header.
$this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS["BACK_PATH"];
$this->doc->setModuleTemplate('EXT:direct_mail/Resources/Private/Templates/Module.html');
$this->doc->form = '<form action="" method="post" name="' . $this->formname . '" enctype="multipart/form-data">';
$this->doc->addStyleSheet('direct_mail', ExtensionManagementUtility::extRelPath('direct_mail') . '/Resources/Public/StyleSheets/modules.css');
// Add CSS
$this->doc->inDocStylesArray['dmail'] = '.toggleTitle { width: 70%; }';
// JavaScript
$this->doc->JScode = '
<script language="javascript" type="text/javascript">
script_ended = 0;
function jumpToUrl(URL) { //
window.location.href = URL;
}
function jumpToUrlD(URL) { //
window.location.href = URL+"&sys_dmail_uid=' . $this->sys_dmail_uid . '";
}
function toggleDisplay(toggleId, e, countBox) { //
if (!e) {
e = window.event;
}
if (!document.getElementById) {
return false;
}
prefix = toggleId.split("-");
for (i=1; i<=countBox; i++){
newToggleId = prefix[0]+"-"+i;
body = document.getElementById(newToggleId);
image = document.getElementById(toggleId + "_toggle");
if (newToggleId != toggleId){
if (body.style.display == "block"){
body.style.display = "none";
if (image) {
image.className = image.className.replace( /expand/ , "collapse");
}
}
}
}
var body = document.getElementById(toggleId);
if (!body) {
return false;
}
var image = document.getElementById(toggleId + "_toggle");
if (body.style.display == "none") {
body.style.display = "block";
if (image) {
image.className = image.className.replace( /collapse/ , "expand");
}
} else {
body.style.display = "none";
if (image) {
image.className = image.className.replace( /expand/ , "collapse");
}
}
if (e) {
// Stop the event from propagating, which
// would cause the regular HREF link to
// be followed, ruining our hard work.
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
}
}
</script>
';
$this->doc->postCode = '
<script language="javascript" type="text/javascript">
script_ended = 1;
if (top.fsMod) top.fsMod.recentIds[\'web\'] = ' . intval($this->id) . ';
</script>
';
$markers = array('FLASHMESSAGES' => '', 'CONTENT' => '');
$docHeaderButtons = array('PAGEPATH' => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.php:labels.path') . ': ' . GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'], 50), 'SHORTCUT' => '', 'CSH' => BackendUtility::cshItem($this->cshTable, '', $GLOBALS["BACK_PATH"]));
// shortcut icon
if ($GLOBALS["BE_USER"]->mayMakeShortcut()) {
$docHeaderButtons['SHORTCUT'] = $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
}
$module = $this->pageinfo['module'];
if (!$module) {
$pidrec = BackendUtility::getRecord('pages', intval($this->pageinfo['pid']));
$module = $pidrec['module'];
}
if ($module == 'dmail') {
//.........这里部分代码省略.........
示例10: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array All available buttons as an assoc. array
*/
protected function getButtons()
{
$buttons = array('csh' => '', 'new_page' => '', 'refresh' => '', 'filter' => '');
// New Page
$onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'db_new.php?pagesOnly=1&id=\'+Tree.pageID;';
$buttons['new_page'] = '<a href="#" onclick="' . $onclickNewPageWizard . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:newPage', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-page-new') . '</a>';
// Refresh
$buttons['refresh'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.refresh', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
// CSH
$buttons['csh'] = str_replace('typo3-csh-inline', 'typo3-csh-inline show-right', \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH'], '', TRUE));
// Filter
if ($this->hasFilterBox) {
$buttons['filter'] = '<a href="#" id="tree-toolbar-filter-item">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-tree-search-open', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:labels.filter', 1))) . '</a>';
}
return $buttons;
}
示例11: getDocHeaderButtons
/**
* Gets the buttons that shall be rendered in the docHeader
*
* @return array Available buttons for the docHeader
*/
protected function getDocHeaderButtons()
{
return array('csh' => BackendUtility::cshItem('_MOD_web_func', ''), 'shortcut' => $this->getShortcutButton(), 'save' => '');
}
示例12: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform
* operations.
*
* @return string[] All available buttons as an assoc. array
*/
public function getButtons()
{
$module = $this->getModule();
$backendUser = $this->getBackendUserAuthentication();
$lang = $this->getLanguageService();
$buttons = array('csh' => '', 'view' => '', 'edit' => '', 'hide_unhide' => '', 'move' => '', 'new_record' => '', 'paste' => '', 'level_up' => '', 'cache' => '', 'reload' => '', 'shortcut' => '', 'back' => '', 'csv' => '', 'export' => '');
// Get users permissions for this page record:
$localCalcPerms = $backendUser->calcPerms($this->pageRow);
// CSH
if ((string) $this->id === '') {
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'list_module_noId');
} elseif (!$this->id) {
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'list_module_root');
} else {
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'list_module');
}
if (isset($this->id)) {
// View Exclude doktypes 254,255 Configuration:
// mod.web_list.noViewWithDokTypes = 254,255
if (isset($module->modTSconfig['properties']['noViewWithDokTypes'])) {
$noViewDokTypes = GeneralUtility::trimExplode(',', $module->modTSconfig['properties']['noViewWithDokTypes'], true);
} else {
//default exclusion: doktype 254 (folder), 255 (recycler)
$noViewDokTypes = array(PageRepository::DOKTYPE_SYSFOLDER, PageRepository::DOKTYPE_RECYCLER);
}
if (!in_array($this->pageRow['doktype'], $noViewDokTypes)) {
$onClick = htmlspecialchars(BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id)));
$buttons['view'] = '<a href="#" onclick="' . $onClick . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true) . '">' . $this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '</a>';
}
// New record on pages that are not locked by editlock
if (!$module->modTSconfig['properties']['noCreateRecordsLink'] && $this->editLockPermissions()) {
$onClick = htmlspecialchars('return jumpExt(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', ['id' => $this->id])) . ');');
$buttons['new_record'] = '<a href="#" onclick="' . $onClick . '" title="' . $lang->getLL('newRecordGeneral', true) . '">' . $this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL)->render() . '</a>';
}
// If edit permissions are set, see
// \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
if ($localCalcPerms & Permission::PAGE_EDIT && !empty($this->id) && $this->editLockPermissions() && $this->getBackendUserAuthentication()->checkLanguageAccess(0)) {
// Edit
$params = '&edit[pages][' . $this->pageRow['uid'] . ']=edit';
$onClick = htmlspecialchars(BackendUtility::editOnClick($params, '', -1));
$buttons['edit'] = '<a href="#" onclick="' . $onClick . '" title="' . $lang->getLL('editPage', true) . '">' . $this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)->render() . '</a>';
}
// Paste
if (($localCalcPerms & Permission::PAGE_NEW || $localCalcPerms & Permission::CONTENT_EDIT) && $this->editLockPermissions()) {
$elFromTable = $this->clipObj->elFromTable('');
if (!empty($elFromTable)) {
$onClick = htmlspecialchars('return ' . $this->clipObj->confirmMsg('pages', $this->pageRow, 'into', $elFromTable));
$buttons['paste'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('', $this->id)) . '" onclick="' . $onClick . '" title="' . $lang->getLL('clip_paste', true) . '">' . $this->iconFactory->getIcon('actions-document-paste-after', Icon::SIZE_SMALL)->render() . '</a>';
}
}
// Cache
$buttons['cache'] = '<a href="' . htmlspecialchars($this->listURL() . '&clear_cache=1') . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.clear_cache', true) . '">' . $this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL)->render() . '</a>';
if ($this->table && (!isset($module->modTSconfig['properties']['noExportRecordsLinks']) || isset($module->modTSconfig['properties']['noExportRecordsLinks']) && !$module->modTSconfig['properties']['noExportRecordsLinks'])) {
// CSV
$buttons['csv'] = '<a href="' . htmlspecialchars($this->listURL() . '&csv=1') . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.csv', true) . '">' . $this->iconFactory->getIcon('actions-document-export-csv', Icon::SIZE_SMALL)->render() . '</a>';
// Export
if (ExtensionManagementUtility::isLoaded('impexp')) {
$url = BackendUtility::getModuleUrl('xMOD_tximpexp', array('tx_impexp[action]' => 'export'));
$buttons['export'] = '<a href="' . htmlspecialchars($url . '&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id)) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.export', true) . '">' . $this->iconFactory->getIcon('actions-document-export-t3d', Icon::SIZE_SMALL)->render() . '</a>';
}
}
// Reload
$buttons['reload'] = '<a href="' . htmlspecialchars($this->listURL()) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.reload', true) . '">' . $this->iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL)->render() . '</a>';
// Shortcut
if ($backendUser->mayMakeShortcut()) {
$buttons['shortcut'] = $this->getDocumentTemplate()->makeShortcutIcon('id, M, imagemode, pointer, table, search_field, search_levels, showLimit, sortField, sortRev', implode(',', array_keys($this->MOD_MENU)), 'web_list');
}
// Back
if ($this->returnUrl) {
$href = htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl, array('id' => $this->id)));
$buttons['back'] = '<a href="' . $href . '" class="typo3-goBack" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', true) . '">' . $this->iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL)->render() . '</a>';
}
}
return $buttons;
}
示例13: main
/**
* Main function of class
*
* @return string HTML output
*/
public function main()
{
$pageId = (int) GeneralUtility::_GP('id');
if ($pageId === 0) {
$this->view->assign('pageZero', 1);
$this->view->assign('overviewOfPagesUsingTSConfig', $this->getOverviewOfPagesUsingTSConfig());
} else {
if ($this->pObj->MOD_SETTINGS['tsconf_parts'] == 99) {
$TSparts = BackendUtility::getPagesTSconfig($this->pObj->id, null, true);
$lines = array();
$pUids = array();
foreach ($TSparts as $k => $v) {
if ($k != 'uid_0') {
$line = array();
if ($k == 'defaultPageTSconfig') {
$line['defaultPageTSconfig'] = 1;
} else {
$pUids[] = substr($k, 4);
$row = BackendUtility::getRecordWSOL('pages', substr($k, 4));
$icon = $this->iconFactory->getIconForRecord('pages', $row, Icon::SIZE_SMALL);
$editIdList = substr($k, 4);
$urlParameters = ['edit' => ['pages' => [$editIdList => 'edit']], 'columnsOnly' => 'TSconfig', 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
$line['editIcon'] = BackendUtility::getModuleUrl('record_edit', $urlParameters);
$line['editTitle'] = 'editTSconfig';
$line['title'] = BackendUtility::wrapClickMenuOnIcon($icon, 'pages', $row['uid']) . ' ' . htmlspecialchars(BackendUtility::getRecordTitle('pages', $row));
}
$tsparser = GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::class);
$tsparser->lineNumberOffset = 0;
$line['content'] = $tsparser->doSyntaxHighlight(trim($v) . LF);
$lines[] = $line;
}
}
if (!empty($pUids)) {
$urlParameters = ['edit' => ['pages' => [implode(',', $pUids) => 'edit']], 'columnsOnly' => 'TSconfig', 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
$url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
$editIcon = htmlspecialchars($url);
$editTitle = 'editTSconfig_all';
} else {
$editIcon = '';
$editTitle = '';
}
$this->view->assign('tsconfParts99', 1);
$this->view->assign('csh', BackendUtility::cshItem('_MOD_web_info', 'tsconfig_edit', null, '|'));
$this->view->assign('lines', $lines);
$this->view->assign('editIcon', $editIcon);
$this->view->assign('editTitle', $editTitle);
} else {
$this->view->assign('tsconfParts99', 0);
// Defined global here!
$tmpl = GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\ExtendedTemplateService::class);
// Do not log time-performance information
$tmpl->tt_track = 0;
$tmpl->fixedLgd = 0;
$tmpl->linkObjects = 0;
$tmpl->bType = '';
$tmpl->ext_expandAllNotes = 1;
$tmpl->ext_noPMicons = 1;
$beUser = $this->getBackendUser();
switch ($this->pObj->MOD_SETTINGS['tsconf_parts']) {
case '1':
$modTSconfig = BackendUtility::getModTSconfig($this->pObj->id, 'mod');
break;
case '1a':
$modTSconfig = $beUser->getTSConfig('mod.web_layout', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1b':
$modTSconfig = $beUser->getTSConfig('mod.web_view', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1c':
$modTSconfig = $beUser->getTSConfig('mod.web_modules', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1d':
$modTSconfig = $beUser->getTSConfig('mod.web_list', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1e':
$modTSconfig = $beUser->getTSConfig('mod.web_info', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1f':
$modTSconfig = $beUser->getTSConfig('mod.web_func', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1g':
$modTSconfig = $beUser->getTSConfig('mod.web_ts', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '2':
$modTSconfig = $beUser->getTSConfig('RTE', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '5':
$modTSconfig = $beUser->getTSConfig('TCEFORM', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '6':
$modTSconfig = $beUser->getTSConfig('TCEMAIN', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '3':
$modTSconfig = $beUser->getTSConfig('TSFE', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
//.........这里部分代码省略.........
示例14: getButtons
/**
* Create the panel of buttons for submitting the
* form or otherwise perform operations.
*
* @return array all available buttons as an assoc. array
*/
protected function getButtons()
{
$buttons = array('csh' => '', 'refresh' => '');
// Refresh
$buttons['refresh'] = '<a href="' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
// CSH
$buttons['csh'] = str_replace('typo3-csh-inline', 'typo3-csh-inline show-right', BackendUtility::cshItem('xMOD_csh_commercebe', 'categorytree', $this->doc->backPath));
return $buttons;
}
示例15: getButtons
/**
* Builds the buttons for the docheader and returns them as an array
*
* @return array
*/
public function getButtons()
{
$lang = $this->getLanguageService();
$buttons = array();
// CSH button
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_edit');
// Save button
$theIcon = IconUtility::getSpriteIcon('actions-document-save');
$buttons['SAVE'] = '<a href="#" onclick="document.editform.submit();" title="' . $lang->makeEntities($lang->sL('LLL:EXT:lang/locallang_core.xlf:file_edit.php.submit', TRUE)) . '">' . $theIcon . '</a>';
// Save and Close button
$theIcon = IconUtility::getSpriteIcon('actions-document-save-close');
$buttons['SAVE_CLOSE'] = '<a href="#" onclick="document.editform.redirect.value=' . GeneralUtility::quoteJSvalue(htmlspecialchars($this->returnUrl)) . '; document.editform.submit();" title="' . $lang->makeEntities($lang->sL('LLL:EXT:lang/locallang_core.xlf:file_edit.php.saveAndClose', TRUE)) . '">' . $theIcon . '</a>';
// Cancel button
$theIcon = IconUtility::getSpriteIcon('actions-document-close');
$buttons['CANCEL'] = '<a href="#" onclick="backToList(); return false;" title="' . $lang->makeEntities($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.cancel', TRUE)) . '">' . $theIcon . '</a>';
return $buttons;
}