Item
[
class tree: Item
] [
index: Item
] [
all elements
]
README.txt
Todo List
Packages:
Formagic
Item
Renderer
Rule
Source for file Submit.php
Documentation is available at
Submit.php
<?php
/**
* Formagic
*
* LICENCE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at
* http://formagic.weasle.de/licence.txt
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to licence@weasle.de so we can send you a copy immediately.
*
*
@category
Formagic
*
@package
Item
*
@author
Florian Sonnenburg
*
@copyright
Copyright (c) 2007 Florian Sonnenburg
*
@license
http://formagic.weasle.de/licence.txt New BSD License
*
@revision
$Revision: 11 $
*/
/**
* Formagic submit button item
*
*
@category
Formagic
*
@package
Item
*
@author
Florian Sonnenburg
*
@copyright
Copyright (c) 2007 Florian Sonnenburg
*
@version
$Id: Submit.php 11 2007-08-12 20:02:57Z meweasle $
*/
class
Formagic_Item_Submit
extends
Formagic_Item
{
/**
* Implementation of onCreate-handler
*
*
@return
void
*/
protected
function
_onCreate
(
)
{
parent
::
_onCreate
(
)
;
// $this->defaultValue = $this->_label;
// can't be edited
$this
->
_isBlocked
=
true
;
// will not be member of submit values
// $this->isPostItem = false;
return
true
;
}
/**
* HTML string representation of submit button
*
*
@return
string
*/
public
function
getHtml
(
)
{
$str
=
'<input type="submit" name="'
.
$this
->
name
.
'" id="'
.
$this
->
id
.
'" value="'
.
$this
->
_label
.
'"'
.
$this
->
_getAttributeStr
(
)
.
' />'
;
return
$str
;
}
/**
* Override paren::getValue()
*
* Always set value of submit button to label; submit button has no label
* except from value property.
*
*
@return
string
***/
public
function
&
getValue
(
)
{
$res
=
$this
->
isTriggered
(
)
?
$this
->
_label
:
''
;
return
$res
;
}
/**
* Override parent::getLabel()
*
* Label is already defined by value property
*
*
@return
string
***/
public
function
getLabel
(
)
{
return
""
;
}
/**
* Returns true if submit button was triggered to access current page
*
*
@return
boolean
*/
public
function
isTriggered
(
)
{
$res
= isset
(
$this
->
_caller
->
submitValues
[
$this
->
name
]
)
?
true
:
false
;
return
$res
;
}
/**
* Hiding submit buttons results in removing it from form
*
*
@return
void
*/
public
function
hide
(
)
{
parent
::
hide
(
)
;
$this
->
disable
(
)
;
}
}
Documentation generated on Thu, 23 Aug 2007 00:29:48 +0200 by
phpDocumentor 1.4.0