Project

General

Profile

Bug #18130 » 20080206_docheader_pagetree3.diff

Administrator Admin, 2008-02-06 16:58

View differences:

typo3/alt_db_navframe.php (working copy)
// Create template object:
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $BACK_PATH;
$this->doc->setModuleTemplate('templates/alt_db_navframe.html');
$this->doc->docType = 'xhtml_trans';
// get HTML-Template
$this->template = $this->doc->getHtmlTemplate('templates/alt_db_navframe.html');
// Adding javascript code for AJAX (prototype), drag&drop and the pagetree as well as the click menu code
......
// Produce browse-tree:
$tree = $this->pagetree->getBrowsableTree();
// Start page:
$this->content = $this->doc->startPage('TYPO3 Page Tree');
// Outputting workspace info
if ($GLOBALS['BE_USER']->workspace!==0 || $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.onlineWorkspaceInfo')) {
switch($GLOBALS['BE_USER']->workspace) {
case 0:
$wsTitle = ' '.$this->doc->icons(2).'['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_onlineWS',1).']';
break;
case -1:
$wsTitle = '['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_offlineWS',1).']';
break;
default:
$wsTitle = '['.$GLOBALS['BE_USER']->workspace.'] '.htmlspecialchars($GLOBALS['BE_USER']->workspaceRec['title']);
break;
}
$showWorkspaceInfo = true;
}
//prepare onclick links
$onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'db_new.php?id=1&pagesOnly=1\';"';
$docheader = t3lib_parsehtml::getSubpart($this->template, '###DOCHEADER###');
$markers['BUTTONSLEFT'] =
// Filter switch
($this->hasFilterBox ? '
<a href="#" id="toggleTreeFilter">
<img'.t3lib_iconWorks::skinImg('',$GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] ? 'gfx/arrowright.gif' : 'gfx/arrowdown.gif','width="16" height="16"').' title="show filter" alt="" />
<span>'.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:pageTree_filter',1).'</span>
</a>' : '')
;
$markers['BUTTONSRIGHT'] =
// New Page
'<a href="#" onclick="'.$onclickNewPageWizard.'"><img'.t3lib_iconWorks::skinImg('','gfx/new_page.gif','width="13" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh',1).'" alt="" /></a>'.
// Refresh-Icon
'<a href="'.htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')).'"><img'.t3lib_iconWorks::skinImg('','gfx/refresh_n.gif','width="14" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh',1).'" alt="" /></a>'.
// CSH-Icon
t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH'])
;
$markers['STYLE'] = $GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] ? ' style="display:none;"' : '';
$markers['IMG_RESET'] = '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/search_reset.png', ' width="11" height="11"').' id="treeFilterReset" alt="Reset Filter" />';
$this->content .= t3lib_parsehtml::substituteMarkerArray($docheader, $markers, '###|###');
if($showWorkspaceInfo) {
$this->content.= '
<div class="bgColor4 workspace-info">'.
'<a href="'.htmlspecialchars('mod/user/ws/index.php').'" target="content">'.
'<img'.t3lib_iconWorks::skinImg('','gfx/i/sys_workspace.png','width="18" height="16"').' align="top" alt="" />'.
'</a>'.$wsTitle.'
</div>
';
}
// Outputting Temporary DB mount notice:
if ($this->active_tempMountPoint) {
$this->content.= '
......
';
}
// Outputting page tree:
$this->content .= '<div id="PageTreeDiv">'.$tree.'</div>';
......
'.($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();
$docHeaderButtons['filterbox'] = $this->getFilterBox();
$filterVisible = isset($GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox']) ? $GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] : 1;
$markers = array(
'STYLE' => $filterVisible ? ' style="display:none;"' : '',
'IMG_RESET' => '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/search_reset.png', ' width="11" height="11"').' id="treeFilterReset" alt="Reset Filter" />',
'WORKSPACEINFO' => $this->getWorkspaceInfo(),
'CONTENT' => $this->content
);
// Build the <body> for the module
$this->content = $this->doc->startPage('TYPO3 Page Tree');
$this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
$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;
}
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array all available buttons as an assoc. array
*/
private function getButtons() {
global $LANG;
$buttons = array(
'csh' => '',
'new_page' => '',
'refresh' => '',
);
// New Page
$onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'db_new.php?id=1&pagesOnly=1\';"';
$buttons['new_page'] = '<a href="#" onclick="' . $onclickNewPageWizard . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/new_page.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh', 1) . '" alt="" /></a>';
// Refresh
$buttons['refresh'] = '<a href="' . htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')) . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/refresh_n.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh', 1) . '" alt="" /></a>';
// CSH
$buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH']);
return $buttons;
}
/**
* Create the workspace information
*
* @return string HTML containing workspace info
*/
private function getWorkspaceInfo() {
global $LANG;
if ($GLOBALS['BE_USER']->workspace!==0 || $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.onlineWorkspaceInfo')) {
switch($GLOBALS['BE_USER']->workspace) {
case 0:
$wsTitle = '&nbsp;'.$this->doc->icons(2).'['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_onlineWS',1).']';
break;
case -1:
$wsTitle = '['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_offlineWS',1).']';
break;
default:
$wsTitle = '['.$GLOBALS['BE_USER']->workspace.'] '.htmlspecialchars($GLOBALS['BE_USER']->workspaceRec['title']);
break;
}
$workspaceInfo = '
<a href="'.htmlspecialchars('mod/user/ws/index.php').'" target="content">'.
'<img'.t3lib_iconWorks::skinImg('','gfx/i/sys_workspace.png','width="18" height="16"').' align="top" alt="" />'.
'</a>'.$wsTitle.'
';
}
return $workspaceInfo;
}
/**
* Create the filter box
*
* @return string HTML for filter box
*/
private function getFilterBox() {
global $LANG;
if($this->hasFilterBox) {
$filterVisible = isset($GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox']) ? $GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] : 1;
$filterBox = '
<a href="#" id="toggleTreeFilter"'.($filterVisible ? ' class="collapsed"' : ' class="expanded"').'>
<span>' . $LANG->sL('LLL:EXT:lang/locallang_misc.xml:pageTree_filter', 1) . '</span>
</a>
';
}
return $filterBox;
}
/**********************************
*
* Temporary DB mounts
typo3/js/tree.js (working copy)
if (state) {
Effect.BlindUp(filterBox, {duration : 0.2});
this.toggleFilterBoxIcon.src = 'gfx/arrowright.gif';
$('toggleTreeFilter').removeClassName('expanded');
$('toggleTreeFilter').addClassName('collapsed');
this.resetSearchField();
} else {
Effect.BlindDown(filterBox, {duration : 0.1});
this.toggleFilterBoxIcon.src = 'gfx/arrowdown.gif';
Effect.BlindDown(filterBox, {duration : 0.2});
$('toggleTreeFilter').removeClassName('collapsed');
$('toggleTreeFilter').addClassName('expanded');
}
},
typo3/stylesheet.css (working copy)
background-color: #9BA1A8;
}
body#typo3-alt-doc-php, body#typo3-db-list-php, body#ext-cms-layout-db-layout-php, body#ext-tstemplate-ts-index-php, body#typo3-mod-web-perm-index-php, body#typo3-mod-web-info-index-php, body#typo3-mod-web-func-index-php, body#ext-version-cm1-index-php { padding: 0; margin: 0; overflow: hidden; height: 100%; }
body#typo3-alt-doc-php, body#typo3-db-list-php, body#ext-cms-layout-db-layout-php, body#ext-tstemplate-ts-index-php, body#typo3-mod-web-perm-index-php, body#typo3-mod-web-info-index-php, body#typo3-mod-web-func-index-php, body#ext-version-cm1-index-php, body#typo3-pagetree { padding: 0; margin: 0; overflow: hidden; height: 100%; }
/****************************************
......
UL.tree LI.active UL, UL.tree UL LI.active UL { background-color: #f7f3ef; }
#dragIcon { z-index: 1; position: absolute; visibility: hidden; filter: alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; white-space: nowrap; }
div#treeFilterBox { background: url('gfx/search_bubble.png') no-repeat 8px 0; padding-left: 10px; }
input#treeFilter { height: 12px; width: 120px; margin: 4px 0 0 18px !important; border: 0; }
img#treeFilterReset { border: 0; margin: 5px 0 0 !important; cursor: pointer; visibility: hidden; }
#toggleTreeFilter span {font-weight:bold; margin-left:-4px; font-size:12px;}
DIV#treeFilterBox { position: absolute; z-index: 3; top: 20px; width: 260px; height: 29px; background-color:#edeeee;}
DIV#searchBubble { background: transparent url('gfx/search_bubble.png') no-repeat 8px 4px; padding-left: 10px; }
input#treeFilter { height: 12px; width: 120px; margin: 7px 0 0 18px !important; border: 0; }
img#treeFilterReset { border: 0; margin: 8px 0 0 !important; cursor: pointer; visibility: hidden; }
#toggleTreeFilter { padding-top:5px;}
#toggleTreeFilter span {font-weight:bold; font-size:12px;padding-left:16px;}
#toggleTreeFilter.collapsed {background: transparent url('gfx/arrowright.gif') no-repeat 0 2px; }
#toggleTreeFilter.expanded {background: transparent url('gfx/arrowdown.gif') no-repeat 0 2px; }
#typo3-pagetree #typo3-docheader img {margin:2px 1px;}
#treeRoot {
margin-top: 6px;
}
......
/* Workspace */
div.workspace-info {
padding: 0px 2px 0px 2px;
margin: 2px 0px 4px 0px;
border: 1px solid #999;
}
.ver-element, UL.tree UL LI.ver-element { background-color: #ccddcc; }
.ver-page, UL.tree UL LI.ver-page { background-color: #ccccff; }
.ver-branch, UL.tree UL LI.ver-branch { background-color: #ffcccc; }
......
H2,H3,H4,DIV { border: 1px dotted #666; }
*/
typo3/templates/alt_db_navframe.html (working copy)
<!-- ###DOCHEADER### -->
<!-- Page header with buttons for saving & closing and path details -->
<!-- ###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">###BUTTONSLEFT###</div>
<div class="buttonsright">###BUTTONSRIGHT###</div>
<div class="buttonsleft">###BUTTONLIST_LEFT###</div>
<div class="buttonsright">###BUTTONLIST_RIGHT###</div>
</div>
<div id="typo3-docheader-row2"###STYLE###>
<div id="treeFilterBox">
<input type="text" value="" name="treeFilter" id="treeFilter" />
###IMG_RESET###
<div id="typo3-docheader-row2">
<div id="treeFilterBox" class="bgColor4" ###STYLE###>
<div id="searchBubble">
<input type="text" value="" name="treeFilter" id="treeFilter" />
###IMG_RESET###
</div>
</div>
<div id="workspaceInfo">
###WORKSPACEINFO###
</div>
</div>
</div>
<!-- ###DOCHEADER### -->
<!-- Content of module, for instance listing, info or editing -->
<div id="typo3-docbody">
###CONTENT###
</div>
</div>
<!-- ###FULLDOC### end -->
<!-- Grouping the icons on top -->
<!-- ###BUTTON_GROUP_WRAP### -->
<div class="buttongroup">###BUTTONS###</div>
<!-- ###BUTTON_GROUP_WRAP### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUP4### -->###FILTERBOX###<!-- ###BUTTON_GROUP4### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
<!-- ###BUTTON_GROUP1### -->###NEW_PAGE######REFRESH######CSH###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
(5-5/5)