<?php
/*
*******************************************************************************
FiForms -- A collection of PHP classes designed
to facilitate rapid development of web-database software
Copyright (C) 2003-2008 Daniel McFeeters
This library 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.
This library 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 this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
The original author of this library can be contacted at the following
address:
Daniel McFeeters
182 Baker Rd.
Faubush, KY 42544-6526
email:databases [at] fiforms [dot] org
http://www.fiforms.org/
iText class
Project Started May 4, 2003
*******************************************************************************
FiForms_iLink.inc.php
iLink Definition File
This file contains the definitions for the iLink input class
*******************************************************************************
*/
require_once("FiForms_iInput.inc.php");
/* ?><code><?php */
$FIFORM_XML_INPUTS[] = 'f:iLink';
class iLink extends iInput
// an extension of iInput which outputs an html link, using the dbField
// property as the URL
{
var $actRefs;
var $currentRec;
var $openIn; // Name of window to open in
var $itype; // Type of link (i.e. button)
var $contents; // Text of the link
var $fieldList;
var $multiField;
var $windowOpts;
var $evalValue; // If true, indicates that the value
// in $value field is actually PHP code
// to be evaluated.
var $staticValue; // If true, indicates that the value
// in $value should be passed through
// without processing
var $title; // title passed to HTML
function iLink()
{
$this->evalValue = FALSE;
$this->staticValue = FALSE;
$this->multiField = TRUE;
$args = func_get_args();
$this->openIn = $args[2];
$this->itype = $args[4];
$this->contents = $args[5];
$this->onclick = "";
$this->title = "";
$this->accesskey = "";
$this->iInput(func_get_args());
} // function iLink
function formatOutput()
{
if($this->itype == "button")
{
return "<button type=\"button\" $this->otherTags onclick=\"this.href='$this->value';$this->onclick\" title=\"$this->title\" accesskey=\"$this->accesskey\">$this->contents</button>";
}
else
{
return("<a href=\"$this->extendedValue\" $this->otherTags onclick=\"$this->onclick\" title=\"$this->title\" accesskey=\"$this->accesskey\">$this->contents</a>");
}
} // function formatOutput
function drawInput()
{
if($this->value == "")
{
$this->value = $this->dbField;
}
if($this->contents == "")
{
$this->contents = $this->caption;
}
$this->onclick = "confirmLink".
"(this.href,'$this->openIn','$this->windowOpts'); return false;";
if($this->evalValue)
{
$this->extendedValue = eval($this->value);
}
elseif(!$this->staticValue)
{
$this->extendedValue = fillVars($this->fieldList,$this->value);
}
else
{
$this->extendedValue = $this->value;
}
$this->contents = fillVars($this->fieldList,$this->contents);
return $this->formatOutput();
}
function drawCaption()
{
return $this->caption;
}
} // class iLink
/* ?></code><?php */
?>