Project

General

Profile

Bug #19143 ยป bug_0009033.diff

Administrator Admin, 2010-09-24 17:20

View differences:

htdocs/typo3_src/typo3/sysext/opendocs/class.tx_opendocs.php 2010-09-24 16:20:41.000000000 +0200
$recentDocuments = $this->recentDocs;
$entries = array();
$content = '';
list(, $docDat) = $GLOBALS['BE_USER']->getModuleData('alt_doc.php', 'ses');
if (count($openDocuments)) {
$entries[] = '<tr><th colspan="3">' . $GLOBALS['LANG']->getLL('open_docs', true) . '</th></tr>';
$i = 0;
foreach ($openDocuments as $md5sum => $openDocument) {
$i++;
$entries[] = $this->renderMenuEntry($openDocument, $md5sum, false, ($i == 1));
$entries[] = $this->renderMenuEntry($openDocument, $md5sum, false, ($i == 1), ($docDat == $md5sum));
}
}
......
*
* @return array all recent documents as list-items
*/
public function renderMenuEntry($document, $md5sum, $isRecentDoc = false, $isFirstDoc = false) {
public function renderMenuEntry($document, $md5sum, $isRecentDoc = false, $isFirstDoc = false, $isOpenDoc = false) {
$table = $document[3]['table'];
$uid = $document[3]['uid'];
$record = t3lib_BEfunc::getRecordWSOL($table, $uid);
......
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:rm.closeDoc', true);
// open document
if (!$isOpenDoc) {
$closeIcon = t3lib_iconWorks::getSpriteIcon('actions-document-close');
} else {
$closeIcon = '';
}
$entry = '
<tr class="opendoc' . $firstRow . '">
......
// remove it from the list of the open documents, and store the status
unset($this->openDocs[$md5sum]);
list(, $docDat) = $GLOBALS['BE_USER']->getModuleData('alt_doc.php', 'ses');
$GLOBALS['BE_USER']->pushModuleData('alt_doc.php', array($this->openDocs, $docDat));
$GLOBALS['BE_USER']->pushModuleData('opendocs::recent', $this->recentDocs);
......
$this->renderAjax($params, $ajaxObj);
}
/**
* Checks if the current page's parameters match the parameters stored for the document entry
* in the Open Documents list. If matched, the document is currently open and TRUE is returned
*
* @param string $md5sum
* @return bool TRUE if document is open, otherwise FALSE
*/
public function isDocumentOpen($md5sum) {
$open = FALSE;
#$checkAgainstMD5 =
return (bool) $open;
}
/**
* renders the menu so that it can be returned as response to an AJAX call
*
    (1-1/1)