2007-07-19 12:40:28 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2009-03-10 16:03:34 +01:00
|
|
|
* Simple label tag. This can be used to add extra text in your forms.
|
|
|
|
* Consider using a {@link ReadonlyField} if you need to display a label
|
|
|
|
* AND a value.
|
2014-08-15 08:53:05 +02:00
|
|
|
*
|
2008-01-09 05:18:36 +01:00
|
|
|
* @package forms
|
|
|
|
* @subpackage fields-dataless
|
2007-07-19 12:40:28 +02:00
|
|
|
*/
|
|
|
|
class LabelField extends DatalessField {
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2007-07-19 12:40:28 +02:00
|
|
|
/**
|
2008-10-16 15:26:25 +02:00
|
|
|
* @param string $name
|
|
|
|
* @param string $title
|
|
|
|
* @param Form $form
|
2007-07-19 12:40:28 +02:00
|
|
|
*/
|
2012-09-19 12:07:39 +02:00
|
|
|
public function __construct($name, $title) {
|
2008-10-16 15:26:25 +02:00
|
|
|
// legacy handling for old parameters: $title, $heading, ...
|
|
|
|
// instead of new handling: $name, $title, $heading, ...
|
|
|
|
$args = func_get_args();
|
|
|
|
if(!isset($args[1])) {
|
|
|
|
$title = (isset($args[0])) ? $args[0] : null;
|
|
|
|
$name = $title;
|
|
|
|
$form = (isset($args[3])) ? $args[3] : null;
|
2014-08-15 08:53:05 +02:00
|
|
|
}
|
|
|
|
|
2012-01-02 17:09:30 +01:00
|
|
|
parent::__construct($name, $title);
|
2007-07-19 12:40:28 +02:00
|
|
|
}
|
2011-03-23 05:12:25 +01:00
|
|
|
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|