extending displayAdminToolbarDetailed: Ext question

2 views
Skip to first unread message

Tomek Kott

unread,
Sep 5, 2009, 12:11:35 PM9/5/09
to farcr...@googlegroups.com
Hi All,

In FC5.0, the one link that I liked in that admin tab toolbar was the ability to go directly to the site tab, and land on the node holding the page being edited. This allowed a quick way to add a page without navigating through the site structure (which could take a while if that particular set of nodes had not been loaded yet). So, I set about looking how to add that functionality to the new admin toolbar at the bottom. Since displayAdminToolbarDetail.cfm is housed in /core/webskin/types/, I figure that it should be possible to extend this. I don't currently have access to my dev machine, so i can't check this myself. However, if that is the case, I figured that adding the following button should do it:

<sec:CheckPermission objectid="#stObj.objectid#" typename="#stObj.typename#" permission="Edit">
    <cfif not stObj.typename eq "farCOAPI">
        <cfset editurl = "#application.url.webtop#/#application.url.farcry#/index.cfm?sec=site&rootobjectid=#request.navid#" />
       
        <cfsavecontent variable="html">
            <cfoutput>
                {
                    xtype:"tbbutton",
                    iconCls:"edit_icon",
                    text:"Edit Site",
                    listeners:{
                        "click":{
                            fn:function(){
                                parent.editContent("#editurl#","Edit #stObj.label#",1000,600,true,function(){
                                    // make sure the object is unlocked
                                    Ext.Ajax.request({
                                        url: "#application.url.webtop#/navajo/unlock.cfm?objectid=#stObj.objectid#&typename=#stObj.typename#",
                                        success: function() {
                                            parent.refreshContent();
                                        }
                                    });
                                });
                            }
                        }
                    }
                }
            </cfoutput>
        </cfsavecontent>
        <cfset arrayappend(aActions,html) />
    </cfif>
</sec:CheckPermission>

I believe that this Ext would create a popup box on the same page. I would like, however, to bring up a new tab for this function, but I have any idea how to do that with Ext! I figure it's something to do with the parent.editContent() function; i.e., I would have to replace that with something that brings up a tab), but I don't code in Ext so I don't know!

Anyone done something similar and wants to share their changes?

I've raised this as an improvement request in JIRA here: http://bugs.farcrycms.org/browse/FC-1975. Vote for it if you would like to see it included!

Tomek

Blair McKenzie

unread,
Sep 5, 2009, 7:20:41 PM9/5/09
to farcr...@googlegroups.com
If I recall correctly that function is defined in tray.cfm. Not easy to override. By new tab do you mean a new browser tab? Or something else?

Blair

Tomek Kott

unread,
Sep 7, 2009, 11:53:46 AM9/7/09
to farcr...@googlegroups.com
Yes, I mean a new browser tab. I'll check out ext functions in tray.cfm... thanks for the tip.

Tomek

Blair McKenzie

unread,
Sep 7, 2009, 9:34:23 PM9/7/09
to farcr...@googlegroups.com
In that case you can probably just use window.open(...) instead. editContent is just for the dialog.

Tomek Kott

unread,
Sep 8, 2009, 5:21:29 PM9/8/09
to farcr...@googlegroups.com
I have commented with a solution on this issue:

http://bugs.farcrycms.org/browse/FC-1975.

For group reference:

The following code works when added to displayAdminToolbarDetailed.cfm. If it is added, then line 36 of displayAdminToolbar needs to be changed to "detail":{ index:1, height:170 } (height gets changed).

<sec:CheckPermission objectid="#stObj.objectid#" typename="#stObj.typename#" permission="Edit">
    <cfif not stObj.typename eq "farCOAPI">
        <cfset editurl = "#application.url.webtop#/index.cfm?sec=site&rootobjectid=#request.navid#" />

       
        <cfsavecontent variable="html">
            <cfoutput>
                {
                    xtype:"tbbutton",
                    iconCls:"edit_icon",
                    text:"Edit Site",
                    listeners:{
                        "click":{
                            fn:function(){
                                window.open("#editurl#","Edit #stObj.label#","");

                            }
                        }
                    }
                }
            </cfoutput>
        </cfsavecontent>
        <cfset arrayappend(aActions,html) />
    </cfif>
</sec:CheckPermission>

Tomek
Reply all
Reply to author
Forward
0 new messages