OrderScriptsController.php
3 months ago
OrdersListTable.php
2 months ago
OrdersViewController.php
1 year ago
OrderScriptsController.php
51 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCart\Controllers\Admin\Orders; |
| 4 | |
| 5 | use SureCart\Support\Scripts\AdminModelEditController; |
| 6 | |
| 7 | /** |
| 8 | * Coupon page |
| 9 | */ |
| 10 | class OrderScriptsController extends AdminModelEditController { |
| 11 | /** |
| 12 | * What types of data to add the the page. |
| 13 | * |
| 14 | * @var array |
| 15 | */ |
| 16 | protected $with_data = [ 'currency', 'supported_currencies', 'links', 'shipping_protocol', 'i18n', 'google_map_api_key' ]; |
| 17 | |
| 18 | /** |
| 19 | * Script handle. |
| 20 | * |
| 21 | * @var string |
| 22 | */ |
| 23 | protected $handle = 'surecart/scripts/admin/order'; |
| 24 | |
| 25 | /** |
| 26 | * Script path. |
| 27 | * |
| 28 | * @var string |
| 29 | */ |
| 30 | protected $path = 'admin/orders'; |
| 31 | |
| 32 | /** |
| 33 | * Enqueue scripts. |
| 34 | * |
| 35 | * @return void |
| 36 | */ |
| 37 | public function enqueue() { |
| 38 | parent::enqueue(); |
| 39 | // Enqueue CodeMirror editor with wp.codeEditor API. |
| 40 | wp_enqueue_code_editor( |
| 41 | [ |
| 42 | 'type' => 'application/json', |
| 43 | 'codemirror' => [ |
| 44 | 'indentUnit' => 2, |
| 45 | 'tabSize' => 2, |
| 46 | ], |
| 47 | ] |
| 48 | ); |
| 49 | } |
| 50 | } |
| 51 |