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

stevenpatz’s picture

Priority: Critical » Normal
ainigma32’s picture

Assigned: Sandymaguire » Unassigned
Status: Active » Postponed (maintainer needs more info)

To 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

Sandymaguire’s picture

The 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

ainigma32’s picture

Status: Postponed (maintainer needs more info) » Fixed

Good for you :-)

- Arie

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.