HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/radio.tar
radio.php000064400000002544151554723530006372 0ustar00<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
/**
 *
 * Field: Radio
 *
 * @since 1.0.0
 * @version 1.0.0
 *
 */
class CSFramework_Option_radio extends CSFramework_Options {

  public function __construct( $field, $value = '', $unique = '' ) {
    parent::__construct( $field, $value, $unique );
  }

  public function output(){

    echo $this->element_before();

    if( isset( $this->field['options'] ) ) {

      $options = $this->field['options'];
      $options = ( is_array( $options ) ) ? $options : array_filter( $this->element_data( $options ) );

      if( ! empty( $options ) ) {

        echo '<ul'. $this->element_class() .'>';
        foreach ( $options as $key => $value ) {
          echo '<li><label><input type="radio" name="'. $this->element_name() .'" value="'. $key .'"'. $this->element_attributes( $key ) . $this->checked( $this->element_value(), $key ) .'/> '. $value .'</label></li>';
        }
        echo '</ul>';
      }

    } else {
      $label = ( isset( $this->field['label'] ) ) ? $this->field['label'] : '';
      echo '<label><input type="radio" name="'. $this->element_name() .'" value="1"'. $this->element_class() . $this->element_attributes() . checked( $this->element_value(), 1, false ) .'/> '. $label .'</label>';
    }

    echo $this->element_after();

  }

}
block.json000064400000001661151556663010006545 0ustar00{
    "$schema": "https://schemas.wp.org/trunk/block.json",
    "apiVersion": 2,
    "name": "woocommerce/product-radio-field",
    "title": "Product radio control",
    "category": "woocommerce",
    "description": "The product radio.",
    "keywords": ["products", "radio", "input"],
    "textdomain": "default",
    "attributes": {
        "title": {
            "type": "string"
        },
        "description": {
            "type": "string"
        },
        "property": {
            "type": "string"
        },
        "options": {
            "type": "array",
            "items": {
                "type": "object"
            },
            "default": [],
            "__experimentalRole": "content"
        }
    },
    "supports": {
        "align": false,
        "html": false,
        "multiple": true,
        "reusable": false,
        "inserter": false,
        "lock": false,
        "__experimentalToolbar": false
    }
}
edit.js000064400000001210151556663010006031 0ustar00"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Edit=void 0;const element_1=require("@wordpress/element"),block_editor_1=require("@wordpress/block-editor"),core_data_1=require("@wordpress/core-data"),radio_field_1=require("../../components/radio-field");function Edit({attributes:e}){const t=(0,block_editor_1.useBlockProps)(),{description:r,options:o,property:i,title:d}=e,[s,n]=(0,core_data_1.useEntityProp)("postType","product",i);return(0,element_1.createElement)("div",{...t},(0,element_1.createElement)(radio_field_1.RadioField,{title:d,description:r,selected:s,options:o,onChange:e=>n(e||"")}))}exports.Edit=Edit;index.js000064400000001136151556663010006222 0ustar00"use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.init=exports.settings=exports.name=exports.metadata=void 0;const init_block_1=require("../../utils/init-block"),block_json_1=__importDefault(require("./block.json")),edit_1=require("./edit"),{name,...metadata}=block_json_1.default;function init(){return(0,init_block_1.initBlock)({name,metadata,settings:exports.settings})}exports.name=name,exports.metadata=metadata,exports.settings={example:{},edit:edit_1.Edit},exports.init=init;types.js000064400000000104151556663010006251 0ustar00"use strict";Object.defineProperty(exports,"__esModule",{value:!0});