Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-19 20:35:26

baby
Plugin Author
From: Buenos Aires, Argentina
Registered: 2005-10-16
Posts: 95
Website

admin side plugin question

Hi,

I’d like to write a simple plugin to slightly modify the standard output in one of the admin tabs (in the ?event=list) one…

Is there a callback that is called while this page is being written (or after it has been so, but before displaying)?

What I want to do would be as easy as adding a couple of lines to the main loop in function list_list(), but I don’t want to modify the main code.

I’m afraid that if there is a post-generation/pre-display callback hook I’d have to learn how to handle the DOM.

Is there a plugin that does this so I can read its code to learn how to do it?

TIA


Mariano AbsatzEl Baby

I don’t suffer from insanity. I enjoy every minute of it.

Offline

#2 2006-05-20 00:30:06

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: admin side plugin question

Sticky

I’m afraid that if there is a post-generation/pre-display callback hook I’d have to learn how to handle the DOM.

Yes, you would.

Offline

#3 2006-05-20 01:28:59

baby
Plugin Author
From: Buenos Aires, Argentina
Registered: 2005-10-16
Posts: 95
Website

Re: admin side plugin question

thanx 4 the pointer, Mary.


Mariano AbsatzEl Baby

I don’t suffer from insanity. I enjoy every minute of it.

Offline

#4 2006-05-22 14:16:09

baby
Plugin Author
From: Buenos Aires, Argentina
Registered: 2005-10-16
Posts: 95
Website

Re: admin side plugin question

Another question about this… let’s see… I don’t know much about the DOM and handling it so I’d rather avoid this if possible…

What about doing the following, given that I want to modify (or maybe replace) what is done in ?event=list, I could write a function my_list_list() and register it by means of
<code>
register_callback(‘my_list_list’, ‘list’ , ‘list’ , 1);
</code>

So, when event=list/step=list is invoked, my function is called?

Is this right? Is this somehow kosher? (or at least not downright prohibited?)

A sidequestion… when the step is not actually named… is it equal to the event or empty?

That is, I see that if I try to see the page as ?event=list&step=list I see the same as ?event=list, but will my previous register_callback() cover both cases? or I have to do both as:
<code>
register_callback(‘my_list_list’, ‘list’ , ‘list’ , 1);
register_callback(‘my_list_list’, ‘list’ , ‘’ , 1);
</code>


Mariano AbsatzEl Baby

I don’t suffer from insanity. I enjoy every minute of it.

Offline

#5 2006-05-22 21:56:12

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: admin side plugin question

Is this right?

Yes.

A sidequestion… when the step is not actually named… is it equal to the event or empty?

Either works, you don’t have to do both, but that’d mean you’d need to lookup the default step for any particular event you’re using, so it’s easiest to just always use empty. :)

Offline

Board footer

Powered by FluxBB