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/checkbox.tar
checkbox.php000064400000002567151555215520007063 0ustar00<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
/**
 *
 * Field: Checkbox
 *
 * @since 1.0.0
 * @version 1.0.0
 *
 */
class CSFramework_Option_checkbox 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="checkbox" 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="checkbox" 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.json000064400000001576151556770570006564 0ustar00{
    "$schema": "https://schemas.wp.org/trunk/block.json",
    "apiVersion": 2,
    "name": "woocommerce/product-checkbox-field",
    "title": "Product checkbox control",
    "category": "woocommerce",
    "description": "The product checkbox.",
    "keywords": ["products", "checkbox", "input"],
    "textdomain": "default",
    "attributes": {
        "title": {
            "type": "string",
            "__experimentalRole": "content"
        },
        "label": {
            "type": "string"
        },
        "property": {
            "type": "string"
        },
        "tooltip": {
            "type": "string"
        }
    },
    "supports": {
        "align": false,
        "html": false,
        "multiple": true,
        "reusable": false,
        "inserter": false,
        "lock": false,
        "__experimentalToolbar": false
    },
    "editorStyle": "file:./editor.css"
}
edit.js000064400000002260151556770570006051 0ustar00"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Edit=void 0;const element_1=require("@wordpress/element"),components_1=require("@wordpress/components"),block_editor_1=require("@wordpress/block-editor"),core_data_1=require("@wordpress/core-data"),icons_1=require("@wordpress/icons");function Edit({attributes:e}){const o=(0,block_editor_1.useBlockProps)({className:"woocommerce-product-form__checkbox"}),{property:t,title:r,label:c,tooltip:n}=e,[l,s]=(0,core_data_1.useEntityProp)("postType","product",t);return(0,element_1.createElement)("div",{...o},(0,element_1.createElement)("h4",null,r),(0,element_1.createElement)("div",{className:"woocommerce-product-form__checkbox-wrapper"},(0,element_1.createElement)(components_1.CheckboxControl,{label:c,checked:l,onChange:e=>s(e)}),n&&(0,element_1.createElement)(components_1.Tooltip,{text:(0,element_1.createElement)("span",null,n),position:"top center",className:"woocommerce-product-form__checkbox-tooltip",delay:0},(0,element_1.createElement)("span",{className:"woocommerce-product-form__checkbox-tooltip-icon"},(0,element_1.createElement)(icons_1.Icon,{icon:icons_1.help,size:21.94,fill:"#949494"})))))}exports.Edit=Edit;index.js000064400000001127151556770570006234 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;exports.name=name,exports.metadata=metadata,exports.settings={example:{},edit:edit_1.Edit};const init=()=>(0,init_block_1.initBlock)({name,metadata,settings:exports.settings});exports.init=init;