Commit fb76da13 authored by Robert Lemke's avatar Robert Lemke
Browse files

2005-04-04 Robert Lemke <robert@typo3.org>

	+ Added a preliminary way for moving containers in a flexform section in TCEforms + TCEmain. Before you could only delete containers.
	+ Added Sebastian Kurf�rst's collapsable modules feature for the backend's module bar


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@597 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 16c7c71c
2005-04-04 Robert Lemke <robert@typo3.org>
+ Added a preliminary way for moving containers in a flexform section in TCEforms + TCEmain. Before you could only delete containers.
+ Added Sebastian Kurfürst's collapsable modules feature for the backend's module bar
2005-04-04 Kasper Skårhøj,,, <kasper@typo3.com>
* Added to-top/up/down/to_bottom bottoms for the select/group element. up/down will show up by default, to-top and to-bottom will appear automatically when the SIZE of the selector is >= 5.
......@@ -36,7 +40,7 @@
* TYPO3 seems to prefer "mediumblob" instead of "MEDIUMBLOB", thus I changed that in typo3/sysext/cms/ext_tables.sql
* Added hook in tslib_fe
2005-03-28 Michael Stucki <michael@typo3.org>
* Corrected a typo in fe_adminLib.inc (Ingmar watch this!)
......
......@@ -2050,6 +2050,7 @@ class t3lib_TCEforms {
$rowCells['formEl']='';
if ($value['type']=='array') {
if ($value['section']) {
// Render "NEW [container]" selectorbox:
if (is_array($value['el'])) {
$opt=array();
$opt[]='<option value=""></option>';
......@@ -2114,6 +2115,8 @@ class t3lib_TCEforms {
$tRows[]='<tr class="bgColor2">
<td nowrap="nowrap" valign="top">'.
'<input name="_DELETE_FLEX_FORM'.$PA['itemFormElName'].$formPrefix.'" type="checkbox" value="1" /><img src="'.$this->backPath.'gfx/garbage.gif" border="0" alt="" />'.
'<input name="_MOVEUP_FLEX_FORM'.$PA['itemFormElName'].$formPrefix.'" type="checkbox" value="1" /><img src="'.$this->backPath.'gfx/button_up.gif" border="0" alt="" />'.
'<input name="_MOVEDOWN_FLEX_FORM'.$PA['itemFormElName'].$formPrefix.'" type="checkbox" value="1" /><img src="'.$this->backPath.'gfx/button_down.gif" border="0" alt="" />'.
$rowCells['title'].'</td>
<td>'.$rowCells['formEl'].'</td>
</tr>';
......
......@@ -1736,15 +1736,30 @@ class t3lib_TCEmain {
$xmlValue = $this->checkValue_flexArray2Xml($arrValue);
}
// Temporary fix to delete elements:
// Temporary fix to delete flex form elements:
$deleteCMDs = t3lib_div::_GP('_DELETE_FLEX_FORMdata');
if (is_array($deleteCMDs[$table][$id][$field]['data'])) {
$arrValue = t3lib_div::xml2array($xmlValue);
$this->_DELETE_FLEX_FORMdata($arrValue['data'],$deleteCMDs[$table][$id][$field]['data']);
$xmlValue = $this->checkValue_flexArray2Xml($arrValue);
}
// Temporary fix to move flex form elements up:
$moveCMDs = t3lib_div::_GP('_MOVEUP_FLEX_FORMdata');
if (is_array($moveCMDs[$table][$id][$field]['data'])) {
$arrValue = t3lib_div::xml2array($xmlValue);
$this->_MOVE_FLEX_FORMdata($arrValue['data'],$moveCMDs[$table][$id][$field]['data'], 'up');
$xmlValue = $this->checkValue_flexArray2Xml($arrValue);
}
// Temporary fix to move flex form elements down:
$moveCMDs = t3lib_div::_GP('_MOVEDOWN_FLEX_FORMdata');
if (is_array($moveCMDs[$table][$id][$field]['data'])) {
$arrValue = t3lib_div::xml2array($xmlValue);
$this->_MOVE_FLEX_FORMdata($arrValue['data'],$moveCMDs[$table][$id][$field]['data'], 'down');
$xmlValue = $this->checkValue_flexArray2Xml($arrValue);
}
// Create the value XML:
$res['value']='';
$res['value'].='<?xml version="1.0" encoding="'.$storeInCharset.'" standalone="yes" ?>'.chr(10);
......@@ -1773,11 +1788,11 @@ class t3lib_TCEmain {
}
/**
* [Describe function...]
* Deletes a flex form element
*
* @param [type] $$valueArrayToRemoveFrom: ...
* @param [type] $deleteCMDS: ...
* @return [type] ...
* @param array &$valueArrayToRemoveFrom: by reference
* @param [type] $deleteCMDS: ... *
* @return void
*/
function _DELETE_FLEX_FORMdata(&$valueArrayToRemoveFrom,$deleteCMDS) {
if (is_array($valueArrayToRemoveFrom) && is_array($deleteCMDS)) {
......@@ -1791,7 +1806,43 @@ class t3lib_TCEmain {
}
}
/**
* Deletes a flex form element
*
* @param array &$valueArrayToMoveIn: by reference
* @param [type] $moveCMDS: ... *
* @param string $direction: 'up' or 'down'
* @return void
* TODO: Like _DELETE_FLEX_FORMdata, this is only a temporary solution!
*/
function _MOVE_FLEX_FORMdata(&$valueArrayToMoveIn, $moveCMDS, $direction) {
if (is_array($valueArrayToMoveIn) && is_array($moveCMDS)) {
// Only execute the first move command:
list ($key, $value) = each ($moveCMDS);
if (is_array($moveCMDS[$key])) {
$this->_MOVE_FLEX_FORMdata($valueArrayToMoveIn[$key],$moveCMDS[$key], $direction);
} else {
switch ($direction) {
case 'up':
if ($key > 1) {
$tmpArr = $valueArrayToMoveIn[$key];
$valueArrayToMoveIn[$key] = $valueArrayToMoveIn[$key-1];
$valueArrayToMoveIn[$key-1] = $tmpArr;
}
break;
case 'down':
if ($key < count($valueArrayToMoveIn)) {
$tmpArr = $valueArrayToMoveIn[$key];
$valueArrayToMoveIn[$key] = $valueArrayToMoveIn[$key+1];
$valueArrayToMoveIn[$key+1] = $tmpArr;
}
break;
}
}
}
}
......
......@@ -2,7 +2,7 @@
/***************************************************************
* Copyright notice
*
* (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
* (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......@@ -290,7 +290,9 @@ class SC_alt_main {
*/
var currentlyHighLightedId = "";
var currentlyHighLighted_restoreValue = "";
var currentlyHighLightedMain = "";
function highlightModuleMenuItem(trId, mainModule) { //
currentlyHighLightedMain = mainModule;
// Get document object:
if (top.menu && top.menu.document) {
var docObj = top.menu.document;
......@@ -315,6 +317,16 @@ class SC_alt_main {
}
}
/**
* Function restoring previous selection in left menu after clearing cache
*/
function restoreHighlightedModuleMenuItem() {
if (currentlyHighLightedId) {
highlightModuleMenuItem(currentlyHighLightedId,currentlyHighLightedMain);
}
}
/**
* Function used to switch switch module.
*/
......
......@@ -2,7 +2,7 @@
/***************************************************************
* Copyright notice
*
* (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
* (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......@@ -32,6 +32,7 @@
* XHTML-trans compliant
*
* @author Kasper Skaarhoj <kasperYYYY@typo3.com>
* @co-author Sebastian Kurfrst <sebastian@garbage-group.de>
*/
/**
* [CLASS/FUNCTION INDEX of SCRIPT]
......@@ -72,6 +73,7 @@ require_once ('class.alt_menu_functions.inc');
* Script Class for rendering the vertical menu in the left side of the backend frameset
*
* @author Kasper Skaarhoj <kasperYYYY@typo3.com>
* @co-author Sebastian Kurfrst <sebastian@garbage-group.de>
* @package TYPO3
* @subpackage core
*/
......@@ -107,13 +109,13 @@ class SC_alt_menu {
$TBE_TEMPLATE->docType='xhtml_trans';
$TBE_TEMPLATE->divClass='vertical-menu';
$TBE_TEMPLATE->bodyTagAdditions = 'onLoad="top.restoreHighlightedModuleMenuItem()"';
$this->content.=$TBE_TEMPLATE->startPage('Vertical Backend Menu');
$backPath = $GLOBALS['BACK_PATH'];
// Printing the menu
$alt_menuObj = t3lib_div::makeInstance('alt_menu_functions');
$this->content.= $alt_menuObj->topMenu($this->loadModules->modules);
$this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'menu_modules', $GLOBALS['BACK_PATH']);
// clear cache commands for Admins
if($BE_USER->isAdmin()) {
......
......@@ -2,7 +2,7 @@
/***************************************************************
* Copyright notice
*
* (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
* (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......@@ -42,13 +42,13 @@
*
* 73: class alt_menu_functions
* 94: function topMenu($theModules,$dontLink=0,$backPath='',$descr=0)
* 405: function getNavFramePrefix ($moduleInfo, $subModuleInfo=array())
* 435: function mIconFile($Ifilename,$backPath)
* 450: function mIconFilename($Ifilename,$backPath)
* 462: function topButtons()
* 474: function adminButtons()
* 493: function adminFunctions($backPath)
* 526: function wrapLinkWithAB($link)
* 402: function getNavFramePrefix ($moduleInfo, $subModuleInfo=array())
* 429: function mIconFile($Ifilename,$backPath)
* 444: function mIconFilename($Ifilename,$backPath)
* 456: function topButtons()
* 468: function adminButtons()
* 487: function adminFunctions($backPath)
* 520: function wrapLinkWithAB($link)
*
* TOTAL FUNCTIONS: 8
* (This index is automatically created/updated by the extension "extdeveval")
......@@ -94,6 +94,11 @@ class alt_menu_functions {
function topMenu($theModules,$dontLink=0,$backPath='',$descr=0) {
global $LANG, $TBE_TEMPLATE, $BE_USER;
// By default module sections are collapsable, only if they are explicitly turned off via TSconfig, they are not:
$tmpArr = $BE_USER->getTSConfig('options.moduleMenuCollapsable');
$collapsable = ($tmpArr['value'] ? 0 : 1);
unset($tmpArr);
// Initialize vars:
$final='';
$menuCode='';
......@@ -112,6 +117,34 @@ class alt_menu_functions {
unset($theModules['doc']);
}
// Get collapsed configuration
if ($collapsable == 1) {
$config = is_array ($BE_USER->uc['moduleData']['alt_menu.php']) ? $BE_USER->uc['moduleData']['alt_menu.php'] : array();
$collapsedOverride = t3lib_div::_GP('collapsedOverride');
if (is_array ($collapsedOverride)) {
$config = array_merge ($config, $collapsedOverride);
}
if (t3lib_div::_GP('collapsableExpandAll') == 1) {
$config['expandAll'] = t3lib_div::_GP('expandAll');
}
if ($config['expandAll'] && is_array($collapsedOverride)) {
$config = $collapsedOverride;
}
$BE_USER->uc['moduleData']['alt_menu.php'] = $config;
$BE_USER->writeUC($BE_USER->uc);
// all items have to be expanded when expandAll is set
if($config['expandAll'] == 1) {
foreach($config as $key => $value) {
if($key != 'expandAll')
$config[$key] = 0;
}
}
}
// Traverse array with modules
reset($theModules);
while(list($moduleName,$moduleInfo)=each($theModules)) {
......@@ -139,8 +172,6 @@ class alt_menu_functions {
$link_sub = 0;
}
$link = t3lib_div::resolveBackPath($link);
$moduleKey = $moduleName.'_tab';
$moduleCSSId = 'ID_'.t3lib_div::md5int($moduleName);
......@@ -173,10 +204,19 @@ class alt_menu_functions {
$selectItems[] = '<option value="top.goToModule(\''.$moduleName.'\');">'.htmlspecialchars($LANG->moduleLabels['tabs'][$moduleKey]).'</option>';
$label='&nbsp;<b>'.$label.'</b>&nbsp;';
// make menu collapsable
if($collapsable == 1 && is_array($moduleInfo['sub'])) {
$collapseJS = 'onclick="window.location.href=\'alt_menu.php?collapsedOverride['.$moduleName.']='.($config[$moduleName] ? '0' : '1').'\'"';
$collapseIcon = '<span class="c-iconCollapse"><img'.t3lib_iconWorks::skinImg($backPath,'gfx/ol/'.($config[$moduleName] ? 'plusbullet.gif':'minusbullet.gif'),'width="18" height="16"').' title="" alt="" /></span>';
} else {
$collapseJS = $collapseIcon = '';
}
// Creating a main item for the vertical menu (descr=0)
$menuCode.='
<tr class="c-mainitem" id="'.$moduleCSSId.'">
<td colspan="3">'.$imageCode.'<span class="c-label">'.$label.'</span></td>
<td colspan="3" '.$collapseJS.' >'.$imageCode.'<span class="c-label">'.$label.'</span>'.$collapseIcon.'</td>
</tr>';
// Code for "About modules"
......@@ -186,9 +226,12 @@ class alt_menu_functions {
</tr>';
// Hide submodules when collapsed:
if($collapsable == 1 && $config[$moduleName] == 1 && $descr == 0 && $config['expandAll'] != 1) {
unset($moduleInfo['sub']);
}
// Travesing submodules
// Traversing submodules
$subCode='';
if (is_array($moduleInfo['sub'])) {
reset($moduleInfo['sub']);
......@@ -205,7 +248,7 @@ class alt_menu_functions {
</tr>';
}
$link = t3lib_div::resolveBackPath($subInfo['script']);
$link = $subInfo['script'];
$prefix=$this->getNavFramePrefix ($moduleInfo, $subInfo);
$subKey = $moduleName.'_'.$subName.'_tab';
......@@ -249,8 +292,7 @@ class alt_menu_functions {
if (!$BE_USER->uc['condensedMode'] && $moduleInfo['navFrameScript']) {
// use special nav script from sub module, otherwise from the main module
$subNavFrameScript = $subInfo['navFrameScript'] ? $subInfo['navFrameScript'] : $moduleInfo['navFrameScript'];
$subNavFrameScript = t3lib_div::resolveBackPath($subNavFrameScript);
$subNavFrameScript = $subInfo['navFrameScript'] ? $subInfo['navFrameScript'] : $moduleInfo['navFrameScript'] ;
// add GET params for sub module to the nav script
$subNavFrameScript = $this->wrapLinkWithAB($subNavFrameScript).$subInfo['navFrameScriptParam'];
......@@ -333,6 +375,21 @@ class alt_menu_functions {
// $descr==0: Ordinary vertical menu
if ($menuCode) {
if($collapsable == 1 || $config['expandAll'] == 1) {
$collapseAllHTML = '<tr class="c-endrow">
<td></td>
<td align="center">
<form action="alt_menu.php" method="get">
<input type="hidden" name="collapsableExpandAll" value="1" />
<input type="checkbox" name="expandAll" value="1" onclick="this.form.submit();" '.($config['expandAll']?'checked="checked"':'').' />
</form>
</td>
<td class="c-subitem-label">'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.expandAll',1).'</td>
</tr>';
} else {
$collapseAllHTML = '';
}
$final = '
......@@ -341,6 +398,9 @@ class alt_menu_functions {
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-vmenu">
'.$menuCode.'
<tr class="c-endrow">
<td colspan="3">'.t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'menu_modules', $GLOBALS['BACK_PATH']).'</td></tr>
'.$collapseAllHTML.'
</table>';
}
......@@ -408,15 +468,12 @@ class alt_menu_functions {
$prefix = '';
$navFrameScriptParam = $subModuleInfo['navFrameScriptParam'] ? $subModuleInfo['navFrameScriptParam'] : $moduleInfo['navFrameScriptParam'];
if ($moduleInfo['navFrameScript']) {
$navFrameScript = t3lib_div::resolveBackPath($moduleInfo['navFrameScript']);
$navFrameScript = $this->wrapLinkWithAB($navFrameScript);
if ($BE_USER->uc['condensedMode']) {
$prefix=$navFrameScript.$navFrameScriptParam.'&currentSubScript=';
$prefix=$this->wrapLinkWithAB($moduleInfo['navFrameScript']).$navFrameScriptParam.'&currentSubScript=';
} else {
$prefix='alt_mod_frameset.php?'.
'fW="+top.TS.navFrameWidth+"'.
'&nav="+top.TS.PATH_typo3+"'.rawurlencode($navFrameScript.$navFrameScriptParam).
'&nav="+top.TS.PATH_typo3+"'.rawurlencode($this->wrapLinkWithAB($moduleInfo['navFrameScript']).$navFrameScriptParam).
'&script=';
}
}
......
......@@ -218,10 +218,11 @@ TABLE#typo3-about-modules TR.c-mainitem TD IMG { vertical-align: middle; paddin
/* Vertical Module Menu script, left frame (alt_menu.php): */
BODY#typo3-alt-menu-php { margin: 2px 0px 0px 2px; }
BODY#typo3-alt-menu-php A { text-decoration: none; }
TABLE#typo3-vmenu TR.c-mainitem TD { background-color: #D9D9D8; padding: 1px 1px 1px 1px; border: #9BA1A8 1px solid; vertical-align: middle;}
TABLE#typo3-vmenu TR.c-mainitem TD { background-color: #D9D9D8; padding: 1px 1px 1px 1px; border: #9BA1A8 1px solid; vertical-align: middle; width: 100px}
TABLE#typo3-vmenu TR.c-mainitem TD SPAN.c-label A { text-decoration : underline; }
TABLE#typo3-vmenu TR.c-mainitem TD IMG { vertical-align: middle; margin-right: 2px;}
TABLE#typo3-vmenu TR.c-mainitem TD SPAN.c-label { position: relative; top: 1px;}
TABLE#typo3-vmenu TR.c-mainitem TD SPAN.c-iconCollapse { position:absolute; left:90px; cursor:pointer}
TABLE#typo3-vmenu TR.c-mainitem-HL TD { background-color: #AAAAAA; padding: 1px 1px 1px 1px; border: #9BA1A8 1px solid; vertical-align: middle;}
TABLE#typo3-vmenu TR.c-mainitem-HL TD SPAN.c-label A { text-decoration : underline; }
TABLE#typo3-vmenu TR.c-mainitem-HL TD IMG { vertical-align: middle; margin-right: 2px;}
......
......@@ -86,6 +86,7 @@ Do you want to continue WITHOUT saving?</label>
<label index="labels.revertSelection">Revert selection</label>
<label index="labels.setAllCheckboxes">Select All Checkboxes</label>
<label index="labels.changeInOrig">Change in original</label>
<label index="labels.expandAll">Expand all</label>
<label index="ver.online">ONLINE</label>
<label index="ver.mgm">Version Management</label>
<label index="ver.selVer">Select version:</label>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment