403Webshell
Server IP : 104.21.14.103  /  Your IP : 3.147.63.199
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/giankuin/sieuthiweb.com.vn/dup-installer/classes/utilities/params/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/giankuin/sieuthiweb.com.vn/dup-installer/classes/utilities/params/class.u.param.item.form.option.php
<?php
/**
 * option descriptor for select, radio, multiple checkbox ... 
 *
 * Standard: PSR-2
 * @link http://www.php-fig.org/psr/psr-2 Full Documentation
 *
 * @package SC\DUPX\U
 *
 */
defined('ABSPATH') || defined('DUPXABSPATH') || exit;

/**
 * this class describes the options for select, radio and multiple checboxes
 */
class DUPX_Param_item_form_option
{

    const OPT_ENABLED  = 'enabled';
    const OPT_DISABLED = 'disabled';
    CONST OPT_HIDDEN   = 'hidden';

    public $value        = '';
    public $label        = '';
    public $attrs        = array();
    protected $optStatus = self::OPT_ENABLED;

    /**
     * 
     * @param mixed $value // option value
     * @param string $label     // label
     * @param string|function $optStatus // option status. can be a fixed status or a callback
     * @param array $attrs // option attributes
     */
    public function __construct($value, $label, $optStatus = self::OPT_ENABLED, $attrs = array())
    {
        $this->value     = $value;
        $this->label     = $label;
        $this->optStatus = $optStatus;
        $this->attrs     = (array) $attrs;
    }

    /**
     * get current statis.
     * @return string
     */
    public function getStatus()
    {
        if (is_callable($this->optStatus)) {
            $callable = $this->optStatus;
            return $callable($this);
        } else {
            return $this->optStatus;
        }
    }

    /**
     * 
     * @param string|function $optStatus // option status. can be a fixed status or a callback
     */
    public function setStatus($optStatus)
    {
        $this->optStatus = $optStatus;
    }

    /**
     * 
     * @return bool
     */
    public function isEnable()
    {
        return $this->getStatus() == self::OPT_ENABLED;
    }

    /**
     * 
     * @return bool
     */
    public function isDisabled()
    {
        return $this->getStatus() == self::OPT_DISABLED;
    }

    /**
     * 
     * @return bool
     */
    public function isHidden()
    {
        return $this->getStatus() == self::OPT_HIDDEN;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit