Hi
im a newB to drupal...
I have a module called Abuse that helps user in marking content as abusive. It renders a form where users can send in reasons and details abt the abuse.
I placed a link like below
print 'http://'.$_SERVER['HTTP_HOST'].'/drupal-6.8/abuse/report/node/'.$nid '>Flag as offensive
where $nid holds the nid of the content. This link gets displayed in each content posted clicking on which will open a new page with the abuse report form.
I have to display this form on the same page of the content.
In the tpl file where i display the content, i call the abuse report form rendering hook abuse_report_form just as below...
print drupal_get_form('abuse_report_form',$object, $user);
here $user is a global object and east to pass that to this hook but $object isn't...
$object is created by another hook which is inturn depends on some other objects...
As a newB i feel its meaningless to keep on calling all the hooks and is there any other way i can retrieve the $object without making it global...
Pls have a look at the abuse module files for any idea...
http://ftp.drupal.org/files/projects/abuse-6.x-1.x-dev.tar.gz
Thanks in advance
Comments
Comment #1
stevenpatzComment #2
ainigma32 commentedTo see what variables are available in the theme layer you should install the Devel module http://drupal.org/project/devel and activate the Theme developer.
As to how you can add a form to all content items: why not 'lend' some code form another module? Fivestar http://drupal.org/project/fivestar comes to mind as a module you could study.
Please post back how that works out for you.
- Arie
Comment #3
Sandymaguire commentedThe Object of first module is the node object with name "$object".The hook in second module needed this node object to be specified as its arguments.
So simply i specified the node object here as "$node" that represented the node object local to this second module and it worked well.
Thank u
Comment #4
ainigma32 commentedGood for you :-)
- Arie