Page MenuHomec4science

LINK_display.php.wml
No OneTemporary

File Metadata

Created
Mon, Aug 26, 07:37

LINK_display.php.wml

## $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.
<?
include("localconf.inc.php");
?>
#include "cdspage.wml" \
title="Link Rules" \
navbar_name="admin" \
navbar_select="LINK_display" \
cdspageboxlefttopadd="<protect><?displayLoginMenu('admin');?> </protect>"
<?
include("security.inc.php");
<protect>## $Id$</protect>
//==========================================================================
// File: LINK_display.php (flexElink WI)
// Description: Shows a list of the existing links and their parameters, and
// allows to access to their details or add new link definitions
// POST parameters:
// Notes:
// Requires: DB, ERROR, FUNCTION_LIB
// Author: Hector.Sanchez@cern.ch
//==========================================================================
include(DB);
include(ERROR);
include(HEADER);
?>
<p>Define rules for automated creation of URI links from mapped
internal variables.
<em>Example:</em> You can tell a rule how to create a link to
People database out of the <code>$100.a</code> internal variable
repesenting author's name. (The <code>$100.a</code> variable was mapped
in the previous step, see the Extraction Rules.)<p>
<script type="text/javascript">
<!---
function openwindowlink( addr, name )
{
window.open( addr, "Window"+name, "height=620,witdh=320,scrollbars,resizable")
}
//-->
</script>
<?
$db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD );
mysql_selectdb( $DB_DB );
$qry="select linktype
from flxLINKTYPES
order by linktype";
$qh=mysql_query($qry);
print '<table width="100%" bgcolor="#CCCCCC" border="1">';
print "<tr align=\"center\" bgcolor=\"#33CC00\">";
print "<td><b>Link type label</b></td>";
print "<td><b>Parameters</b></td>";
print "<td>&nbsp;</td>";
print "</tr>";
while($row=mysql_fetch_array($qh))
{
list($linktype)=$row;
$qry_par="select pname
from flxLINKTYPEPARAMS
where linktype='".addslashes($linktype)."'
order by ord";
$qh_par=mysql_query($qry_par);
$pars="";
while($row=mysql_fetch_array($qh_par))
{
$pars.=$row[0].",";
}
print "<tr bgcolor=\"#FFFFFF\">";
print "<td bgcolor=\"#CCFFCC\"><b>$linktype</b></td>";
print "<td>$pars</td>";
print "<td align=\"center\">
<a href=\"JavaScript:openwindowlink('LINK_showone.php?linktype=$linktype', 'LRSHOW$linktype')\">
<font size=\"2\">[Details]</font></a></td>";
print "</tr>";
}
print "</table>";
mysql_close( $db );
?>
<form action="LINK_add.php" method="POST">
<table width="70%" align="center">
<tr>
<td align="center" bgcolor="#000000" colspan="2">
<font color="#FFFFFF">Add new Link Type</font>
</td>
</tr>
<tr>
<td width="30%" align="right">
Name
</td>
<td>
<input type="text" name="linktype">
</td>
</tr>
<tr>
<td width="30%" align="right">
Params
</td>
<td>
<input type="text" name="params">
</td>
</tr>
<tr>
<td width="30%" align="right">
Solving type
</td>
<td>
<select name="stype">
<option value="EXT">External</option>
<option value="INT">Internal</option>
</select>
</td>
</tr>
<tr>
<td width="30%" align="right">
Base file path
</td>
<td>
<input type="text" name="bfile" size="80">
</td>
</tr>
<tr>
<td width="30%" align="right">
Base url
</td>
<td>
<input type="text" name="burl" size="80">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Add">
</td>
</tr>
</table>
</form>
<?
include(FOOTER);
?>

Event Timeline