PATH:
home
/
lab2454c
/
incforce.com
/
wp-content
/
plugins
/
smart-slider-3
/
Nextend
/
Framework
/
Form
/
Element
<?php namespace Nextend\Framework\Form\Element; use Nextend\Framework\Asset\Js\Js; use Nextend\Framework\View\Html; class Radio extends AbstractFieldHidden { protected $options = array(); protected $class = 'n2_field_radio'; protected $style = ''; protected $value; protected function addScript() { Js::addInline('new _N2.FormElementRadio("' . $this->fieldID . '", ' . json_encode(array_keys($this->options)) . ', ' . json_encode($this->relatedFields) . ');'); } protected function fetchElement() { $this->value = $this->getValue(); $html = Html::tag('div', array( 'class' => $this->class, 'style' => $this->style ), $this->renderOptions() . parent::fetchElement()); $this->addScript(); return $html; } /** * @return string */ protected function renderOptions() { $html = ''; $i = 0; foreach ($this->options as $value => $label) { $html .= Html::tag('div', array( 'class' => 'n2_field_radio__option' . ($this->isSelected($value) ? ' n2_field_radio__option--selected' : '') ), Html::tag('div', array( 'class' => 'n2_field_radio__option_marker' ), '<i class="ssi_16 ssi_16--check"></i>') . '<div class="n2_field_radio__option_label">' . $label . '</div>'); $i++; } return $html; } function isSelected($value) { if ((string)$value == $this->value) { return true; } return false; } /** * @param array $options */ public function setOptions($options) { $this->options = $options; } public function setStyle($style) { $this->style = $style; } }
[-] Message.php
[edit]
[+]
Button
[-] Tab.php
[edit]
[-] Upload.php
[edit]
[+]
Radio
[-] Devices.php
[edit]
[+]
..
[-] Textarea.php
[edit]
[+]
Select
[-] IconTab.php
[edit]
[-] Grouping.php
[edit]
[-] Decoration.php
[edit]
[-] CheckboxOnOff.php
[edit]
[-] Breakpoint.php
[edit]
[-] MarginPadding.php
[edit]
[+]
Message
[-] Token.php
[edit]
[-] RichTextarea.php
[edit]
[-] Connected.php
[edit]
[-] LayerWindowFocus.php
[edit]
[-] AbstractFieldHidden.php
[edit]
[-] AbstractChooserText.php
[edit]
[+]
MixedField
[-] Unit.php
[edit]
[+]
Textarea
[-] EmptyArea.php
[edit]
[-] MixedField.php
[edit]
[+]
Text
[-] SelectIcon.php
[edit]
[-] Radio.php
[edit]
[-] Text.php
[edit]
[+]
Group
[-] Select.php
[edit]
[-] Hidden.php
[edit]
[-] AbstractChooser.php
[edit]
[-] Style.php
[edit]
[-] Font.php
[edit]
[-] Gap.php
[edit]
[-] OnOff.php
[edit]
[+]
Hidden
[-] Button.php
[edit]