CB Helloworld Plugin (part 2)

17 years 5 months ago #24740 by kmchen
Replied by kmchen on topic Re:CB Helloworld Plugin (part 2)
going further, I see every thing is handeled in Javascript. I found nearly what I need:

$mosConfig_live_site/index.php?option=com_comprofiler&task=userProfile&Itemid=29&tab=getprofilegallerytab

Could you quickly explain what are those parameters:

task=userProfile
This permits access to the plugin. Right ? How ?

Itemid=29
?

tab=getprofilegallerytab
?

Please Log in to join the conversation.

17 years 5 months ago #24798 by nant
Replied by nant on topic Re:CB Helloworld Plugin (part 2)
looks like you are getting closer ... ;)

This same issue caused me much effort to understand how/what JoomlaJoe (aka Mambojoe) did to allow user input/forms in the cb profilebook.

The idea is that the form actually calls the current URL. So your plugin should be able to assess if it has been called from the form or from some other CB action.
This is done by observing the POST parameters.

Hopefully, this will get you going again.

courage!

Please Log in to join the conversation.

17 years 5 months ago #24803 by kmchen
Replied by kmchen on topic Re:CB Helloworld Plugin (part 2)
Now I found the way to receive Tab forms through function saveEditTab($tab, $user, $ui, &$postdata)

To be clear let's say I have a tab with 2 fields declared by the plugin in xml file. One text that I fill through getEditTab and a yes/no radio button that the user can set to accept the text I submitted.
I receive the correct setted form in $postdata but when saveEditTab returns they are set to the original values that are tooken from database at getDisplayTab call. Same with $user whitch contains same fields.
More, if I directly set the fields in the database through saveEditTab I see them changed in that database with phpmyadmin but when I let the function continue and return they are resetted again by CB.:side:

Am I miss using those functions ?
Should I try onBeforeUserUpdate event or something else ?

Please Log in to join the conversation.

17 years 5 months ago #25021 by kmchen
Replied by kmchen on topic Re:CB Helloworld Plugin (part 2)
No more response since 3 days. What's going on ? No more discussion ?

Please Log in to join the conversation.

17 years 5 months ago #25024 by bjraines
Replied by bjraines on topic Re:CB Helloworld Plugin (part 2)
This is on an entirely different subject but still involves the tutorial. I am starting from scratch. I am looking at the Hello Plugin 2 and other plugins. I have two questions

1) how come in the hello plugin the global $my is used but in articles plugin it is not?

2) what is the $my variable state anyway.

3) I gutted the Hello Plugin 2 and added a simple database query to spit out a row. there were no php errors but my Hello Plugin tab disappeared. I am not sure why. Example
i kept this
[code:1]class gethelloworldTab extends cbTabHandler {
/**
* Construnctor
*/
function gethelloworldTab() {
$this->cbTabHandler();
}} // end or getDisplayTab function
} // end of gethelloworldTab class
?>[/code:1]

and put a simple querty to spit out one row from joomla table. I lost my tab name so I can't tell if it worked.

4) Just while I was working, I noticed that the articles plugin has some paramter features (i think) yet there are no parameters in the tab or plugin admin.

Thanks. Just trying to understand. And I am documenting everything so that other dummies like me can learn.

Please Log in to join the conversation.

17 years 4 months ago #26593 by lassej
Replied by lassej on topic Re:CB Helloworld Plugin (part 2)
This is a great set of articles. Thank you.

/Lasse

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.238 seconds