Source for file call_plugin.php
Documentation is available at call_plugin.php
* This file gets used to access {@link Plugin} methods that are marked to be accessible this
* way. See {@link Plugin::GetSrvcMethods()}.
* This file is part of Quam Plures - {@link http://quamplures.net/}
* See also {@link https://launchpad.net/quam-plures}.
* @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
* @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
* Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
* {@internal License choice
* - If you have received this file as part of a package, please find the license.txt file in
* the same folder or the closest folder above for complete license terms.
* - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
* then you must choose one of the following licenses before using the file:
* - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
* - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
* {@internal Open Source relicensing agreement:
* Daniel HAHLER grants Francois PLANQUE the right to license
* Daniel HAHLER's contributions to this file and the b2evolution project
* under any OSI approved OSS license (http://www.opensource.org/licenses/).
* {@internal Below is a list of authors who have contributed to design/coding of this file: }}
* @author fplanque: Francois PLANQUE
* @author blueyed: Daniel HAHLER
* TODO: Don't do a full init!
require_once dirname(__FILE__ ). '/../qp_config/_config.php';
require_once $inc_path. '_main.inc.php';
param( 'plugin_ID', 'integer', true );
param( 'method', 'string', '' );
param( 'params', 'string', null ); // serialized
{ // params given. This may result in "false", but this means that unserializing failed.
$Plugin = & $Plugins->get_by_ID( $plugin_ID );
if( ! in_array( $method, $Plugin->GetSrvcMethods() ) )
debug_die( 'Call to non-srvc Plugin method!' );
$Plugins->call_method( $Plugin->ID, 'srvc_'. $method, $params );
|