forms
[
class tree: forms
] [
index: forms
] [
all elements
]
changelog
install
readme
Todo List
Packages:
core
communication
databases
data_structures
filesystem
forms
GilliGan
html
Services_JSON
Source for file ResetSubmitButton.class.php
Documentation is available at
ResetSubmitButton.class.php
<?php
/**
* For including this file you have to define the constant "CLASSPATH".
* Because every include in the framework depends on the CLASSPATH definition.
* The CLASSPATH means the relative path to the folder that contains the
* framework GilliGan.
*
*
@package
forms
*
@subpackage
items
*/
if
(
!
defined
(
"CLASSPATH"
) )
{
echo
"<h3>You have to define the constant CLASSPATH!</h3>\n"
;
echo
"Example: define( 'CLASSPATH', '../path/to/classes/' );\n"
;
exit
(
)
;
}
/**
*
*/
require_once
CLASSPATH
.
"forms/items/HTMLResetButton.class.php"
;
/**
*
*/
require_once
CLASSPATH
.
"forms/items/HTMLSubmitButton.class.php"
;
/**
* A class to create a reset and a buton to submit forms.
*
*
@package
forms
*
@subpackage
items
*
@version
0.1.31
*
@author
Daniel Plücken <daniel@debakel.net>
*
@license
http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
*
@copyright
Copyright (C) 2003 Daniel Pluecken <daniel@debakel.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
*
* 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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
*/
class
ResetSubmitButton
extends
ABSTHTMLFormItem
{
/**
*
@var
object
* access private
*/
var
$rstbt
;
/**
*
@var
object
* access private
*/
var
$sbtbt
;
/**
* Constructor
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@param
string
$labelRstBt
Label for the reset button.
*
@param
string
$labelSbtBt
Label for the submit button.
*/
function
ResetSubmitButton
(
)
{
$param
=
func_get_args
(
)
;
$labelRstBt
=
empty
(
$param
[
0
]
)
?
"Zurücksetzen"
:
$param
[
0
]
;
$labelSbtBt
=
empty
(
$param
[
1
]
)
?
"Senden"
:
$param
[
1
]
;
$this
->
rstbt
=
&
new
HTMLResetButton
(
"reset"
,
$labelRstBt
)
;
$this
->
sbtbt
=
&
new
HTMLSubmitButton
(
"formsent"
,
$labelSbtBt
)
;
}
/**
* Sets the label of the reset button.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@param
string
$string
The text how the reset button should be labled.
*/
function
setLabelOfResetButton
(
$string
)
{
if
(
get_class
(
$this
->
rstbt
)
==
"htmlresetbutton"
)
$this
->
rstbt
->
setValue
(
$string
)
;
}
/**
* Sets the label of the submit button.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@param
string
$string
The text how the submit button should be labled.
*/
function
setLabelOfSubmitButton
(
$string
)
{
if
(
get_class
(
$this
->
sbtbt
)
==
"htmlsubmitbutton"
)
$this
->
sbtbt
->
setValue
(
$string
)
;
}
/**
* Returns the name of the submit button.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@param
object
This
object's parent object.
*/
function
setParentForm
(
&
$formobj
)
{
$this
->
rstbt
->
parentform
=
&
$formobj
;
$this
->
sbtbt
->
parentform
=
&
$formobj
;
}
/**
* Blind method cause other objects will invoke it.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@return
string
*/
function
getName
(
)
{
return
""
;
}
/**
* Returns the name of the reset button.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@return
string
*/
function
getNameOfResetButton
(
)
{
return
$this
->
rstbt
->
getName
(
)
;
}
/**
* Returns the label of the submit button.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@return
string
*/
function
getLabelOfResetButton
(
)
{
if
(
get_class
(
$this
->
rstbt
)
==
"htmlresetbutton"
)
return
$this
->
rstbt
->
getValue
(
)
;
else
return
false
;
}
/**
* Returns the name of the submit button.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@return
string
*/
function
getNameOfSubmitButton
(
)
{
return
$this
->
sbtbt
->
getName
(
)
;
}
/**
* Returns the label of the submit button.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@return
string
*/
function
getLabelOfSubmitButton
(
)
{
if
(
get_class
(
$this
->
sbtbt
)
==
"htmlsubmitbutton"
)
return
$this
->
sbtbt
->
getValue
(
)
;
else
return
false
;
}
/**
* Blind method cause other objects will invoke it.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@return
boolean
*/
function
getCheckOrder
(
$formName
)
{
return
false
;
}
/**
* Blind method cause other objects will invoke it.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@return
boolean
*/
function
getValidationOrder
(
$formName
)
{
return
false
;
}
/**
* Generates the sourcecode to build this object and returns it.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@return
string
*/
function
getPHPSource
(
)
{
$outputstr
=
"\x24input[] = new ResetSubmitButton(\n"
.
" \""
.
$this
->
getLabelOfResetButton
(
)
.
"\",\n"
.
" \""
.
$this
->
getLabelOfSubmitButton
(
)
.
"\"\n"
.
" );\n"
;
return
$outputstr
;
}
/**
* Returns a generated string based on the attributes of this HTML-Object.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@return
string
*/
function
get
(
)
{
return
$this
->
rstbt
->
get
(
)
.
"\n"
.
$this
->
sbtbt
->
get
(
)
;
}
}
// End of class SubmitCanelButton
?>
Documentation generated on Thu, 05 Jun 2008 19:14:52 +0200 by
phpDocumentor 1.4.1