You are viewing the PKP Support Forum | PKP Home Wiki

Return value of manage() in plugin.

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Return value of manage() in plugin.

Postby rmichael » Thu May 01, 2008 7:57 pm

What is the meaning of the return value of manage() in a plugin? On what basis should I be deciding to return true or false?

The sample plugin in the OJS Technical Reference seems to return true if the verb was "managed" (more accurately, it returns true if one of the case statement switches matches, not based on the success or failure of the respective action); while the webFeed plugin is returns false if a verb matches the case statement (again, that's regardless of the success or failure of the get/set verb handling itself).

Aren't these opposing semantics? Have I misunderstood something? How will OJS interpret my return value?
Posts: 113
Joined: Fri Mar 30, 2007 3:32 pm

Re: Return value of manage() in plugin.

Postby asmecher » Thu May 01, 2008 10:25 pm

Hi Richard,

If the manage() function returns true, it indicates to the handler class (pages/manager/PluginHandler.inc.php) that the plugin has already provided the user with feedback, i.e. a redirect or a page display. If the manage() function returns false, the PluginHandler will take responsibility for redirecting the user somewhere else.

Alec Smecher
Public Knowledge Project Team
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest