403Webshell
Server IP : 172.67.187.206  /  Your IP : 172.71.28.155
Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586
User : SYSTEM ( 0)
PHP Version : 5.6.30
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  E:/Inetpub/www/training/wp-content/themes/flatsome/inc/builder/core/server/src/Options/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : E:/Inetpub/www/training/wp-content/themes/flatsome/inc/builder/core/server/src/Options/Option.php
<?php

namespace UxBuilder\Options;

class Option {

  protected static $id = 0;
  protected $name = '';
  protected $options = null;
  protected $data = array();
  protected $raw_data = array();

  public function __construct( $name, $data, $options ) {
    $this->name = $name;
    $this->options = $options;
    $this->raw_data = $data;
    $this->data = $this->process_data( wp_parse_args( $data, array(
      '$id' => 'option:' . self::$id++,
      '$name' => $name,
      '$org_name' => $name,
      'type' => '',
      'heading' => '',
      'description' => '',
      'default' => '',
      'value' => null,
      'require' => null,
      'conditions' => null,
      'on_change' => null,
      'auto_focus' => false,
      'save_when_default' => false,
    ) ) );
  }

  public function process_data( $data ) {
    return apply_filters( 'ux_builder_option', $data, $data['$org_name'] );
  }

  public function is( $type ) {
    return $this->data['type'] == $type;
  }

  public function get_name() {
    return $this->name;
  }

  public function get_org_name() {
    return $this->data['$org_name'];
  }

  public function get_raw() {
    return $this->raw_data;
  }

  public function set_data( $key, $value ) {
    $this->data[$key] = $value;
    $this->raw_data[$key] = $value;
  }

  public function get_data( $key = null ) {
    if ( $key ) {
      return array_key_exists( $key, $this->data ) ? $this->data[$key] : null;
    }
    return $this->data;
  }

  public function set_value( $value ) {
    $this->data['value'] = trim( $value );
    $this->raw_data['value'] = $value;
  }

  public function get_value() {
    return $this->data['value'] != ''
      ? $this->data['value']
      : $this->data['default'];
  }

  public function is_responsive() {
    return array_key_exists( 'responsive', $this->data ) && $this->data['responsive'];
  }

  public function to_array() {
    $data = array();

    foreach ( $this->data as $setting => $value ) {
      $name = ux_builder_to_camelcase( $setting );
      $data[$name] = $value;
    }

    if ( $data['onChange'] ) {
      $handler = new OnChangeHandler( $data['onChange'], $this );
      $data['onChange'] = $handler->to_array();
    }

    if ( $data['conditions'] ) {
      $data['conditions'] = $this->prefix_options_string( $data['conditions'], '$ctrl.model.%s' );
    }

    return $data;
  }

  /**
   * Prefix param names in given string.
   *
   * @param  string $value
   * @param  string $tpl
   * @return string
   */
  protected function prefix_options_string( $value, $tpl ) {
    $org_value = $value;
    $value = preg_replace_callback(
      "/(?!\B\'|\"[^\'|\"]*)([\w-]++(?<!\btrue|false|null|undefined))(?![^\'|\"]*\'|\"\B)/",
      function ( $matches ) use ( $tpl, $org_value ) {
        return sprintf( $tpl, ux_builder_to_camelcase( $matches[0] ) );
      },
      $value
    );
    $value = str_replace( '"', "'", $value );
    if ( substr( $value, 0, 1 ) == "'" ) $value = trim( $value, "'" );

    return $value;
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit