Skip to content

Instantly share code, notes, and snippets.

@kitsunet
Forked from anonymous/gist:1852652
Created February 17, 2012 11:20
Show Gist options
  • Save kitsunet/1852771 to your computer and use it in GitHub Desktop.
Save kitsunet/1852771 to your computer and use it in GitHub Desktop.
T3.Content.UI.PageTreeButton = T3.Content.UI.PopoverButton.extend({
popoverTitle: 'Page Tree',
$popoverContent: $('<div class="extjs-container"><div class="t3-dd-newpage">New page</div><div id="pagetree"></div><div class="t3-dd-deletionzone" id="ext-gen68">Drop here to delete</div></div>'),
_tree: null,
onPopoverOpen: function() {
if (this._tree) return;
this.tree = $("#pagetree").dynatree({
/**
* Wrapper for extDirect call to NodeController which
* adds the child node type to the extDirect call as 2nd parameter.
*/
onPostInit: function() {
TYPO3_TYPO3_Service_ExtDirect_V1_Controller_NodeController.getChildNodesForTree('/sites/phoenixdemotypo3org@user-admin', 'TYPO3.TYPO3:Page', this._onAfterLoad);
//TYPO3_TYPO3_Service_ExtDirect_V1_Controller_NodeController.getChildNodesForTree(contextNodePath, 'TYPO3.TYPO3:Page', callback);
},
_onAfterLoad: function(result, response, args) {
if (response.status) {
this.handleResponse({
responseData: Ext.isArray(result.data) ? result.data : null,
responseText: result,
argument: args
});
} else {
this.handleFailure({
argument: args
});
}
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment