Project

General

Profile

Bug #18047 » 20080205_rfc7262_list.diff

Administrator Admin, 2008-02-05 10:00

View differences:

typo3/alt_doc.php (working copy)
* @var mediumDoc
*/
var $doc;
var $template; // a static HTML template, usually in templates/alt_doc.html
var $content; // Content accumulation
var $retUrl; // Return URL script, processed. This contains the script (if any) that we should RETURN TO from the alt_doc.php script IF we press the close button. Thus this variable is normally passed along from the calling script so we can properly return if needed.
......
$this->recTitle = t3lib_div::_GP('recTitle');
$this->disHelp = t3lib_div::_GP('disHelp');
$this->noView = t3lib_div::_GP('noView');
$this->perms_clause = $BE_USER->getPagePermsClause(1);
// Set other internal variables:
$this->R_URL_getvars['returnUrl']=$this->retUrl;
......
// Create an instance of the document template object
$this->doc = t3lib_div::makeInstance('template');
$this->doc->divClass = 'typo3-fullDoc';
$this->doc->backPath = $BACK_PATH;
$this->doc->setModuleTemplate('templates/alt_doc.html');
$this->doc->docType = 'xhtml_trans';
$this->doc->inDocStylesArray[] = 'html { overflow: hidden; }';
$this->doc->form='<form action="'.htmlspecialchars($this->R_URI).'" method="post" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'" name="editform" onsubmit="document.editform._scrollPosition.value=(document.documentElement.scrollTop || document.body.scrollTop); return TBE_EDITOR.checkSubmit(1);">';
$this->doc->form = '<form action="'.htmlspecialchars($this->R_URI).'" method="post" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'" name="editform" onsubmit="document.editform._scrollPosition.value=(document.documentElement.scrollTop || document.body.scrollTop); return TBE_EDITOR.checkSubmit(1);">';
$this->doc->loadJavascriptLib('contrib/prototype/prototype.js');
$this->doc->JScode = $this->doc->wrapScriptTags('
function jumpToUrl(URL,formEl) { //
......
formEl.checked = formEl.checked ? 0 : 1;
}
}
// workaround since IE6 cannot deal with relative height for scrolling elements
function resizeDocBody() {
$("typo3-docbody").style.height = (document.body.offsetHeight - parseInt($("typo3-docheader").getStyle("height")));
}
if (/MSIE 6/.test(navigator.userAgent)) {
Event.observe(window, "resize", resizeDocBody, false);
Event.observe(document, "load", resizeDocBody, false);
}
// Object: TS:
function typoSetup () { //
this.uniqueID = "";
......
*/
function main() {
global $BE_USER,$LANG;
// Starting content accumulation:
$this->content='';
$this->content.=$this->doc->startPage('TYPO3 Edit Document');
// Begin edit:
if (is_array($this->editconf)) {
......
// Creating the editing form, wrap it with buttons, document selector etc.
$editForm = $this->makeEditForm();
if ($editForm) {
$this->firstEl = reset($this->elementsData);
// Module configuration
$this->modTSconfig = ($this->viewId ? t3lib_BEfunc::getModTSconfig($this->viewId,'mod.xMOD_alt_doc') : array());
$this->content .=
$this->tceforms->printNeededJSFunctions_top().
$this->compileHeader().'
<div id="typo3-docbody">'.
$this->extraFormHeaders.
$this->compileForm($editForm).
$this->tceforms->printNeededJSFunctions().
$this->functionMenus().
// Add CSH:
t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'TCEforms', $GLOBALS['BACK_PATH'],'<br/>|',FALSE,'margin-top: 20px;').
'<br /><br />'.
$this->shortCutLink().
$this->openInNewWindowLink().'
</div>';
$this->tceformMessages();
$body.= $this->tceforms->printNeededJSFunctions_top();
$body.= $this->compileForm($editForm);
$body.= $this->tceforms->printNeededJSFunctions();
$body.= $this->functionMenus();
$body.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'TCEforms', $GLOBALS['BACK_PATH'], '<br/>|', FALSE, 'margin-top: 20px;') . '<br /><br />';
$body.= $this->tceformMessages();
}
}
// 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->viewId, $this->perms_clause);
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markerArray = array(
'LANGSELECTOR' => $this->langSelector(),
'EXTRAHEADER' => $this->extraFormHeaders(),
'CSH' => $docHeaderButtons['csh'],
'CONTENT' => $body
);
// Build the <body> for the module
$this->content = $this->doc->startPage('TYPO3 Edit Document');
$this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markerArray);
$this->content.= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
......
* @return void
*/
function printContent() {
$this->content.= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
echo $this->content;
}
......
return $editForm;
}
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return string HTML code, comprised of images linked to various actions.
* @deprecated since TYPO3 4.2, as there are other functions (getButtons) now for getting the button panel
*/
function makeButtonPanel() {
$btns = $this->getButtons();
unset($btns['shortcut']);
return implode('', $btns);
}
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array all available buttons as an assoc. array
*/
function getButtons() {
global $TCA,$LANG;
$buttons = array();
$buttons = array(
'save' => '',
'save_view' => '',
'save_new' => '',
'save_close' => '',
'close' => '',
'delete' => '',
'undo' => '',
'history' => '',
'columns_only' => ''
);
// Render SAVE type buttons:
// The action of each button is decided by its name attribute. (See doProcessData())
......
}
}
$buttons['shortcut'] = $this->shortCutLink();
$buttons['open_in_new_window'] = $this->openInNewWindowLink();
return $buttons;
}
/**
* Create the selector box form element which allows to select between open documents.
* Can be disabled through Page TSconfig.
*
* @return string HTML <select> element (if applicable)
*/
function makeDocSel() {
global $BE_USER,$LANG;
$docSel = '';
// Render the selector ONLY if it has not been disabled:
if (!$this->modTSconfig['properties']['disableDocSelector']) {
// Checking if the currently open document is stored in the list of "open documents" - if not, then add it:
if ((strcmp($this->docDat[1],$this->storeUrlMd5)||!isset($this->docHandler[$this->storeUrlMd5])) && !$this->dontStoreDocumentRef) {
$this->docHandler[$this->storeUrlMd5]=array($this->storeTitle,$this->storeArray,$this->storeUrl);
$BE_USER->pushModuleData('alt_doc.php',array($this->docHandler,$this->storeUrlMd5));
}
// Now, create the document selector box:
if (is_array($this->docHandler)) {
$opt = array();
$opt[] = '<option value="">[ '.$LANG->getLL('openDocs',1).': ]</option>';
// Traverse the list of open documents:
foreach($this->docHandler as $md5k => $setupArr) {
$theValue = 'alt_doc.php?'.$setupArr[2].'&returnUrl='.rawurlencode($this->retUrl);
$opt[]='<option value="'.htmlspecialchars($theValue).'"'.(!strcmp($md5k,$this->storeUrlMd5)?' selected="selected"':'').'>'.htmlspecialchars(strip_tags(t3lib_div::htmlspecialchars_decode($setupArr[0]))).'</option>';
}
// Compile the selector box finally:
$onChange = 'if(this.options[this.selectedIndex].value && !TBE_EDITOR.isFormChanged()){window.location.href=(this.options[this.selectedIndex].value);}';
$docSel='<select name="_docSelector" onchange="'.htmlspecialchars($onChange).'">'.implode('',$opt).'</select>';
// Add CSH:
$docSel.=t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'TCEforms_docSelector', $GLOBALS['BACK_PATH'],'', TRUE);
}
function langSelector() {
$langSelector = '';
// language switch/selector for editing, show only when a single record is edited
// - multiple records are too confusing
if (count($this->elementsData) == 1) {
$langSelector = $this->languageSwitch($this->firstEl['table'], $this->firstEl['uid'], $this->firstEl['pid']);
}
return $docSel;
return $langSelector;
}
/**
* Create the selector box form element which allows to select a clear-cache operation.
* Can be disabled through Page TSconfig.
*
* @return string HTML <select> element (if applicable)
* @see template::clearCacheMenu()
*/
function makeCmenu() {
$cMenu = '';
// Generate the menu if NOT disabled:
if (!$this->modTSconfig['properties']['disableCacheSelector']) {
$cMenu = $this->doc->clearCacheMenu(intval($this->viewId),!$this->modTSconfig['properties']['disableDocSelector']);
// Add CSH:
$cMenu.=t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'TCEforms_cacheSelector', $GLOBALS['BACK_PATH'],'', TRUE);
function extraFormHeaders() {
$extraHeader = '';
if (is_array($this->tceforms->extraFormHeaders)) {
$extraTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###DOCHEADER_EXTRAHEADER###');
$extraTemplate = t3lib_parsehtml::substituteMarker($extraTemplate, '###EXTRAHEADER###', implode(chr(10), $this->tceforms->extraFormHeaders));
}
return $cMenu;
return $extraTemplate;
}
/**
* Put together the various elements for the header
*
* @return string Composite HTML
*/
function compileHeader() {
global $LANG;
$btns = $this->getButtons();
$docSel = $this->makeDocSel();
$cMenu = $this->makeCmenu();
$content = '
<!-- Page header with buttons for saving & closing and path details -->
<div id="typo3-docheader">
<div id="typo3-docheader-row1">
<div class="buttonsleft">'.$btns['save'].$btns['save_view'].$btns['save_close'].$btns['save_new'].$btns['translation_save'].'</div>
<div class="buttonsright">'.$docSel.$cMenu.$btns['delete'].$btns['shortcut'].$btns['history'].$buttons['columns_only'].$btns['undo'].$btns['close'].'</div>
</div>
';
if (is_array($this->tceforms->extraFormHeaders)) {
$this->extraFormHeaders = '<div id="typo3-docheader-rowextra">'.implode(chr(10), $this->tceforms->extraFormHeaders).'</div>';
}
// language switch/selector for editing
// show only when a single record is edited - multiple records are too confusing
if (count($this->elementsData) == 1) {
$langSelector = '<div class="langselector">'.$this->languageSwitch($this->firstEl['table'], $this->firstEl['uid'], $this->firstEl['pid']).'</div>';
}
$content.='
<div id="typo3-docheader-row2">
<div class="pagepath">'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '.htmlspecialchars($this->generalPathOfForm).'</div>
<div class="infooptions">'.$langSelector.'</div>
</div>
</div>';
return $content;
}
/**
* Put together the various elements (buttons, selectors, form) into a table
*
* @param string HTML form.
......
* @return string
*/
function openInNewWindowLink() {
global $BE_USER,$LANG;
global $BE_USER, $LANG;
if ($this->returnUrl == 'close.html') {
return '';
}
$aOnClick = 'vHWin=window.open(\''.t3lib_div::linkThisScript(array('returnUrl'=>'close.html')).'\',\''.md5($this->R_URI).'\',\''.($BE_USER->uc['edit_wideDocument']?'width=670,height=500':'width=600,height=400').',status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
$aOnClick = 'vHWin=window.open(\''.t3lib_div::linkThisScript(array('returnUrl'=>'close.html')).'\',\''.md5($this->R_URI).'\',\'width=670,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
'<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/open_in_new_window.gif','width="19" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.openInNewWindow',1).'" alt="" /></a>';
}
......
*/
function tceformMessages() {
if (count($this->tceforms->commentMessages)) {
$this->content.='
<!-- TCEFORM messages
'.htmlspecialchars(implode(chr(10),$this->tceforms->commentMessages)).'
-->
';
$tceformMessages = '
<!-- TCEFORM messages
'.htmlspecialchars(implode(chr(10),$this->tceforms->commentMessages)).'
-->
';
}
return $tceformMessages;
}
typo3/class.db_list_extra.inc (working copy)
var $CBnames=array(); // Tracking names of elements (for clipboard use)
var $duplicateStack=array(); // Used to track which elements has duplicates and how many
/**
* Writes the top of the full listing
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @param array Current page record
* @return void (Adds content to internal variable, $this->HTMLcode)
* @return array all available buttons as an assoc. array
*/
function writeTop($row) {
global $LANG;
function getButtons() {
global $LANG;
$buttons = array(
'csh' => '',
'view' => '',
'edit' => '',
'hide_unhide' => '',
'move' => '',
'new_record' => '',
'paste' => '',
'level_up' => '',
'cache' => '',
'reload' => '',
'shortcut' => '',
'back' => '',
'csv' => '',
'export' => ''
);
// Makes the code for the pageicon in the top
$this->pageRow = $row;
$this->counter++;
$alttext = t3lib_BEfunc::getRecordIconAltText($row,'pages');
$iconImg = t3lib_iconWorks::getIconImage('pages',$row,$this->backPath,'class="absmiddle" title="'.htmlspecialchars($alttext).'"');
$titleCol = 'test'; // pseudo title column name
$this->fieldArray = Array($titleCol,'up'); // Setting the fields to display in the list (this is of course "pseudo fields" since this is the top!)
// Filling in the pseudo data array:
$theData = Array();
$theData[$titleCol] = $this->widthGif;
// Get users permissions for this row:
$localCalcPerms = $GLOBALS['BE_USER']->calcPerms($row);
$theData['up']=array();
// Initialize control panel for currect page ($this->id):
// Some of the controls are added only if $this->id is set - since they make sense only on a real page, not root level.
$theCtrlPanel =array();
// "View page" icon is added:
$theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id,$this->backPath,t3lib_BEfunc::BEgetRootLine($this->id))).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom.gif','width="12" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage',1).'" alt="" />'.
'</a>';
// If edit permissions are set (see class.t3lib_userauthgroup.php)
if ($localCalcPerms&2) {
// Adding "Edit page" icon:
if ($this->id) {
$params='&edit[pages]['.$row['uid'].']=edit';
$theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('editPage',1).'" alt="" />'.
// Get users permissions for this page record:
$localCalcPerms = $GLOBALS['BE_USER']->calcPerms($this->pageRow);
// CSH
if (!strlen($this->id)) {
$buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_noId', $GLOBALS['BACK_PATH']);
} elseif(!$this->id) {
$buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_root', $GLOBALS['BACK_PATH']);
} else {
$buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module', $GLOBALS['BACK_PATH']);
}
if (isset($this->id)) {
// View
$buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id, $this->backPath, t3lib_BEfunc::BEgetRootLine($this->id))) . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/zoom.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '" alt="" />' .
'</a>';
// New record
if (!$GLOBALS['SOBE']->modTSconfig['properties']['noCreateRecordsLink']) {
$buttons['new_record'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'db_new.php?id=' . $this->id . '\');') . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/new_el.gif') . ' title="' . $LANG->getLL('newRecordGeneral', 1) . '" alt="" />' .
'</a>';
}
// Adding "New record" icon:
if (!$GLOBALS['SOBE']->modTSconfig['properties']['noCreateRecordsLink']) {
$theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$this->backPath.'db_new.php?id='.$this->id.'\');').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_el.gif','width="11" height="12"').' title="'.$LANG->getLL('newRecordGeneral',1).'" alt="" />'.
// If edit permissions are set (see class.t3lib_userauthgroup.php)
if ($localCalcPerms&2 && !empty($this->id)) {
// Edit
$params = '&edit[pages][' . $this->pageRow['uid'] . ']=edit';
$buttons['edit'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->backPath, -1)) . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/edit2.gif') . ' title="' . $LANG->getLL('editPage', 1) . '" alt="" />' .
'</a>';
}
// Adding "Hide/Unhide" icon:
if ($this->id) {
if ($row['hidden']) {
$params='&data[pages]['.$row['uid'].'][hidden]=0';
$theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$GLOBALS['SOBE']->doc->issueCommand($params,-1).'\');').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_unhide.gif','width="11" height="10"').' title="'.$LANG->getLL('unHidePage',1).'" alt="" />'.
// Unhide
if ($this->pageRow['hidden']) {
$params = '&data[pages][' . $this->pageRow['uid'] . '][hidden]=0';
$buttons['hide_unhide'] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/button_unhide.gif') . ' title="' . $LANG->getLL('unHidePage', 1) . '" alt="" />' .
'</a>';
// Hide
} else {
$params='&data[pages]['.$row['uid'].'][hidden]=1';
$theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$GLOBALS['SOBE']->doc->issueCommand($params,-1).'\');').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_hide.gif','width="11" height="10"').' title="'.$LANG->getLL('hidePage',1).'" alt="" />'.
$params = '&data[pages][' . $this->pageRow['uid'] . '][hidden]=1';
$buttons['hide_unhide'] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">'.
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/button_hide.gif') . ' title="' . $LANG->getLL('hidePage', 1) . '" alt="" />' .
'</a>';
}
}
// Move
$buttons['move'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'move_el.php?table=pages&uid=' . $this->pageRow['uid'] . '\');') . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/move_' . ($this->table == 'tt_content' ? 'record' : 'page') . '.gif') . ' title="' . $LANG->getLL('move_page', 1) . '" alt="" />' .
'</a>';
// Up one level
$buttons['level_up'] = '<a href="' . htmlspecialchars($this->listURL($this->pageRow['pid'])) . '" onclick="setHighlight(' . $this->pageRow['pid'] . ')">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/i/pages_up.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel', 1) . '" alt="" />' .
'</a>';
// Adding "move page" button:
if ($this->id) {
$theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$this->backPath.'move_el.php?table=pages&uid='.$row['uid'].'\');').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/move_'.($this->table=='tt_content'?'record':'page').'.gif','width="11" height="12"').' title="'.$LANG->getLL('move_page',1).'" alt="" />'.
}
// Paste
if (($localCalcPerms&8) || ($localCalcPerms&16)) {
$elFromTable = $this->clipObj->elFromTable('');
if (count($elFromTable)) {
$buttons['paste'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('', $this->id)) . '" onclick="' . htmlspecialchars('return ' . $this->clipObj->confirmMsg('pages', $this->pageRow, 'into', $elFromTable)) . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/clip_pasteafter.gif') . ' title="' . $LANG->getLL('clip_paste', 1) . '" alt="" />' .
'</a>';
}
}
// Cache
$buttons['cache'] = '<a href="' . htmlspecialchars($this->listURL() . '&clear_cache=1') . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/clear_cache.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.clear_cache', 1) . '" alt="" />' .
'</a>';
if ($this->table) {
// CSV
$buttons['csv'] = '<a href="' . htmlspecialchars($this->listURL() . '&csv=1') . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/csv.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.csv', 1) . '" alt="" />' .
'</a>';
// Export
if (t3lib_extMgm::isLoaded('impexp')) {
$buttons['export'] = '<a href="' . htmlspecialchars($this->backPath. 'mod.php?M=xMOD_tximpexp&tx_impexp[action]=export&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id)) . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, t3lib_extMgm::extRelPath('impexp') . 'export.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.export', 1) . '" alt="" />' .
'</a>';
}
}
}
// "Paste into page" link:
if (($localCalcPerms&8) || ($localCalcPerms&16)) {
$elFromTable = $this->clipObj->elFromTable('');
if (count($elFromTable)) {
$theCtrlPanel[]='<a href="'.htmlspecialchars($this->clipObj->pasteUrl('',$this->id)).'" onclick="'.htmlspecialchars('return '.$this->clipObj->confirmMsg('pages',$this->pageRow,'into',$elFromTable)).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_pasteafter.gif','width="12" height="12"').' title="'.$LANG->getLL('clip_paste',1).'" alt="" />'.
// Reload
$buttons['reload'] = '<a href="' . htmlspecialchars($this->listURL()) . '">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/refresh_n.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.reload', 1) . '" alt="" />' .
'</a>';
// Shortcut
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$buttons['shortcut'] = $GLOBALS['TBE_TEMPLATE']->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(t3lib_div::linkThisUrl($this->returnUrl, array('id' => $this->id))) . '" class="typo3-goBack">' .
'<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/goback.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', 1) . '" alt="" />' .
'</a>';
}
}
// Finally, compile all elements of the control panel into table cells:
if (count($theCtrlPanel)) {
$theData['up'][]='
<!--
Control panel for page
-->
<table border="0" cellpadding="0" cellspacing="0" class="bgColor4" id="typo3-dblist-ctrltop">
<tr>
<td>'.implode('</td>
<td>',$theCtrlPanel).'</td>
</tr>
</table>';
}
// Add "clear-cache" link:
$theData['up'][]='<a href="'.htmlspecialchars($this->listURL().'&clear_cache=1').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clear_cache.gif','width="14" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.clear_cache',1).'" alt="" />'.
'</a>';
// Add "CSV" link, if a specific table is shown:
if ($this->table) {
$theData['up'][]='<a href="'.htmlspecialchars($this->listURL().'&csv=1').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/csv.gif','width="27" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.csv',1).'" alt="" />'.
'</a>';
}
// Add "Export" link, if a specific table is shown:
if ($this->table && t3lib_extMgm::isLoaded('impexp')) {
$theData['up'][]='<a href="'.htmlspecialchars($this->backPath.'mod.php?M=xMOD_tximpexp&tx_impexp[action]=export&tx_impexp[list][]='.rawurlencode($this->table.':'.$this->id)).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,t3lib_extMgm::extRelPath('impexp').'export.gif',' width="18" height="16"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.export',1).'" alt="" />'.
'</a>';
}
// Add "refresh" link:
$theData['up'][]='<a href="'.htmlspecialchars($this->listURL()).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/refresh_n.gif','width="14" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.reload',1).'" alt="" />'.
'</a>';
// Add icon with clickmenu, etc:
if ($this->id) { // If there IS a real page...:
// Setting title of page + the "Go up" link:
$theData[$titleCol].='<br /><span title="'.htmlspecialchars($row['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($row['_thePath'],-$this->fixedL)).'</span>';
$theData['up'][]='<a href="'.htmlspecialchars($this->listURL($row['pid'])).'" onclick="setHighlight('.$row['pid'].')">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/pages_up.gif','width="18" height="16"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" />'.
'</a>';
// Make Icon:
$theIcon = $this->clickMenuEnabled ? $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg,'pages',$this->id) : $iconImg;
} else { // On root-level of page tree:
// Setting title of root (sitename):
$theData[$titleCol].='<br />'.htmlspecialchars(t3lib_div::fixed_lgd_cs($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],-$this->fixedL));
// Make Icon:
$theIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/_icon_website.gif','width="18" height="16"').' alt="" />';
}
// If there is a returnUrl given, add a back-link:
if ($this->returnUrl) {
$theData['up'][]='<a href="'.htmlspecialchars(t3lib_div::linkThisUrl($this->returnUrl,array('id'=>$this->id))).'" class="typo3-goBack">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/goback.gif','width="14" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.goBack',1).'" alt="" />'.
'</a>';
}
// Finally, the "up" pseudo field is compiled into a table - has been accumulated in an array:
$theData['up']='
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>'.implode('</td>
<td>',$theData['up']).'</td>
</tr>
</table>';
// ... and the element row is created:
$out.=$this->addelement(1,$theIcon,$theData,'',$this->leftMargin);
// ... and wrapped into a table and added to the internal ->HTMLcode variable:
$this->HTMLcode.='
<!--
Page header for db_list:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-dblist-top">
'.$out.'
</table>';
return $buttons;
}
/**
typo3/db_list.php (working copy)
require_once (PATH_t3lib.'class.t3lib_pagetree.php');
require_once (PATH_t3lib.'class.t3lib_recordlist.php');
require_once (PATH_t3lib.'class.t3lib_clipboard.php');
require_once (PATH_t3lib.'class.t3lib_parsehtml.php');
require_once ($BACK_PATH.'class.db_list.inc');
require_once ($BACK_PATH.'class.db_list_extra.inc');
$BE_USER->modAccess($MCONF,1);
......
// Start document template object:
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $BACK_PATH;
$this->doc->setModuleTemplate('templates/db_list.html');
$this->doc->docType='xhtml_trans';
// Loading current page record and checking access:
......
$dblist->alternateBgColors=$this->modTSconfig['properties']['alternateBgColors']?1:0;
$dblist->allowedNewTables = t3lib_div::trimExplode(',',$this->modTSconfig['properties']['allowedNewTables'],1);
$dblist->newWizards=$this->modTSconfig['properties']['newWizards']?1:0;
$dblist->pageRow = $this->pageinfo;
$dblist->counter++;
$dblist->MOD_MENU = array('bigControlPanel' => '', 'clipBoard' => '', 'localization' => '');
// Clipboard is initialized:
$dblist->clipObj = t3lib_div::makeInstance('t3lib_clipboard'); // Start clipboard
$dblist->clipObj->initializeClipboard(); // Initialize - reads the clipboard content from the user session
......
$dblist->start($this->id,$this->table,$this->pointer,$this->search_field,$this->search_levels,$this->showLimit);
$dblist->setDispFields();
// Render the page header:
$dblist->writeTop($this->pageinfo);
// Render versioning selector:
$dblist->HTMLcode.= $this->doc->getVersionSelector($this->id);
......
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
} // access
// Begin to compile the whole page, starting out with page header:
$this->content='';
$this->content.=$this->doc->startPage('DB list');
$this->content.= '<form action="'.htmlspecialchars($dblist->listURL()).'" method="post" name="dblistForm">';
$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>';
// List Module CSH:
if (!strlen($this->id)) {
$this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_noId', $GLOBALS['BACK_PATH'],'<br/>|');
} elseif (!$this->id) { // zero...:
$this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_root', $GLOBALS['BACK_PATH'],'<br/>|');
}
// Add listing HTML code:
$this->content.= $dblist->HTMLcode;
$this->content.= '<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" /></form>';
// List Module CSH:
if ($this->id) {
$this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module', $GLOBALS['BACK_PATH'],'<br/>|');
}
// 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->content.=$dblist->fieldSelectBox($dblist->table);
$this->body.=$dblist->fieldSelectBox($dblist->table);
}
// Adding checkbox options for extended listing and clipboard display:
$this->content.='
$this->body.='
<!--
Listing options for clipboard and thumbnails
......
<div id="typo3-listOptions">
<form action="" method="post">';
$this->content.=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 />';
$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->content.=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[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->content.=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->content.='
$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->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_options', $GLOBALS['BACK_PATH']);
$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->content.= $dblist->clipObj->printClipboard();
$this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_clipboard', $GLOBALS['BACK_PATH']);
$this->body.= $dblist->clipObj->printClipboard();
$this->body.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_clipboard', $GLOBALS['BACK_PATH']);
}
// Link for creating new records:
if (!$this->modTSconfig['properties']['noCreateRecordsLink']) {
$this->content.='
<!--
Link for creating a new record:
-->
<div id="typo3-newRecordLink">
<a href="'.htmlspecialchars($this->doc->backPath . 'db_new.php?id='.$this->id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
'<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/new_el.gif','width="11" height="12"').' alt="" />'.
$LANG->getLL('newRecordGeneral',1).
'</a>
</div>';
}
// Search box:
$this->content.=$dblist->getSearchBox();
$this->body.=$dblist->getSearchBox();
// Display sys-notes, if any are found:
$this->content.=$dblist->showSysNotesForPage();
// ShortCut:
if ($BE_USER->mayMakeShortcut()) {
$this->content.='<br/>'.$this->doc->makeShortcutIcon('id,imagemode,pointer,table,search_field,search_levels,showLimit,sortField,sortRev',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']);
}
$this->body.=$dblist->showSysNotesForPage();
}
// Finally, close off the page:
// Setting up the buttons and markers for docheader
$docHeaderButtons = $dblist->getButtons();
$markerArray = 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, $markerArray);
$this->content.= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
/**
typo3/sysext/lang/locallang_mod_web_list.xml (working copy)
<label index="defaultLanguage">Default</label>
<label index="multipleLanguages">All languages</label>
<label index="Localize">Localize to:</label>
<label index="viewRecords">Viewing records of</label>
</languageKey>
</data>
</T3locallang>
typo3/templates/db_list.html (revision 0)
<!-- ###FULLDOC### begin -->
<div class="typo3-fullDoc">
<!-- Page header with buttons, path details and csh -->
<div id="typo3-docheader">
<div id="typo3-docheader-row1">
<div class="buttonsleft">###BUTTONLIST_LEFT###</div>
<div class="buttonsright">###BUTTONLIST_RIGHT###</div>
</div>
<div id="typo3-docheader-row2">
<div class="pagepath">###CSH######PAGEPATH###</div>
<div class="infooptions">###PAGEINFO###</div>
</div>
</div>
<!-- Content of module, for instance listing, info or editing -->
<div id="typo3-docbody">
###CONTENT###
</div>
</div>
<!-- ###FULLDOC### end -->
<!-- ###BUTTON_GROUP_WRAP### -->
<!-- Wrapper for button group -->
<div class="buttongroup">###BUTTONS###</div>
<!-- ###BUTTON_GROUP_WRAP### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUP1### -->###LEVEL_UP######BACK###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUP2### -->###NEW_RECORD######PASTE###<!-- ###BUTTON_GROUP2### -->
<!-- ###BUTTON_GROUP3### -->###VIEW######EDIT######HIDE_UNHIDE######MOVE###<!-- ###BUTTON_GROUP3### -->
<!-- ###BUTTON_GROUP4### -->###CSV######EXPORT###<!-- ###BUTTON_GROUP4### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
<!-- ###BUTTON_GROUP1### -->###CACHE######RELOAD######SHORTCUT###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
typo3/templates/alt_doc.html (revision 0)
<!-- ###FULLDOC### begin -->
<div class="typo3-fullDoc">
<!-- Page header with buttons, path details and csh -->
<div id="typo3-docheader">
<div id="typo3-docheader-row1">
<div class="buttonsleft">###BUTTONLIST_LEFT###</div>
<div class="buttonsright">###BUTTONLIST_RIGHT###</div>
</div>
<div id="typo3-docheader-row2">
<div class="pagepath">###CSH######PAGEPATH###</div>
<div class="infooptions">###LANGSELECTOR######PAGEINFO###</div>
</div>
###EXTRAHEADER###
</div>
<!-- Content of module, for instance listing, info or editing -->
<div id="typo3-docbody">
###CONTENT###
</div>
</div>
<!-- ###FULLDOC### end -->
<!-- ###DOCHEADER_EXTRAHEADER### -->
<div id="typo3-docheader-rowextra">###EXTRAHEADER###</div>
<!-- ###DOCHEADER_EXTRAHEADER### -->
<!-- Grouping the icons on top -->
<!-- ###BUTTON_GROUP_WRAP### -->
<div class="buttongroup">###BUTTONS###</div>
<!-- ###BUTTON_GROUP_WRAP### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUP1### -->###CLOSE###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUP2### -->###SAVE######SAVE_VIEW######SAVE_CLOSE######SAVE_NEW###<!-- ###BUTTON_GROUP2### -->
<!-- ###BUTTON_GROUP3### -->###DELETE######UNDO######HISTORY###<!-- ###BUTTON_GROUP3### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
<!-- ###BUTTON_GROUP1### -->###SHORTCUT######COLUMNS_ONLY######OPEN_IN_NEW_WINDOW###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
typo3/templates/alt_doc.html (revision 0)
<!-- ###FULLDOC### begin -->
<div class="typo3-fullDoc">
<!-- Page header with buttons, path details and csh -->
<div id="typo3-docheader">
<div id="typo3-docheader-row1">
<div class="buttonsleft">###BUTTONLIST_LEFT###</div>
<div class="buttonsright">###BUTTONLIST_RIGHT###</div>
</div>
<div id="typo3-docheader-row2">
<div class="pagepath">###CSH######PAGEPATH###</div>
<div class="infooptions">###LANGSELECTOR######PAGEINFO###</div>
</div>
###EXTRAHEADER###
</div>
<!-- Content of module, for instance listing, info or editing -->
<div id="typo3-docbody">
###CONTENT###
</div>
</div>
<!-- ###FULLDOC### end -->
<!-- ###DOCHEADER_EXTRAHEADER### -->
<div id="typo3-docheader-rowextra">###EXTRAHEADER###</div>
<!-- ###DOCHEADER_EXTRAHEADER### -->
<!-- Grouping the icons on top -->
<!-- ###BUTTON_GROUP_WRAP### -->
<div class="buttongroup">###BUTTONS###</div>
<!-- ###BUTTON_GROUP_WRAP### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUP1### -->###CLOSE###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUP2### -->###SAVE######SAVE_VIEW######SAVE_CLOSE######SAVE_NEW###<!-- ###BUTTON_GROUP2### -->
<!-- ###BUTTON_GROUP3### -->###DELETE######UNDO######HISTORY###<!-- ###BUTTON_GROUP3### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
<!-- ###BUTTON_GROUP1### -->###SHORTCUT######COLUMNS_ONLY######OPEN_IN_NEW_WINDOW###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
typo3/templates/db_list.html (revision 0)
<!-- ###FULLDOC### begin -->
<div class="typo3-fullDoc">
<!-- Page header with buttons, path details and csh -->
<div id="typo3-docheader">
<div id="typo3-docheader-row1">
<div class="buttonsleft">###BUTTONLIST_LEFT###</div>
<div class="buttonsright">###BUTTONLIST_RIGHT###</div>
</div>
<div id="typo3-docheader-row2">
<div class="pagepath">###CSH######PAGEPATH###</div>
<div class="infooptions">###PAGEINFO###</div>
</div>
</div>
<!-- Content of module, for instance listing, info or editing -->
<div id="typo3-docbody">
###CONTENT###
</div>
</div>
<!-- ###FULLDOC### end -->
<!-- ###BUTTON_GROUP_WRAP### -->
<!-- Wrapper for button group -->
<div class="buttongroup">###BUTTONS###</div>
<!-- ###BUTTON_GROUP_WRAP### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUP1### -->###LEVEL_UP######BACK###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUP2### -->###NEW_RECORD######PASTE###<!-- ###BUTTON_GROUP2### -->
<!-- ###BUTTON_GROUP3### -->###VIEW######EDIT######HIDE_UNHIDE######MOVE###<!-- ###BUTTON_GROUP3### -->
<!-- ###BUTTON_GROUP4### -->###CSV######EXPORT###<!-- ###BUTTON_GROUP4### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
<!-- ###BUTTON_GROUP1### -->###CACHE######RELOAD######SHORTCUT###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
(15-15/19)