Project

General

Profile

Bug #17882 ยป 20071215_dragdropcode.patch

Administrator Admin, 2007-12-15 22:26

View differences:

typo3/alt_db_navframe.php (working copy)
$this->doc->backPath = $BACK_PATH;
$this->doc->docType = 'xhtml_trans';
// Adding javascript code for AJAX (prototype), drag&drop and the pagetree
$this->doc->loadJavascriptLib('contrib/prototype/prototype.js');
$this->doc->loadJavascriptLib('tree.js');
// Adding javascript code for AJAX (prototype), drag&drop and the pagetree as well as the click menu code
$this->doc->getDragDropCode('pages');
$this->doc->getContextMenuCode();
$this->doc->JScode .= $this->doc->wrapScriptTags(
($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
......
Tree.thisScript = "'.$this->pagetree->thisScript.'";
'.($this->doHighlight ? 'Tree.highlightClass = "'.$hlClass.'";' : '').'
DragDrop.changeURL = "'.$this->backPath.'alt_clickmenu.php";
DragDrop.backPath = "'.t3lib_div::shortMD5(''.'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']).'";
DragDrop.table = "pages";
// Function, loading the list frame from navigation tree:
function jumpTo(id, linkObj, highlightID, bank) { //
var theUrl = top.TS.PATH_typo3 + top.currentSubScript + "?id=" + id;
......
'.($this->cMR?"jumpTo(top.fsMod.recentIds['web'],'');":'').'
');
// Click menu code is added:
$this->doc->getContextMenuCode();
$this->doc->bodyTagId = 'bodyTag';
}
}
......
$this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH']);
// Adding javascript for drag & drop activation and highlighting
$this->content .=$this->doc->wrapScriptTags('
$this->content .= $this->doc->wrapScriptTags('
'.($this->doHighlight ? 'Tree.highlightActiveItem("",top.fsMod.navFrameHighlightedID["web"]);' : '').'
'.(!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();')
);
typo3/alt_file_navframe.php (working copy)
$this->doc->backPath = $BACK_PATH;
$this->doc->docType = 'xhtml_trans';
// Adding javascript code for AJAX (prototype), drag&drop and the pagetree
$this->doc->JScode = '
<script type="text/javascript" src="'.$this->backPath.'contrib/prototype/prototype.js"></script>
<script type="text/javascript" src="'.$this->backPath.'tree.js"></script>'."\n";
// Adding javascript code for AJAX (prototype), drag&drop and the filetree as well as the click menu code
$this->doc->getDragDropCode('folders');
$this->doc->getContextMenuCode();
// Setting JavaScript for menu.
$this->doc->JScode .= $this->doc->wrapScriptTags(
......
// setting prefs for pagetree and drag & drop
Tree.thisScript = "'.$this->foldertree->thisScript.'";
DragDrop.changeURL = "'.$this->backPath.'alt_clickmenu.php";
DragDrop.backPath = "'.t3lib_div::shortMD5(''.'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']).'";
DragDrop.table = "folders";
// Function, loading the list frame from navigation tree:
function jumpTo(id, linkObj, highlightID, bank) {
......
}
'.($this->cMR ? " jumpTo(top.fsMod.recentIds['file'],'');" : '')
);
// Click menu code is added:
$this->doc->getContextMenuCode();
}
}
typo3/template.php (working copy)
Clickmenu.clickURL = "'.$this->backPath.'alt_clickmenu.php";
Clickmenu.ajax = '.($this->isCMLayers() ? 'true' : 'false' ).';';
// return array deprecated since 4.2
// return array deprecated since 4.2
return array('','','');
}
/**
* Includes the necessary javascript file (tree.js) for use on pages which have the
* drag and drop functionality (usually pages and folder display trees)
*
* @param string indicator of which table the drag and drop function should work on (pages or folders)
* @return array If values are present: [0] = A <script> section for the HTML page header, [1] = onmousemove/onload handler for HTML tag or alike, [2] = One empty <div> layer for the follow-mouse drag element
*/
function getDragDropCode($table) {
$this->loadJavascriptLib('contrib/prototype/prototype.js');
$this->loadJavascriptLib('tree.js');
// setting prefs for drag & drop
$this->JScodeArray['dragdrop'] = '
DragDrop.changeURL = "'.$this->backPath.'alt_clickmenu.php";
DragDrop.backPath = "'.t3lib_div::shortMD5(''.'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']).'";
DragDrop.table = "'.$table.'";
';
// return array deprecated since 4.2
return array('','','');
}
/**
* Creates a tab menu from an array definition
*
    (1-1/1)