TinyPortal

Development => Support => Topic started by: Lucky13MN on September 10, 2007, 06:04:41 PM

Title: Help with mod and TP in regards to Admin Panel
Post by: Lucky13MN on September 10, 2007, 06:04:41 PM
I'm helping to test a mod for SMF 1.1.3 and part of it includes going into the admin panel.

I have 'hide panels' when in the admin panel checked (so the side bars don't show). However when I click on this modification the side panels show up again.

Is there something the developer needs to add to his code so TP knows it's part of the admin section to keep the side panels from displaying, or is there another file that needs to be edited for this to work?

Thank you for any input you can provide.
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: G6Cad on September 10, 2007, 07:13:35 PM
The developer of the mod have to add in tp_hidebars(); in the source file the mod uses for it's action
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: Lucky13MN on September 10, 2007, 07:38:13 PM
Thank you, I'll pass that along! Hopefully it makes more sense to him than it does me  ???
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: rrasco on September 10, 2007, 08:10:02 PM
Would this work in checking for a TP installation?

if(isset($context['TPortal'])) {
        tp_hidebars();
    }
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: IchBin on September 10, 2007, 11:31:20 PM
You don't need a check if you are putting it in the Sources file. Simply tp_hidebars(); will make the bars disappear.
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: rrasco on September 11, 2007, 03:27:50 PM
Quote from: IchBinâ,,¢ on September 10, 2007, 11:31:20 PM
You don't need a check if you are putting it in the Sources file. Simply tp_hidebars(); will make the bars disappear.

What about boards that do not have TP installed?  Won't it error out undefined?  This is not a TP only mod.
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: G6Cad on September 11, 2007, 03:41:13 PM
No it will not, and the best way to find out is to actually test your way through, when you are creating a mod, you have to test it to ;)
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: rrasco on September 11, 2007, 04:31:19 PM
Quote from: G6 on September 11, 2007, 03:41:13 PM
No it will not, and the best way to find out is to actually test your way through, when you are creating a mod, you have to test it to ;)

Ugh, of course, we are in Alpha testing now, which is how we know of this issue.  It is already working like this on TP and non-TP sites.
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: IchBin on September 11, 2007, 09:35:10 PM
Why would you have tp_hidebars on a site without TP installed?
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: rrasco on September 11, 2007, 10:15:01 PM
That is why I wanted to check to see if TP was installed prior to running that function that would not be declared if TP was not installed. 

My mod has two custom admin actions.  Those two actions were not running tp_hidebars so the bars were showing in the ACP on garage actions only.
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: IchBin on September 11, 2007, 10:17:31 PM
My point is, you're checking to see if TP is installed basically in order to use tp_hidebars();. But why would you check it if you're not using TinyPortal? I guess I'm not making sense here, if not just ignore me. :)
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: rrasco on September 11, 2007, 10:39:35 PM
I am not, but some of my mod users are.
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: IchBin on September 12, 2007, 01:35:42 AM
Had you said that in the first place I would have understood. Thus far, you didn't say you had plans to put it in a mod for distribution.
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: rrasco on September 12, 2007, 03:31:41 PM
Yeah, I thought it was clear we were talking about a mod.  Sorry.
Title: Re: Help with mod and TP in regards to Admin Panel
Post by: Marook on January 10, 2008, 09:49:26 PM
You have to test if TP is installed, otherwise you'll get a Call to undefined function tp_hidebars() in... error, for those who wants to code a mod ;)