<?php

/*
 * demo plugin
 */

// Required functions
/* 
 * This function is  called prior to any output to the web browser and is intended
 * for the plugin to parse possible form data. This function is called only, if this
 * plugin is selected in the plugins tab
 */
function demoplugin_ParseInput( $plugin_id ) {

	SetMessage('error', "Error set by demo plugin!");
	SetMessage('warning', "Warning set by demo plugin!");
	SetMessage('alert', "Alert set by demo plugin!");
	SetMessage('info', "Info set by demo plugin!");

} // End of demoplugin_ParseInput


/*
 * This function is called after the header with the navigation bar have been sent to the
 * browser. It's now up to this function what to display.
 * This function is called only, if this plugin is selected in the plugins tab
 */
function demoplugin_Run( $plugin_id ) {

	print "<h3>Hello I'm the demo plugin with id $plugin_id</h3>\n";
	print "Query backend plugin for function <b>try</b><br>\n";

	$opts = array();
    $out_list = nfsend_query('demoplugin::try', $opts, 0);
    if ( !is_array($out_list) ) {
        SetMessage('error', "Can not read topN list");
        return FALSE;
    }
	$answer = $out_list['string'];
	print "Backend repoprted: <b>$answer</b><br>\n";

} // End of demoplugin_Run


?>
