Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79420360
UDF_testcode.php.wml
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Aug 26, 07:42
Size
2 KB
Mime Type
text/html
Expires
Wed, Aug 28, 07:42 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
20158808
Attached To
R3600 invenio-infoscience
UDF_testcode.php.wml
View Options
<?
/*********************************************************************
This file is part of the CERN Document Server Software (CDSware).
Copyright (C) 2002 CERN.
1211 Geneva 23 - Switzerland
<cds.support@cern.ch>
The CDSware is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
The CDSware is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CDSware; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*********************************************************************/
//==========================================================================
// File: UDF_testcode.php (flexElink WI)
// Description: Allows to test a UDF for a given set of parameter values.
// Parameter values have to be specified in the correct order and the
// parameter name is not relevant (only the order and the value). It
// shows a web page with the result of executing the UDF with those
// parameter values
// POST parameters:
// fname ---> (required) Name (id) of the UDF to be tested
// <param> -> (optional, multiple) Parameter value, they have to come in
// the same order as the UDF definition specifies
// Requires: ERROR, UDF_RETRIEVER
// Author: Hector.Sanchez@cern.ch
//==========================================================================
include("localconf.inc.php");
include(ERROR);
include(UDF_RETRIEVER);
if(!isset($fname) || (trim($fname)==""))
{
errorpage("Function not set!!");
}
global $HTTP_POST_VARS;
$pars=array();
foreach($HTTP_POST_VARS as $var=>$value)
{
if(get_magic_quotes_gpc())
$value=stripslashes($value);
if($var!="fname")
array_push($pars, $value);
}
print_r($pars);
$ret=new UDFRetriever();
list($ecode, $emsg)=$ret->execute( $fname, $pars, 0, 0);
$ret->destroy();
if($ecode)
{
print "Result:<br><h2>$emsg</h2>";
}
else
{
print "ERROR!! $emsg";
}
print "<hr>";
print "<a href=\"JavaScript:window.history.go(-1)\">[Go back]</a>";
?>
Event Timeline
Log In to Comment