File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/attributes.tar
tab-panel.php 0000644 00000001350 15154414342 0007122 0 ustar 00 <?php
declare( strict_types=1 );
use Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView;
defined( 'ABSPATH' ) || exit;
/**
* @var PHPView $this
*/
/**
* @var array $form
*/
$form = $this->form
?>
<div id="gla_attributes" class="panel woocommerce_options_panel">
<h2><?php esc_html_e( 'Product attributes', 'google-listings-and-ads' ); ?></h2>
<p class="show_if_variable"><?php esc_html_e( 'As this is a variable product, you can add additional product attributes by going to Variations > Select one variation > Google for WooCommerce.', 'google-listings-and-ads' ); ?></p>
<?php
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $this->render_partial( 'inputs/form', [ 'form' => $form ] );
?>
</div>
variations-form.php 0000644 00000003430 15154414343 0010401 0 ustar 00 <?php
declare( strict_types=1 );
use Automattic\WooCommerce\GoogleListingsAndAds\Admin\Input\SelectWithTextInput;
use Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView;
defined( 'ABSPATH' ) || exit;
/**
* @var PHPView $this
*/
/**
* @var array $children
*/
$children = $this->children;
?>
<?php if ( $this->is_root ) : ?>
<div class="gla-metabox wc-metabox closed">
<h3>
<strong><?php esc_html_e( 'Google for WooCommerce', 'google-listings-and-ads' ); ?></strong>
<div class="handlediv" aria-label="Click to toggle"></div>
</h3>
<div class="wc-metabox-content" style="display: none;">
<?php endif; ?>
<?php
foreach ( $children as $form ) {
if ( ! empty( $form['type'] ) ) {
$form['wrapper_class'] =
sprintf( '%s %s', $form['wrapper_class'] ?? '', 'form-row form-row-full' );
if ( 'select-with-text-input' === $form['type'] && ! empty( $form['children'][ SelectWithTextInput::SELECT_INPUT_KEY ] ) && ! empty( $form['children'][ SelectWithTextInput::CUSTOM_INPUT_KEY ] ) ) {
$form['children'][ SelectWithTextInput::SELECT_INPUT_KEY ]['wrapper_class'] =
sprintf( '%s %s', $form['children'][ SelectWithTextInput::SELECT_INPUT_KEY ]['wrapper_class'] ?? '', 'form-row form-row-first' );
$form['children'][ SelectWithTextInput::CUSTOM_INPUT_KEY ]['wrapper_class'] =
sprintf( '%s %s', $form['children'][ SelectWithTextInput::CUSTOM_INPUT_KEY ]['wrapper_class'] ?? '', 'form-row form-row-last' );
}
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $this->render_partial( 'inputs/form', [ 'form' => $form ] );
} else {
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $this->render_partial( 'attributes/variations-form', $form );
}
}
?>
<?php if ( $this->is_root ) : ?>
</div>
</div>
<?php endif; ?>
block.json 0000644 00000001273 15155647062 0006547 0 ustar 00 {
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "woocommerce/product-attributes-field",
"title": "Product attributes",
"category": "widgets",
"description": "The product attributes.",
"keywords": ["products", "attributes"],
"textdomain": "default",
"attributes": {
"name": {
"type": "string",
"__experimentalRole": "content"
}
},
"supports": {
"align": false,
"html": false,
"multiple": false,
"reusable": false,
"inserter": false,
"lock": false,
"__experimentalToolbar": false
},
"editorStyle": "file:./editor.css"
}
edit.js 0000644 00000001160 15155647062 0006040 0 ustar 00 "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"),attributes_1=require("../../components/attributes/attributes");function Edit(){const[e,t]=(0,core_data_1.useEntityProp)("postType","product","attributes"),r=(0,core_data_1.useEntityId)("postType","product"),o=(0,block_editor_1.useBlockProps)();return(0,element_1.createElement)("div",{...o},(0,element_1.createElement)(attributes_1.Attributes,{productId:r,value:e,onChange:t}))}exports.Edit=Edit; index.js 0000644 00000001135 15155647062 0006224 0 ustar 00 "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 utils_1=require("../../utils"),block_json_1=__importDefault(require("./block.json"));exports.metadata=block_json_1.default;const edit_1=require("./edit"),{name}=block_json_1.default;exports.name=name,exports.settings={example:{},edit:edit_1.Edit};const init=()=>(0,utils_1.initBlock)({name,metadata:block_json_1.default,settings:exports.settings});exports.init=init;