1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2024 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
7
7
// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound
8
- /** @var $block \Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\Options */
8
+ // phpcs:disable Generic.Files.LineLength.TooLong
9
+ /**
10
+ * @var $block \Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\Options
11
+ * @var \Magento\Framework\Escaper $escaper
12
+ */
13
+
9
14
10
15
$ stores = $ block ->getStoresSortedBySortOrder ();
11
16
?>
12
17
<fieldset class="admin__fieldset fieldset">
13
18
<legend class="legend">
14
- <span><?= $ block ->escapeHtml (__ ('Manage Options (Values of Your Attribute) ' )) ?> </span>
19
+ <span><?= $ escaper ->escapeHtml (__ ('Manage Options (Values of Your Attribute) ' )) ?> </span>
15
20
</legend><br />
16
21
<div class="admin__control-table-wrapper" id="manage-options-panel" data-index="attribute_options_select_container">
17
22
<table class="admin__control-table" data-index="attribute_options_select">
18
23
<thead>
19
24
<tr id="attribute-options-table">
20
25
<th class="col-draggable"></th>
21
26
<th class="col-default control-table-actions-th">
22
- <span><?= $ block ->escapeHtml (__ ('Is Default ' )) ?> </span>
27
+ <span><?= $ escaper ->escapeHtml (__ ('Is Default ' )) ?> </span>
23
28
</th>
24
29
<?php
25
- foreach ($ stores as $ _store ) :?>
26
- <th<?php if ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) :?> class="_required"<?php endif ; ?> >
27
- <span><?= $ block ->escapeHtml (__ ($ _store ->getName ())) ?> </span>
30
+ foreach ($ stores as $ _store ):?>
31
+ <th<?php if ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ):?> class="_required"<?php endif ; ?> >
32
+ <span><?= $ escaper ->escapeHtml (__ ($ _store ->getName ())) ?> </span>
28
33
</th>
29
34
<?php endforeach ;
30
35
$ storetotal = count ($ stores ) + 3 ;
@@ -38,15 +43,22 @@ $stores = $block->getStoresSortedBySortOrder();
38
43
<th colspan="<?= (int )$ storetotal ?> " class="validation">
39
44
<input type="hidden" class="required-dropdown-attribute-entry" name="dropdown_attribute_validation"/>
40
45
<input type="hidden" class="required-dropdown-attribute-unique" name="dropdown_attribute_validation_unique"/>
46
+ <input type="hidden" name="reset_is-default_option"/>
41
47
</th>
42
48
</tr>
43
49
<tr>
44
50
<th colspan="<?= (int ) $ storetotal ?> " class="col-actions-add">
45
- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) :?>
51
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()):?>
46
52
<button id="add_new_option_button" data-action="add_new_row"
47
- title="<?= $ block ->escapeHtml (__ ('Add Option ' )) ?> "
53
+ title="<?= $ escaper ->escapeHtml (__ ('Add Option ' )) ?> "
48
54
type="button" class="action- scalable add">
49
- <span><?= $ block ->escapeHtml (__ ('Add Option ' )) ?> </span>
55
+ <span><?= $ escaper ->escapeHtml (__ ('Add Option ' )) ?> </span>
56
+ </button>
57
+
58
+ <button id="reset_default_options_option_button"
59
+ title="<?= $ escaper ->escapeHtml (__ ('Reset Is Default ' )) ?> "
60
+ type="button" class="action- scalable reset">
61
+ <span><?= $ escaper ->escapeHtml (__ ('Reset Is Default ' )) ?> </span>
50
62
</button>
51
63
<?php endif ; ?>
52
64
</th>
@@ -58,26 +70,26 @@ $stores = $block->getStoresSortedBySortOrder();
58
70
<script id="row-template" type="text/x-magento-template">
59
71
<tr <% if (data.rowClasses) { %>class="<%- data.rowClasses %>"<% } %>>
60
72
<td class="col-draggable">
61
- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) :?>
73
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()):?>
62
74
<div data-role="draggable-handle" class="draggable-handle"
63
- title="<?= $ block ->escapeHtml (__ ('Sort Option ' )) ?> ">
75
+ title="<?= $ escaper ->escapeHtml (__ ('Sort Option ' )) ?> ">
64
76
</div>
65
77
<?php endif ; ?>
66
- <input data-role="order" type="hidden" name="option[order][<%- data.id %>]" value="<%- data.sort_order %>" <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()) :?> disabled="disabled"<?php endif ; ?> />
78
+ <input data-role="order" type="hidden" name="option[order][<%- data.id %>]" value="<%- data.sort_order %>" <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()):?> disabled="disabled"<?php endif ; ?> />
67
79
</td>
68
80
<td class="col-default control-table-actions-cell">
69
- <input class="input-radio" type="<%- data.intype %>" name="default[]" value="<%- data.id %>" <%- data.checked %><?php if ($ block ->getReadOnly ()) :?> disabled="disabled"<?php endif ;?> />
81
+ <input class="input-radio" type="<%- data.intype %>" name="default[]" value="<%- data.id %>" <%- data.checked %><?php if ($ block ->getReadOnly ()):?> disabled="disabled"<?php endif ;?> />
70
82
</td>
71
- <?php foreach ($ stores as $ _store ) :?>
72
- <td class="col-<%- data.id %>"><input name="option[value][<%- data.id %>][<?= (int ) $ _store ->getId () ?> ]" value="<%- data.store<?= /* @noEscape */ (int ) $ _store ->getId () ?> %>" class="input-text<?php if ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) :?> required-option required-unique<?php endif ; ?> " type="text" <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()) :?> disabled="disabled"<?php endif ;?> /></td>
83
+ <?php foreach ($ stores as $ _store ):?>
84
+ <td class="col-<%- data.id %>"><input name="option[value][<%- data.id %>][<?= (int ) $ _store ->getId () ?> ]" value="<%- data.store<?= /* @noEscape */ (int ) $ _store ->getId () ?> %>" class="input-text<?php if ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ):?> required-option required-unique<?php endif ; ?> " type="text" <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()):?> disabled="disabled"<?php endif ;?> /></td>
73
85
<?php endforeach ; ?>
74
86
<td id="delete_button_container_<%- data.id %>" class="col-delete">
75
87
<input type="hidden" class="delete-flag" name="option[delete][<%- data.id %>]" value="" />
76
- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) :?>
77
- <button id="delete_button_<%- data.id %>" title="<?= $ block ->escapeHtml (__ ('Delete ' )) ?> " type="button"
88
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()):?>
89
+ <button id="delete_button_<%- data.id %>" title="<?= $ escaper ->escapeHtml (__ ('Delete ' )) ?> " type="button"
78
90
class="action- scalable delete delete-option"
79
91
>
80
- <span><?= $ block ->escapeHtml (__ ('Delete ' )) ?> </span>
92
+ <span><?= $ escaper ->escapeHtml (__ ('Delete ' )) ?> </span>
81
93
</button>
82
94
<?php endif ;?>
83
95
</td>
@@ -102,7 +114,7 @@ $stores = $block->getStoresSortedBySortOrder();
102
114
},
103
115
"Magento_Catalog/catalog/product/attribute/unique-validate": {
104
116
"element": "required-dropdown-attribute-unique",
105
- "message": "<?= $ block ->escapeHtml (__ ("The value of Admin must be unique. " )) ?> "
117
+ "message": "<?= $ escaper ->escapeHtml (__ ("The value of Admin must be unique. " )) ?> "
106
118
}
107
119
}
108
120
}
0 commit comments