本文整理汇总了PHP中template::startPage方法的典型用法代码示例。如果您正苦于以下问题:PHP template::startPage方法的具体用法?PHP template::startPage怎么用?PHP template::startPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类template
的用法示例。
在下文中一共展示了template::startPage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main function, rendering the browsable page tree
*
* @return void
*/
function main()
{
global $LANG, $CLIENT;
// Produce browse-tree:
$tree = $this->pagetree->getBrowsableTree();
// Outputting Temporary DB mount notice:
if ($this->active_tempMountPoint) {
$flashText = '
<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => 0))) . '">' . $LANG->sl('LLL:EXT:lang/locallang_core.xml:labels.temporaryDBmount', 1) . '</a> <br />' . $LANG->sl('LLL:EXT:lang/locallang_core.xml:labels.path', 1) . ': <span title="' . htmlspecialchars($this->active_tempMountPoint['_thePathFull']) . '">' . htmlspecialchars(t3lib_div::fixed_lgd_cs($this->active_tempMountPoint['_thePath'], -50)) . '</span>
';
$flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $flashText, '', t3lib_FlashMessage::INFO);
$this->content .= $flashMessage->render();
}
// Outputting page tree:
$this->content .= '<div id="PageTreeDiv">' . $tree . '</div>';
// Adding javascript for drag & drop activation and highlighting
$this->content .= $this->doc->wrapScriptTags('
' . ($this->doHighlight ? 'Tree.highlightActiveItem("",top.fsMod.navFrameHighlightedID["web"]);' : '') . '
' . (!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();'));
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers = array('IMG_RESET' => t3lib_iconWorks::getSpriteIcon('actions-document-close', array('id' => 'treeFilterReset', 'alt' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter'), 'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter'))), 'WORKSPACEINFO' => $this->getWorkspaceInfo(), 'CONTENT' => $this->content);
$subparts = array();
if (!$this->hasFilterBox) {
$subparts['###SECOND_ROW###'] = '';
}
// Build the <body> for the module
$this->content = $this->doc->startPage('TYPO3 Page Tree');
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers, $subparts);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例2: main
/**
* Main function, redering the actual content of the editing page
*
* @return void
*/
function main()
{
//TODO remove global, change $LANG into $GLOBALS['LANG'], change locallang*.php to locallang*.xml
global $BE_USER, $LANG, $TYPO3_CONF_VARS;
$docHeaderButtons = $this->getButtons();
$this->content = $this->doc->startPage($LANG->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.pagetitle'));
// hook before compiling the output
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'])) {
$preOutputProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'];
if (is_array($preOutputProcessingHook)) {
$hookParameters = array('content' => &$this->content, 'target' => &$this->target);
foreach ($preOutputProcessingHook as $hookFunction) {
t3lib_div::callUserFunction($hookFunction, $hookParameters, $this);
}
}
}
$pageContent = $this->doc->header($LANG->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.pagetitle'));
$pageContent .= $this->doc->spacer(2);
$fI = pathinfo($this->target);
$extList = $TYPO3_CONF_VARS['SYS']['textfile_ext'];
if ($extList && t3lib_div::inList($extList, strtolower($fI['extension']))) {
// Read file content to edit:
$fileContent = t3lib_div::getUrl($this->target);
// making the formfields
$hValue = 'file_edit.php?target=' . rawurlencode($this->origTarget) . '&returnUrl=' . rawurlencode($this->returnUrl);
// Edit textarea:
$code .= '
<div id="c-edit">
<textarea rows="30" name="file[editfile][0][data]" wrap="off"' . $this->doc->formWidthText(48, 'width:98%;height:80%', 'off') . ' class="fixed-font enable-tab">' . t3lib_div::formatForTextarea($fileContent) . '</textarea>
<input type="hidden" name="file[editfile][0][target]" value="' . $this->target . '" />
<input type="hidden" name="redirect" value="' . htmlspecialchars($hValue) . '" />
</div>
<br />';
// Make shortcut:
if ($BE_USER->mayMakeShortcut()) {
$this->MCONF['name'] = 'xMOD_file_edit.php';
$docHeaderButtons['shortcut'] = $this->doc->makeShortcutIcon('target', '', $this->MCONF['name'], 1);
}
} else {
$code .= sprintf($LANG->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.coundNot'), $extList);
}
// Ending of section and outputting editing form:
$pageContent .= $this->doc->sectionEnd();
$pageContent .= $code;
// hook after compiling the output
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'])) {
$postOutputProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'];
if (is_array($postOutputProcessingHook)) {
$hookParameters = array('pageContent' => &$pageContent, 'target' => &$this->target);
foreach ($postOutputProcessingHook as $hookFunction) {
t3lib_div::callUserFunction($hookFunction, $hookParameters, $this);
}
}
}
// Add the HTML as a section:
$markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'BUTTONS' => $docHeaderButtons, 'PATH' => $this->title, 'CONTENT' => $pageContent);
$this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例3: flush
/**
* Flushes the rendered content to browser.
*
* @return void
*/
public function flush()
{
$content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
$content .= $this->doc->moduleBody($this->pageRecord, $this->getDocHeaderButtons(), $this->getTemplateMarkers());
$content .= $this->doc->endPage();
$this->content = null;
$this->doc = null;
echo $content;
}
示例4: main
/**
* Main function, rendering the folder tree
*
* @return void
*/
function main()
{
global $LANG, $CLIENT;
// Produce browse-tree:
$tree = $this->foldertree->getBrowsableTree();
// Outputting page tree:
$this->content .= $tree;
// Adding javascript for drag & drop activation and highlighting
$this->content .= $this->doc->wrapScriptTags('
' . ($this->doHighlight ? 'Tree.highlightActiveItem("", top.fsMod.navFrameHighlightedID["file"]);' : '') . '
' . (!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();'));
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers = array('IMG_RESET' => '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/close_gray.gif', ' width="16" height="16"') . ' id="treeFilterReset" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter') . '" ' . 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter') . '" />', 'CONTENT' => $this->content);
$subparts = array();
// Possible filter/search like in page tree
$subparts['###SECOND_ROW###'] = '';
// Build the <body> for the module
$this->content = $this->doc->startPage('TYPO3 Folder Tree');
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers, $subparts);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例5: main
/**
* Main function, rendering the browsable page tree
*
* @return void ...
*/
function main()
{
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'doktype = 254 AND module in (\'dmail\')' . BackendUtility::deleteClause('pages'), '', 'title');
$out = '';
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if (BackendUtility::readPageAccess($row['uid'], $GLOBALS['BE_USER']->getPagePermsClause(1))) {
$out .= '<tr onmouseover="this.style.backgroundColor=\'' . GeneralUtility::modifyHTMLColorAll($this->doc->bgColor, -5) . '\'" onmouseout="this.style.backgroundColor=\'\'">' . '<td id="dmail_' . $row['uid'] . '" ><a href="#" onclick="top.fsMod.recentIds[\'txdirectmailM1\']=' . $row['uid'] . ';jumpTo(\'id=' . $row['uid'] . '\',this,\'dmail_' . $row['uid'] . '\');">' . IconUtility::getSpriteIconForRecord('pages', $row, array('title' => htmlspecialchars(BackendUtility::getRecordPath($row['uid'], ' 1=1', 20)), 'align' => 'top')) . htmlspecialchars($row['title']) . '</a></td></tr>';
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$content = '<table cellspacing="0" cellpadding="0" border="0" width="100%">' . $out . '</table>';
// Adding highlight - JavaScript
if ($this->doHighlight) {
$content .= $this->doc->wrapScriptTags('
hilight_row("",top.fsMod.navFrameHighlightedID["web"]);
');
}
$docHeaderButtons = array('CSH' => BackendUtility::cshItem($this->cshTable, 'folders', $GLOBALS['BACK_PATH'], TRUE), 'REFRESH' => '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('unique' => uniqid('directmail_navframe')))) . '">' . '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/refresh_n.gif', 'width="14" height="14"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.refresh', 1) . '" alt="" /></a>');
$markers = array('HEADLINE' => '', 'CONTENT' => $GLOBALS['LANG']->getLL('dmail_folders') . $content);
// Build the <body> for the module
$this->content = $this->doc->startPage('TYPO3 Direct Mail Navigation');
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
}
示例6: init
/**
* Initialize (page output)
*
* @return void
*/
function init()
{
global $BACK_PATH;
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $BACK_PATH;
$this->doc->form = '<form action="alt_shortcut.php" name="shForm" method="post">';
$this->doc->divClass = 'typo3-shortcut';
$this->doc->JScode .= $this->doc->wrapScriptTags('
function jump(url,modName,mainModName) { //
// Clear information about which entry in nav. tree that might have been highlighted.
top.fsMod.navFrameHighlightedID = new Array();
if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
top.content.nav_frame.refresh_nav();
}
top.nextLoadModuleUrl = url;
top.goToModule(modName);
}
function editSh(uid) { //
window.location.href="alt_shortcut.php?editShortcut="+uid;
}
function submitEditPage(id) { //
window.location.href="alt_shortcut.php?editPage="+top.rawurlencodeAndRemoveSiteUrl(id);
}
function changeWorkspace(workspaceId) { //
window.location.href="alt_shortcut.php?changeWorkspace="+top.rawurlencodeAndRemoveSiteUrl(workspaceId);
}
function changeWorkspacePreview(newstate) { //
window.location.href="alt_shortcut.php?changeWorkspacePreview="+newstate;
}
function refreshShortcuts() {
window.location.href = document.URL;
}
');
$this->content .= $this->doc->startPage('Shortcut frame');
}
示例7: main
/**
* Main function, creating the content for the access editing forms/listings
*
* @return void
*/
public function main()
{
global $BE_USER, $LANG;
// Access check...
// The page will show only if there is a valid page and if this page may be viewed by the user
$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
$access = is_array($this->pageinfo);
// Checking access:
if ($this->id && $access || $BE_USER->isAdmin() && !$this->id) {
if ($BE_USER->isAdmin() && !$this->id) {
$this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
}
// This decides if the editform can and will be drawn:
$this->editingAllowed = $this->pageinfo['perms_userid'] == $BE_USER->user['uid'] || $BE_USER->isAdmin();
$this->edit = $this->edit && $this->editingAllowed;
// If $this->edit then these functions are called in the end of the page...
if ($this->edit) {
$this->doc->postCode .= $this->doc->wrapScriptTags('
setCheck("check[perms_user]","data[pages][' . $this->id . '][perms_user]");
setCheck("check[perms_group]","data[pages][' . $this->id . '][perms_group]");
setCheck("check[perms_everybody]","data[pages][' . $this->id . '][perms_everybody]");
');
}
// Draw the HTML page header.
$this->content .= $this->doc->header($LANG->getLL('permissions') . ($this->edit ? ': ' . $LANG->getLL('Edit') : ''));
$this->content .= $this->doc->spacer(5);
$vContent = $this->doc->getVersionSelector($this->id, 1);
if ($vContent) {
$this->content .= $this->doc->section('', $vContent);
}
// Main function, branching out:
if (!$this->edit) {
$this->notEdit();
} else {
$this->doEdit();
}
$docHeaderButtons = $this->getButtons();
$markers['CSH'] = $this->docHeaderButtons['csh'];
$markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu($this->id, 'SET[mode]', $this->MOD_SETTINGS['mode'], $this->MOD_MENU['mode']);
$markers['CONTENT'] = $this->content;
// Build the <body> for the module
$this->content = $this->doc->startPage($LANG->getLL('permissions'));
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
} else {
// If no access or if ID == zero
$this->content .= $this->doc->startPage($LANG->getLL('permissions'));
$this->content .= $this->doc->header($LANG->getLL('permissions'));
}
$this->content .= $this->doc->endPage();
}
示例8: main
//.........这里部分代码省略.........
function jumpToUrl(URL) { //
window.location.href = URL;
return false;
}
function jumpExt(URL,anchor) { //
var anc = anchor?anchor:"";
window.location.href = URL+(T3_THIS_LOCATION?"&returnUrl="+T3_THIS_LOCATION:"")+anc;
return false;
}
function jumpSelf(URL) { //
window.location.href = URL+(T3_RETURN_URL?"&returnUrl="+T3_RETURN_URL:"");
return false;
}
function setHighlight(id) { //
top.fsMod.recentIds["web"]=id;
top.fsMod.navFrameHighlightedID["web"]="pages"+id+"_"+top.fsMod.currentBank; // For highlighting
if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
top.content.nav_frame.refresh_nav();
}
}
' . $this->doc->redirectUrls($dblist->listURL()) . '
' . $dblist->CBfunctions() . '
function editRecords(table,idList,addParams,CBflag) { //
window.location.href="' . $BACK_PATH . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '&edit["+table+"]["+idList+"]=edit"+addParams;
}
function editList(table,idList) { //
var list="";
// Checking how many is checked, how many is not
var pointer=0;
var pos = idList.indexOf(",");
while (pos!=-1) {
if (cbValue(table+"|"+idList.substr(pointer,pos-pointer))) {
list+=idList.substr(pointer,pos-pointer)+",";
}
pointer=pos+1;
pos = idList.indexOf(",",pointer);
}
if (cbValue(table+"|"+idList.substr(pointer))) {
list+=idList.substr(pointer)+",";
}
return list ? list : idList;
}
if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
');
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
}
// access
// Begin to compile the whole page, starting out with page header:
$this->body = '';
$this->body .= '<form action="' . htmlspecialchars($dblist->listURL()) . '" method="post" name="dblistForm">';
$this->body .= $dblist->HTMLcode;
$this->body .= '<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" /></form>';
// If a listing was produced, create the page footer with search form etc:
if ($dblist->HTMLcode) {
// Making field select box (when extended view for a single table is enabled):
if ($dblist->table) {
$this->body .= $dblist->fieldSelectBox($dblist->table);
}
// Adding checkbox options for extended listing and clipboard display:
$this->body .= '
<!--
Listing options for clipboard and thumbnails
-->
<div id="typo3-listOptions">
<form action="" method="post">';
$this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], 'db_list.php', $this->table ? '&table=' . $this->table : '', 'id="checkLargeControl"') . ' <label for="checkLargeControl">' . $LANG->getLL('largeControl', 1) . '</label><br />';
if ($dblist->showClipboard) {
$this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], 'db_list.php', $this->table ? '&table=' . $this->table : '', 'id="checkShowClipBoard"') . ' <label for="checkShowClipBoard">' . $LANG->getLL('showClipBoard', 1) . '</label><br />';
}
$this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[localization]', $this->MOD_SETTINGS['localization'], 'db_list.php', $this->table ? '&table=' . $this->table : '', 'id="checkLocalization"') . ' <label for="checkLocalization">' . $LANG->getLL('localization', 1) . '</label><br />';
$this->body .= '
</form>
</div>';
$this->body .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_options', $GLOBALS['BACK_PATH']);
// Printing clipboard if enabled:
if ($this->MOD_SETTINGS['clipBoard'] && $dblist->showClipboard) {
$this->body .= $dblist->clipObj->printClipboard();
$this->body .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_clipboard', $GLOBALS['BACK_PATH']);
}
// Search box:
$this->body .= $dblist->getSearchBox();
// Display sys-notes, if any are found:
$this->body .= $dblist->showSysNotesForPage();
}
// Setting up the buttons and markers for docheader
$docHeaderButtons = $dblist->getButtons();
$markers = array('CSH' => $docHeaderButtons['csh'], 'CONTENT' => $this->body);
// Build the <body> for the module
$this->content = $this->doc->startPage('DB list');
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例9: main
//.........这里部分代码省略.........
if ($this->cmd == 'setCB') {
$CB['el'] = $this->filelist->clipObj->cleanUpCBC(array_merge(t3lib_div::_POST('CBH'), t3lib_div::_POST('CBC')), '_FILE');
}
if (!$this->MOD_SETTINGS['clipBoard']) {
$CB['setP'] = 'normal';
}
$this->filelist->clipObj->setCmd($CB);
$this->filelist->clipObj->cleanCurrent();
$this->filelist->clipObj->endClipboard();
// Saves
// If the "cmd" was to delete files from the list (clipboard thing), do that:
if ($this->cmd == 'delete') {
$items = $this->filelist->clipObj->cleanUpCBC(t3lib_div::_POST('CBC'), '_FILE', 1);
if (count($items)) {
// Make command array:
$FILE = array();
foreach ($items as $v) {
$FILE['delete'][] = array('data' => $v);
}
// Init file processing object for deleting and pass the cmd array.
$fileProcessor = t3lib_div::makeInstance('t3lib_extFileFunctions');
$fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS['BE']['fileExtensions']);
$fileProcessor->init_actionPerms($GLOBALS['BE_USER']->getFileoperationPermissions());
$fileProcessor->dontCheckForUnique = $this->overwriteExistingFiles ? 1 : 0;
$fileProcessor->start($FILE);
$fileProcessor->processData();
$fileProcessor->printLogErrorMessages();
}
}
if (!isset($this->MOD_SETTINGS['sort'])) {
// Set default sorting
$this->MOD_SETTINGS['sort'] = 'file';
$this->MOD_SETTINGS['reverse'] = 0;
}
// Start up filelisting object, include settings.
$this->pointer = t3lib_div::intInRange($this->pointer, 0, 100000);
$this->filelist->start($this->id, $this->pointer, $this->MOD_SETTINGS['sort'], $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'], $this->MOD_SETTINGS['bigControlPanel']);
// Generate the list
$this->filelist->generateList();
// Write the footer
$this->filelist->writeBottom();
// Set top JavaScript:
$this->doc->JScode = $this->doc->wrapScriptTags('
if (top.fsMod) top.fsMod.recentIds["file"] = unescape("' . rawurlencode($this->id) . '");
function jumpToUrl(URL) { //
window.location.href = URL;
}
' . $this->filelist->CBfunctions());
// This will return content necessary for the context sensitive clickmenus to work: bodytag events, JavaScript functions and DIV-layers.
$this->doc->getContextMenuCode();
// Setting up the buttons and markers for docheader
list($buttons, $otherMarkers) = $this->filelist->getButtonsAndOtherMarkers($this->id);
// add the folder info to the marker array
$otherMarkers['FOLDER_INFO'] = $this->filelist->getFolderInfo();
$docHeaderButtons = array_merge($this->getButtons(), $buttons);
// Build the <body> for the module
$this->content = $this->doc->startPage($LANG->getLL('files'));
// Create output
$pageContent = '';
$pageContent .= '<form action="' . htmlspecialchars($this->filelist->listURL()) . '" method="post" name="dblistForm">';
$pageContent .= $this->filelist->HTMLcode;
$pageContent .= '<input type="hidden" name="cmd" /></form>';
if ($this->filelist->HTMLcode) {
// Making listing options:
$pageContent .= '
<!--
Listing options for clipboard and thumbnails
-->
<div id="typo3-listOptions">
';
// Add "display bigControlPanel" checkbox:
$pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], 'file_list.php', '', 'id="bigControlPanel"') . '<label for="bigControlPanel"> ' . $LANG->getLL('bigControlPanel', 1) . '</label><br />';
// Add "display thumbnails" checkbox:
$pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[displayThumbs]', $this->MOD_SETTINGS['displayThumbs'], 'file_list.php', '', 'id="checkDisplayThumbs"') . ' <label for="checkDisplayThumbs">' . $LANG->getLL('displayThumbs', 1) . '</label><br />';
// Add clipboard button
$pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], 'file_list.php', '', 'id="checkClipBoard"') . ' <label for="checkClipBoard">' . $LANG->getLL('clipBoard', 1) . '</label>';
$pageContent .= '
</div>
';
// Set clipboard:
if ($this->MOD_SETTINGS['clipBoard']) {
$pageContent .= $this->filelist->clipObj->printClipboard();
$pageContent .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_clipboard', $GLOBALS['BACK_PATH']);
}
}
$markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent);
$this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, array_merge($markerArray, $otherMarkers));
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
} else {
// Create output - no access (no warning though)
$this->content = '';
$this->content .= $this->doc->startPage($LANG->getLL('files'));
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
}
示例10: explode
/**
* Rich Text Editor (RTE) user element selector
*
* @param [type] $openKeys: ...
* @return [type] ...
*/
function main_user($openKeys)
{
global $LANG, $BACK_PATH, $BE_USER;
// Starting content:
$content .= $this->doc->startPage($LANG->getLL('Insert Custom Element', 1));
$RTEtsConfigParts = explode(':', t3lib_div::_GP('RTEtsConfigParams'));
$RTEsetup = $BE_USER->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
$thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
if (is_array($thisConfig['userElements.'])) {
$categories = array();
foreach ($thisConfig['userElements.'] as $k => $value) {
$ki = intval($k);
$v = $thisConfig['userElements.'][$ki . '.'];
if (substr($k, -1) == "." && is_array($v)) {
$subcats = array();
$openK = $ki;
if ($openKeys[$openK]) {
$mArray = '';
switch ((string) $v['load']) {
case 'images_from_folder':
$mArray = array();
if ($v['path'] && @is_dir(PATH_site . $v['path'])) {
$files = t3lib_div::getFilesInDir(PATH_site . $v['path'], 'gif,jpg,jpeg,png', 0, '');
if (is_array($files)) {
$c = 0;
foreach ($files as $filename) {
$iInfo = @getimagesize(PATH_site . $v['path'] . $filename);
$iInfo = $this->calcWH($iInfo, 50, 100);
$ks = (string) (100 + $c);
$mArray[$ks] = $filename;
$mArray[$ks . "."] = array('content' => '<img src="' . $this->siteUrl . $v['path'] . $filename . '" />', '_icon' => '<img src="' . $this->siteUrl . $v['path'] . $filename . '" ' . $iInfo[3] . ' />', 'description' => $LANG->getLL('filesize') . ': ' . str_replace(' ', ' ', t3lib_div::formatSize(@filesize(PATH_site . $v['path'] . $filename))) . ', ' . $LANG->getLL('pixels', 1) . ': ' . $iInfo[0] . 'x' . $iInfo[1]);
$c++;
}
}
}
break;
}
if (is_array($mArray)) {
if ($v['merge']) {
$v = t3lib_div::array_merge_recursive_overrule($mArray, $v);
} else {
$v = $mArray;
}
}
foreach ($v as $k2 => $dummyValue) {
$k2i = intval($k2);
if (substr($k2, -1) == '.' && is_array($v[$k2i . '.'])) {
$title = trim($v[$k2i]);
if (!$title) {
$title = '[' . $LANG->getLL('noTitle', 1) . ']';
} else {
$title = $LANG->sL($title, 1);
}
$description = $LANG->sL($v[$k2i . '.']['description'], 1) . '<br />';
if (!$v[$k2i . '.']['dontInsertSiteUrl']) {
$v[$k2i . '.']['content'] = str_replace('###_URL###', $this->siteUrl, $v[$k2i . '.']['content']);
}
$logo = $v[$k2i . '.']['_icon'] ? $v[$k2i . '.']['_icon'] : '';
$onClickEvent = '';
switch ((string) $v[$k2i . '.']['mode']) {
case 'wrap':
$wrap = explode('|', $v[$k2i . '.']['content']);
$onClickEvent = 'wrapHTML(' . $LANG->JScharCode($wrap[0]) . ',' . $LANG->JScharCode($wrap[1]) . ',false);';
break;
case 'processor':
$script = trim($v[$k2i . '.']['submitToScript']);
if (substr($script, 0, 4) != 'http') {
$script = $this->siteUrl . $script;
}
if ($script) {
$onClickEvent = 'processSelection(' . $LANG->JScharCode($script) . ');';
}
break;
case 'insert':
default:
$onClickEvent = 'insertHTML(' . $LANG->JScharCode($v[$k2i . '.']['content']) . ');';
break;
}
$A = array('<a href="#" onClick="' . $onClickEvent . 'return false;">', '</a>');
$subcats[$k2i] = '<tr>
<td><img src="clear.gif" width="18" height="1" /></td>
<td class="bgColor4" valign="top">' . $A[0] . $logo . $A[1] . '</td>
<td class="bgColor4" valign="top">' . $A[0] . '<strong>' . $title . '</strong><br />' . $description . $A[1] . '</td>
</tr>';
}
}
ksort($subcats);
}
$categories[$ki] = implode('', $subcats);
}
}
ksort($categories);
# Render menu of the items:
$lines = array();
//.........这里部分代码省略.........