b0y-101 Mini Shell


Current Path : E:/www/km/wp2/wp-content/plugins/smart-slider-3/Nextend/Framework/Form/Element/
File Upload :
Current File : E:/www/km/wp2/wp-content/plugins/smart-slider-3/Nextend/Framework/Form/Element/AbstractChooser.php

<?php


namespace Nextend\Framework\Form\Element;


use Nextend\Framework\View\Html;

abstract class AbstractChooser extends AbstractFieldHidden {

    protected $hasClear = true;

    protected $class = '';

    protected $width;

    abstract protected function addScript();

    protected function fetchElement() {

        $this->addScript();

        $this->renderRelatedFields();

        return Html::tag('div', array(
            'class' => 'n2_field_chooser ' . $this->class
        ), $this->pre() . parent::fetchElement() . $this->field() . $this->post());
    }

    protected function pre() {

    }

    protected function field() {
        $style = '';
        if ($this->width) {
            $style = 'width: ' . $this->width . 'px;';
        }

        return '<div class="n2_field_chooser__label" style="' . $style . '"></div>';
    }

    protected function post() {

        $html = '';
        if ($this->hasClear) {
            $html .= Html::tag('a', array(
                'href'  => '#',
                'class' => 'n2_field_chooser__clear'
            ), Html::tag('i', array('class' => 'ssi_16 ssi_16--circularremove'), ''));
        }

        $html .= Html::tag('a', array(
            'href'  => '#',
            'class' => 'n2_field_chooser__choose'
        ), '<i class="ssi_16 ssi_16--plus"></i>');

        return $html;
    }

    /**
     * @param bool $hasClear
     */
    public function setHasClear($hasClear) {
        $this->hasClear = $hasClear;
    }

    /**
     * @param int $width
     */
    public function setWidth($width) {
        $this->width = $width;
    }
}

Copyright © 2019 by b0y-101