Project

General

Profile

Bug #18289 » pagetree_filter_docheader.diff

Administrator Admin, 2008-02-27 10:12

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:cms/layout/locallang.xml:newPage',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.xml: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'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH']) . $this->getFilterBox();
$markers = array(
'STYLE' => $GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] ? ' style="display:none;"' : '',
'IMG_RESET' => '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/close_gray.gif', ' width="16" height="16"').' 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) {
$filterBox = '
<a href="#" id="toggleTreeFilter">
<img' . t3lib_iconWorks::skinImg('', $GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] ? 'gfx/arrowright.gif' : 'gfx/arrowdown.gif') . ' title="show filter" alt="" />
<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)
refresh: function() {
var r = new Date();
// randNum is useful so pagetree does not get cached in browser cache when refreshing
window.location.href = '?randNum=' + r.getTime();
window.location.search = '?randNum=' + r.getTime();
},
// attaches the events to the elements needed for the drag and drop (for the titles and the icons)
......
for (var i = 0; i < classes.length; i++)
Element.removeClassName(obj, classes[i]);
}
// Set the new item
top.fsMod.navFrameHighlightedID[frameSetModule] = highlightID;
if ($(highlightID)) Element.addClassName(highlightID, this.highlightClass);
......
* Toggles visability of the filter box
*/
toggleFilter: function() {
var filterBox = $('typo3-docheader-row2');
var filterBox = $('treeFilterBox');
var state = filterBox.visible();
// save state
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, body#ext-setup-mod-index-php, body#typo3-mod-user-ws-index-php, body#typo3-mod-user-ws-workspaceforms-php, body#typo3-mod-php, body#ext-tsconfig-help-mod1-index-php, body#typo3-mod-tools-em-index-php, body#ext-lowlevel-dbint-index-php, body#ext-lowlevel-config-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%; }
/****************************************
* SPECIFIC WRAPPERS
*
......
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; }
DIV#treeFilterBox { position: absolute; z-index: 3; top: 22px; width: 260px; height: 27px; background: #fff url('gfx/filter_bg.gif') no-repeat 2px -2px; }
DIV#searchBubble { padding-left: 10px; }
input#treeFilter { height: 12px; width: 160px; margin: 6px 0 0 30px !important; border: 0; background-color:#f3f3f9; }
img#treeFilterReset { border: 0; position:absolute; top:6px;left:194px; cursor: pointer; visibility: hidden; }
#toggleTreeFilter span {font-weight:bold; margin-left:-4px; font-size:12px;}
#typo3-pagetree #typo3-docheader img {margin:2px 1px;}
......
/* 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; }
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### -->
(2-2/4)