+2008-03-11 Ingo Renner <ingo@typo3.org>
+
+ * fixed bug #7816: New page icon does not honor a selected page, credits Steffen Kamper
+
2008-03-11 Jeff Segars <jeff@webempoweredchurch.org>
* Fixed bug #7794: opendocs causes Javascript error in Internet Explorer (thanks to Steffen Kamper)
);
// New Page
- $onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'db_new.php?id=1&pagesOnly=1\';"';
+ $onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'db_new.php?pagesOnly=1&id=\'+Tree.pageID;"';
$buttons['new_page'] = '<a href="#" onclick="' . $onclickNewPageWizard . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/new_page.gif') . ' title="' . $LANG->sL('LLL:EXT:cms/layout/locallang.xml:newPage', 1) . '" alt="" /></a>';
// Refresh
frameSetModule: null,
activateDragDrop: true,
highlightClass: 'active',
+ pageID: 0,
// reloads a part of the page tree (useful when "expand" / "collapse")
load: function(params, isExpand, obj) {
// selects the activated item again, in case it collapsed and got expanded again
reSelectActiveItem: function() {
obj = $(top.fsMod.navFrameHighlightedID[this.frameSetModule]);
- if (obj) Element.addClassName(obj, this.highlightClass);
+ if (obj) {
+ Element.addClassName(obj, this.highlightClass);
+ this.extractPageIdFromTreeItem(obj.id);
+ }
},
// highlights an active list item in the page tree and registers it to the top-frame
// used when loading the page for the first time
highlightActiveItem: function(frameSetModule, highlightID) {
this.frameSetModule = frameSetModule;
+ this.extractPageIdFromTreeItem(highlightID);
// Remove all items that are already highlighted
obj = $(top.fsMod.navFrameHighlightedID[frameSetModule]);
// Set the new item
top.fsMod.navFrameHighlightedID[frameSetModule] = highlightID;
if ($(highlightID)) Element.addClassName(highlightID, this.highlightClass);
+ },
+
+ //extract pageID from the given id (pagesxxx_y_z where xxx is the ID)
+ extractPageIdFromTreeItem: function(highlightID) {
+ if(highlightID) {
+ this.pageID = highlightID.split('_')[0].substring(5);
+ }
}
};