Bug #18653 ยป 20080519_altclickmenu_deps.patch
typo3/js/clickmenu.js (working copy) | ||
---|---|---|
*/
|
||
var Clickmenu = {
|
||
clickURL: 'alt_clickmenu.php', // URL to the clickmenu.php file, see template.php
|
||
ajax: true, // template.php -> isCMLayers check
|
||
ajax: true, // @deprecated since TYPO3 4.2.1, remove in TYPO3 4.4, as since 4.2 only AJAX calls are available
|
||
mousePos: { X: null, Y: null },
|
||
... | ... | |
/**
|
||
* switch function that either makes an AJAX call
|
||
* or loads the request in the top frame
|
||
* function that does the remote call
|
||
*
|
||
* @param params parameters added to the URL
|
||
* @return nothing
|
||
*/
|
||
callURL: function(params) {
|
||
if (this.ajax && Ajax.getTransport()) { // run with AJAX
|
||
params += '&ajax=1';
|
||
new Ajax.Request(this.clickURL, {
|
||
method: 'get',
|
||
parameters: params,
|
||
onComplete: function(xhr) {
|
||
var response = xhr.responseXML;
|
||
if (!response.getElementsByTagName('data')[0]) return;
|
||
var menu = response.getElementsByTagName('data')[0].getElementsByTagName('clickmenu')[0];
|
||
var data = menu.getElementsByTagName('htmltable')[0].firstChild.data;
|
||
var level = menu.getElementsByTagName('cmlevel')[0].firstChild.data;
|
||
this.populateData(data, level);
|
||
}.bind(this)
|
||
});
|
||
} else { // fallback with no AJAX, no isCMLayers
|
||
top.loadTopMenu(this.clickURL + '?' + params);
|
||
}
|
||
params += '&ajax=1';
|
||
new Ajax.Request(this.clickURL, {
|
||
method: 'get',
|
||
parameters: params,
|
||
onComplete: function(xhr) {
|
||
var response = xhr.responseXML;
|
||
if (!response.getElementsByTagName('data')[0]) return;
|
||
var menu = response.getElementsByTagName('data')[0].getElementsByTagName('clickmenu')[0];
|
||
var data = menu.getElementsByTagName('htmltable')[0].firstChild.data;
|
||
var level = menu.getElementsByTagName('cmlevel')[0].firstChild.data;
|
||
this.populateData(data, level);
|
||
}.bind(this)
|
||
});
|
||
},
|
||
... | ... | |
}
|
||
}
|
||
function showClickmenu_noajax(url) {
|
||
Clickmenu.ajax = false; showClickmenu_raw(url);
|
||
showClickmenu_raw(url);
|
||
}
|
||
function setLayerObj(tableData, cmLevel) {
|
||
Clickmenu.populateData(tableData, cmLevel);
|
typo3/template.php (working copy) | ||
---|---|---|
* Returns true if click-menu layers can be displayed for the current user/browser
|
||
* Use this to test if click-menus (context sensitive menus) can and should be displayed in the backend.
|
||
*
|
||
* @deprecated since TYPO3 4.2.1, remove in TYPO3 4.4, since in the new backend there can only be the CM layers (and AJAX) allowed
|
||
* @return boolean
|
||
*/
|
||
function isCMlayers() {
|
||
... | ... | |
* Please just call this function without expecting a return value for future calls
|
||
*/
|
||
function getContextMenuCode() {
|
||
$this->loadJavascriptLib('contrib/prototype/prototype.js');
|
||
$this->loadJavascriptLib('js/clickmenu.js');
|
||
$this->loadJavascriptLib('contrib/prototype/prototype.js');
|
||
$this->loadJavascriptLib('js/clickmenu.js');
|
||
$this->JScodeArray['clickmenu'] = '
|
||
Clickmenu.clickURL = "'.$this->backPath.'alt_clickmenu.php";
|
||
Clickmenu.ajax = '.($this->isCMLayers() ? 'true' : 'false' ).';';
|
||
if ($this->backPath) {
|
||
$this->JScodeArray['clickmenu'] = '
|
||
Clickmenu.clickURL = "'.$this->backPath.'alt_clickmenu.php";';
|
||
}
|
||
// return array deprecated since 4.2
|
||
return array('','','');
|
||
// return array deprecated since 4.2
|
||
return array('','','');
|
||
}
|
||
/**
|
typo3/backend.php (working copy) | ||
---|---|---|
}
|
||
/**
|
||
* old function from the old backend (where there was a topMenu frame)
|
||
* @deprecated since TYPO3 4.2.1, remove in TYPO3 4.4
|
||
*/
|
||
function loadTopMenu(URL) {
|
||
alert("The function you called is no longer available, and was removed in TYPO3 4.2. \
|
||
This is probably called by an extension that does not use the new TYPO3 Clickmenu API. \
|
||
Please report this to http://bugs.typo3.org \
|
||
with a detailed list on how to reproduce this message and a list of extensions you are currently using. \
|
||
Thank you for your feedback, the TYPO3 Team");
|
||
}
|
||
/**
|
||
* Initialize login expiration warning object
|
||
*/
|
||
var busy = new busy();
|
||
... | ... | |
$TYPO3backend->render();
|
||
?>
|
||
?>
|
typo3/alt_clickmenu.php (working copy) | ||
---|---|---|
var $alwaysContentFrame=0; // If true, the "content" frame is always used for reference (when condensed mode is enabled)
|
||
var $iParts=array(); // Stores the parts of the input $item string, splitted by "|": [0] = table/file, [1] = uid/blank, [2] = flag: If set, listFrame, If "2" then "content frame" is forced [3] = ("+" prefix = disable all by default, enable these. Default is to disable) Items key list
|
||
var $disabledItems=array(); // Contains list of keywords of items to disable in the menu
|
||
var $dontDisplayTopFrameCM=0; // If true, the context sensitive menu will not appear in the top frame, only as a layer.
|
||
var $dontDisplayTopFrameCM = 0; // If set, then the clickmenu will NOT display in the top frame. @deprecated since TYPO3 4.2, remove in TYPO3 4.4, there is no topframe in the new backend anymore
|
||
var $leftIcons=0; // If true, Show icons on the left.
|
||
var $extClassArray=array(); // Array of classes to be used for user processing of the menu content. This is for the API of adding items to the menu from outside.
|
||
var $ajax=0; // enable/disable ajax behavior
|
||
... | ... | |
* @return boolean
|
||
*/
|
||
function doDisplayTopFrameCM() {
|
||
if($this->ajax) {
|
||
return false;
|
||
} else {
|
||
return !$GLOBALS['SOBE']->doc->isCMlayers() || !$this->dontDisplayTopFrameCM;
|
||
}
|
||
return false;
|
||
}
|
||
... | ... | |
* @param array $menuItem array
|
||
* @param array Array with HTML content to be imploded between <td>-tags
|
||
* @return array Array of menu items for top frame.
|
||
* @deprecated in TYPO3 4.2, remove in TYPO3 4.4, there is no topframe anymore in TYPO3 4.2
|
||
*/
|
||
function menuItemsForTopFrame($menuItems) {
|
||
reset($menuItems);
|
||
... | ... | |
* @package TYPO3
|
||
* @subpackage core
|
||
* @see template::getContextMenuCode()
|
||
* @deprecated since TYPO3 4.2, remove in TYPO3 4.4
|
||
*/
|
||
class SC_alt_clickmenu {
|
||