File: //opt/cloudlinux/alt-php54/root/usr/share/pear/HTML/QuickForm2/Element/InputSubmit.php
<?php
/**
* Class for <input type="submit" /> elements
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.githubusercontent.com/pear/HTML_QuickForm2/trunk/docs/LICENSE
*
* @category HTML
* @package HTML_QuickForm2
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <golgote@mamasam.com>
* @copyright 2006-2021 Alexey Borzov <avb@php.net>, Bertrand Mansion <golgote@mamasam.com>
* @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link https://pear.php.net/package/HTML_QuickForm2
*/
/**
* Base class for <input> elements
*/
require_once 'HTML/QuickForm2/Element/Input.php';
/**
* Class for <input type="submit" /> elements
*
* @category HTML
* @package HTML_QuickForm2
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <golgote@mamasam.com>
* @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.2
* @link https://pear.php.net/package/HTML_QuickForm2
*/
class HTML_QuickForm2_Element_InputSubmit extends HTML_QuickForm2_Element_Input
{
protected $attributes = ['type' => 'submit'];
/**
* Element's submit value
* @var string
*/
protected $submitValue = null;
/**
* Submit buttons can not be frozen
*
* @param bool $freeze Whether element should be frozen or editable. This
* parameter is ignored in case of submit elements
*
* @return bool Always returns false
*/
public function toggleFrozen($freeze = null)
{
return false;
}
/**
* Submit's value cannot be set via this method
*
* @param mixed $value Element's value, this parameter is ignored
*
* @return $this
*/
public function setValue($value)
{
return $this;
}
/**
* Returns the element's value
*
* The value is only returned if the form was actually submitted and this
* submit button was clicked. Returns null in all other cases
*
* @return string|null
*/
public function getRawValue()
{
return $this->getAttribute('disabled')? null: $this->submitValue;
}
protected function updateValue()
{
foreach ($this->getDataSources() as $ds) {
if ($ds instanceof HTML_QuickForm2_DataSource_Submit
&& null !== ($value = $ds->getValue($this->getName()))
) {
$this->submitValue = $value;
return;
}
}
$this->submitValue = null;
}
}
?>