Project

General

Profile

Bug #18118 » 20080209_new_menu_taskcenter.diff

Administrator Admin, 2008-02-09 17:32

View differences:

typo3/stylesheet.css (working copy)
BODY#typo3-mod-tools-em-index-php TR.unsupported-ext TD A { color: #ff0000; }
BODY#typo3-mod-tools-em-index-php TR TD.extstate { color: #fff; font-weight: bold; text-align: center; }
/* Task Center */
#ext-taskcenter-task-index-php ul.taskcenter-module,ul.taskcenter-module li ul {list-style:none;margin:0;padding:0;}
#ext-taskcenter-task-index-php ul.taskcenter-module li a{cursor:pointer;border:1px solid black;background:#eee;padding:6px 12px;display:block;clear:left;}
#ext-taskcenter-task-index-php ul.taskcenter-module li a.active {background:#aaa;}
#ext-taskcenter-task-index-php ul.taskcenter-module li a:hover {background:#d7dbe2;}
#ext-taskcenter-task-index-php ul.taskcenter-module li ul {margin:5px 0;}
#ext-taskcenter-task-index-php ul.taskcenter-module li ul li {display:block;padding-left:24px;}
#ext-taskcenter-task-index-php ul.taskcenter-module li ul li a {padding:0;border:none;background:transparent;display:inline;}
#ext-taskcenter-task-index-php {height:95%;}
/* Workspace */
div.workspace-info {
padding: 0px 2px 0px 2px;
typo3/sysext/taskcenter/ext_tables.php (working copy)
if (!defined ('TYPO3_MODE')) die ('Access denied.');
if (TYPO3_MODE=='BE') t3lib_extMgm::addModule('user','task','top',t3lib_extMgm::extPath($_EXTKEY).'task/');
?>
$TYPO3_CONF_VARS['BE']['AJAX']['TaskCenter::saveMenuState'] = t3lib_extMgm::extPath($_EXTKEY).'task/class.mod_user_task.php:mod_user_task->ajaxSaveMenuStatus';
?>
typo3/sysext/taskcenter/task/class.mod_user_task.php (working copy)
function urlInIframe($url,$max=0) {
return '<iframe onload="resizeIframe(this,'.$max.');" scrolling="auto" width="100%" src="'.$url.'" name="list_frame" frameborder="no" style="border: none;"></iframe>';
}
function ajaxSaveMenuStatus($params = array(), TYPO3AJAX &$ajaxObj = null) {
$menuid = t3lib_div::_POST('menuid');
$state = t3lib_div::_POST('state') === 'true' ? 0 : 1;
$GLOBALS['BE_USER']->uc['moduleData']['TaskCenter'][$menuid] = $state;
$GLOBALS['BE_USER']->uc['moduleData']['TaskCenter']['active'] = $menuid;
$GLOBALS['BE_USER']->writeUC();
}
}
// Include extension?
typo3/sysext/taskcenter/task/index.php (working copy)
$this->doc = t3lib_div::makeInstance('noDoc');
$this->doc->docType = 'xhtml_trans';
$this->doc->divClass = '';
$this->doc->form = '<form action="index.php" method="POST" name="editform">';
$this->backPath = $this->doc->backPath = $BACK_PATH;
$this->doc->JScode = ' <script language="javascript" type="text/javascript">
......
'.(is_object($this->extObj)?$this->extObj->JScode():"").'
</script>
';
$this->doc->JScode .= $this->doc->getDynTabMenuJScode();
$this->doc->loadJavascriptLib('contrib/prototype/prototype.js');
$this->doc->JScode .= '<script language="javascript" type="text/javascript">
function resizeIframe(frame,max) {
try {
......
window.status = e.message;
}
}
</script>';
</script>
<script type="text/javascript" src="'.$BACK_PATH.t3lib_extMgm::extRelPath('taskcenter').'TaskCenterMenu.js"></script>
';
/* call getMainContent first, because what happens here might affect leftContent */
$mainContent = $this->getMainContent();
......
//walk through registered submodules and generate configuration
//for tabmenu
$parts = Array();
$i=0;
$output .= '<ul class="taskcenter-module">';
foreach($this->allExtClassConf as $conf) {
$extObj = t3lib_div::makeInstance($conf['name']);
/* call init to make sure the LOCAL_LANG is included for all listed
......
$extObj->mod_user_task_init($GLOBALS['BE_USER']);
$part = $extObj->overview_main();
if (is_array($part)) {
$parts[] = $part;
$parts[$i++] = $part;
$status = intval($GLOBALS['BE_USER']->uc['moduleData']['TaskCenter']['taskcenter-module-header-'.$i]);
$activeID = ($GLOBALS['BE_USER']->uc['moduleData']['TaskCenter']['active'] === 'taskcenter-module-header-'.$i);
$output .='<li class="taskcenter-module-header" id="taskcenter-module-header-'.$i.'"><a href="#"'.($activeID ? ' class="active"' : '').'>'.$part['icon'].'</a>';
if(isset($part['content'])) {
$items=explode('<BR>',$part['content']);
$output .= '<ul'.($status==1 ? ' style="display:none;"' : '').'>';
foreach($items as $item) {
if($item) $output .= '<li>'.$item.'</li>';
}
$output .= '</ul>';
}
$output .= '</li>';
}
}
return $this->doc->getDynTabMenu($parts, 'tx_taskcenter', 1, true);
$output .= '</ul>';
return $output;
}
/**
......
$this->content .= $this->doc->endPage();
echo $this->content;
}
}
typo3/sysext/taskcenter/TaskCenterMenu.js (revision 0)
/***************************************************************
* Copyright notice
*
* (c) 2008 Steffen Kamper <info@sk-typo3.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* class to handle the menu in taskcenter
*
* $Id$
*/
var TaskCenterMenu = Class.create({
/**
* registers for resize event listener and executes on DOM ready
*/
initialize: function() {
Event.observe(window, 'load', function(){
$$('.taskcenter-module-header a').invoke('observe','click', this.toggleMenu.bindAsEventListener(this));
}.bindAsEventListener(this));
},
/**
* toggles the visibility of the menu
*/
toggleMenu: function(event) {
var moduleHeader = Event.element(event);
var moduleID = $(moduleHeader).up('li').id;
var subList = $(moduleHeader).next('ul');
if(!Object.isUndefined(subList)) {
$(subList).toggle();
$$('.taskcenter-module-header a').invoke('removeClassName', 'active');
$(moduleHeader).addClassName('active');
// save state
new Ajax.Request( top.TS.PATH_typo3 + 'ajax.php', {
parameters : 'ajaxID=TaskCenter::saveMenuState&menuid=' + moduleID + '&state=' + $(subList).visible()
});
}
}
});
var TYPO3TaskCenterMenu = new TaskCenterMenu();
(3-3/5)