Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90710697
listFunctions.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, Nov 4, 01:59
Size
7 KB
Mime Type
text/x-c
Expires
Wed, Nov 6, 01:59 (2 d)
Engine
blob
Format
Raw Data
Handle
22123255
Attached To
R3600 invenio-infoscience
listFunctions.php.wml
View Options
## $Id$
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002 CERN.
##
## 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.
<?
require("commonPhpFunctions.php");
?>
#include "cdspage.wml" \
title="Available Functions" \
navtrail_previous_links="<a class=navtrail href=<WEBURL>/admin/<lang:star: index.*.html>><MSG_ADMIN_AREA></a> > <a class=navtrail href=<WEBURL>/admin/websubmit/><MSG_ADMIN_SUBMIT></a>" \
navbar_name="admin" \
navbar_select="websubmit_listfunctions" \
cdspageboxlefttopadd="<protect><?displayLoginMenu('submit');?></protect>"
<?
<protect>
## $Id$
## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.
/*************************Function Declarations********************/
function makeFunctionTable($queryResult)
{
/*****************************************************************
This function produces a table, which contains a list of all of
the functions in the MESS system database. The function is
passed a query result that points to a list of all functions in
the MESS database (obtained by querying the sbmALLFUNCDESCR table
for function).
The table that is produced contains the functions name, a form
with a graphical input button that when pressed, takes the user
to a page where they can view the usage of the function
throughout MESS, and a form with a graphical input button, which
when pressed, takes the user to a page where they can view/edit
details of that particular function (e.g. adding parameters,
changing the function description, etc...
Author: Nicholas Robinson
Email: Nicholas.Robinson@cern.ch
Created: 18/09/2000
Last Modified: 25/01/2001
*****************************************************************/
global $IMAGES;
# Open the table, and display the column headings...
print("<TABLE ALIGN='center' BORDER=1 CELLSPACING=0 CELLPADDING=0>"
. "\n<TR BGCOLOR='#CCDDFF'>\n<TH>Function Name</TH>\n"
. "<TH>View<BR>Function Usage</TH>\n<TH>View/Edit<BR>Function "
. "Details</TH>\n</TR>\n");
# For each function in the array, (each function in MESS), display
# its name, and make the input forms...
while(list($funName) = mysql_fetch_row($queryResult))
{
print("<TR BGCOLOR='#FFFFCC'>\n<TD> $funName"
. " </TD>\n"
. "<FORM METHOD='post' ACTION='funcUsage.php'><TD "
. "ALIGN='center'><INPUT TYPE='hidden' NAME='function'"
. " VALUE='$funName'><INPUT TYPE='image' BORDER=0 "
. "SRC='".$IMAGES."/tick.gif'></TD></FORM>\n"
. "<FORM METHOD='post' ACTION='veditFunDets.php'><TD "
. "ALIGN='center'><INPUT TYPE='hidden' NAME='function' "
. "VALUE='$funName'><INPUT TYPE='image' BORDER=0"
. " SRC='".$IMAGES."/tick.gif'></TD></FORM>\n</TR>\n");
} // END for
# Close the table...
print("</TABLE>\n");
} // END function makeFunctionTable($queryResult)
/**************************Start of Main Script*********************/
/**********************************************************************
This script displays a table of all functions in the MESS database
on the browser screen. Effectively, it makes a table, containing
the name of each function, and for each function, a link to a page
that shows the functions usage in MESS, and a link to a page that
allows the user to view and/or edit the details of that function.
It is worth making a note at this stage about the operation of this
script. I had at first thought that the MESS table sbmFUNDESC
contained the details of every function in the MESS database, and
therefore it would be possible to simply query this table to get the
names of all functions in MESS. Further observations however,
revealed that sbmFUNDESC only contains entries for functions that take
parameters, which meant that functions without parameters would not
be listed by querying this table. This meant that it was necessaray
to create a new table that contained the function name, and a
descrtiption of the function.
This table was added to mess, and called sbmALLFUNCDESCR. It was
decided that it would be made compulsary that all functions have an
entry in this new table, so that obtaining a list of all functions
in MESS would be very easy and efficient.
**********************************************************************/
function displayPage()
{
# Place a READ lock on the sbmALLFUNCDESCR table
if($lockRes = mysql_query("LOCK TABLES sbmALLFUNCDESCR READ"))
{
# Run a query to retrieve all of the functions in the MESS...
$funcQuery = mysql_query("SELECT function FROM sbmALLFUNCDESCR ORDER
BY function");
# We must unlock our table...
$unlockRes = mysql_query("UNLOCK TABLES");
if($funcQuery) # If the query to get all functions was successful
{
# Display the query results on the screen...
makeFunctionTable($funcQuery);
# Now print out an action button to give the user to add a
# function...
print("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 "
. "ALIGN='center'>\n"
. "<TR>\n<FORM METHOD='post' ACTION='newFunc.php'><TD "
. "ALIGN='center'><INPUT TYPE='button' VALUE='ADD FUNCTION'"
. " onClick=\"submit();\">\n</TD></FORM>\n</TR>\n"
. "</TABLE>\n");
} // END if
else # If the function did not execute successfully...
{
# Display an error message on the screen in the form of a
# JavaScript alert...
print("<SCRIPT TYPE='text/javascript'>alert('ERROR: Unable"
. " to execute query for all "
. "functions in MESS');</SCRIPT>");
} // END else
} # END if
else
{
# Could not lock the table. No display allowed.
print("<DIV STYLE='text-align: center; font-weight: bold; "
. "font-size: large; color: navy'>\n<SPAN STYLE='color: red'>"
. "Error:</SPAN> Unable to retrieve information.</DIV>\n<BR>".mysql_error()."\n"
. "<A STYLE='text-align: center; font-size: medium' HREF='"
. "listFunctions.php'>Please retry</A>\n<BR>\n");
} # END else
}
/**********************Start of main script***************************/
# Connect to the MySQL server
serverConnect(MYSQLDOCMACHINE, MYSQLDOCUSERID, MYSQLDOCPASSWORD);
# Select the CDS Search database...
dbSelect(DOCS_DATABASE);
if (!canUseWebSubmitAdmin($uid))
outWarning("You are not allowed to access WebSubmit Admin");
else
displayPage();
/************************End of main script***************************/
</protect>
?>
Event Timeline
Log In to Comment