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 CheckboxOnOff extends AbstractFieldHidden { /** * @var string */ protected $icon; protected $invert = false; protected $checkboxTip; public function __construct($insertAt, $name, $label, $icon, $default = 0, $parameters = array()) { $this->icon = $icon; parent::__construct($insertAt, $name, $label, $default, $parameters); } protected function fetchElement() { $options = array( 'invert' => $this->invert, 'relatedFields' => $this->relatedFields ); Js::addInline('new _N2.FormElementCheckboxOnOff("' . $this->fieldID . '", ' . json_encode($options) . ');'); $attr = array( 'class' => 'n2_field_checkbox_onoff' . ($this->isActive() ? ' n2_field_checkbox_onoff--active' : '') ); if (!empty($this->checkboxTip)) { $attr['data-n2tip'] = $this->checkboxTip; } return Html::tag('div', $attr, '<i class="' . $this->icon . '"></i>' . parent::fetchElement()); } protected function isActive() { $value = $this->getValue(); if (!$this->invert && $value) { return true; } else if ($this->invert && !$value) { return true; } return false; } /** * @param bool $invert */ public function setInvert($invert) { $this->invert = $invert; } /** * @param string $tip */ public function setCheckboxTip($tip) { $this->checkboxTip = $tip; } }
[-] 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]