Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-12-23 03:35:09

Siguo
Member
From: Beijing, China
Registered: 2008-05-22
Posts: 44

question about the new function: pluggable_ui

I’m learning the 4.2.0 code these days and found the new function pluggable_ui in txplib_misc.php:

function pluggable_ui($event, $element, $default=’‘)
{
………
}

It has three args.

but in txp_article.php, I find many use of this function like below:

echo pluggable_ui(‘article_ui’, ‘extend_col_1’, ‘’, $rs);

my question is:

why is there fourth arg? the function definition only use three args…..

many thanks for your help.

Offline

#2 2009-12-23 04:08:05

Siguo
Member
From: Beijing, China
Registered: 2008-05-22
Posts: 44

Re: question about the new function: pluggable_ui

o, I found this in the func definition:

// string my_called_func(string $event, string $step, string $default_markup[, mixed $context_data…])

maybe someone wants a fourth arg, but drop it at last.

so the fourth arg in txp_article.php DO NOTHING.

I’m right?

Offline

#3 2009-12-24 01:03:16

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: question about the new function: pluggable_ui

The $rs is the context data that gets passed into the callback. Your callback would look like

function my_plugglable_ui_callback($event, $step, $default, $context_data='') {
// do stuff
} 

in the article tab it’s the article information (sort of). The updated hak_tinymce uses pluggable_ui alot if you want to check it out. bitbucket link

Last edited by hakjoon (2009-12-24 01:05:47)


Shoving is the answer – pusher robot

Offline

Board footer

Powered by FluxBB