bulk-edit.php
3 years ago
col-sidebars.php
1 year ago
import.php
1 year ago
metabox.php
1 year ago
quick-edit.php
9 years ago
widgets-delete.php
3 years ago
widgets-editor.php
1 year ago
widgets-export.php
1 year ago
widgets-location.php
1 year ago
widgets.php
3 years ago
widgets.php
160 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Updates the default widgets page of the admin area. |
| 4 | * There are some HTML to be added for having all the functionality, so we |
| 5 | * include it at the begining of the page, and it's placed later via js. |
| 6 | */ |
| 7 | ?> |
| 8 | |
| 9 | <div id="cs-widgets-extra"> |
| 10 | |
| 11 | <?php /* |
| 12 | ============================================================================ |
| 13 | ===== WIDGET head |
| 14 | ============================================================================ |
| 15 | */ ?> |
| 16 | <div id="cs-title-options"> |
| 17 | <h2><?php esc_html_e( 'Sidebars', 'custom-sidebars' ); ?></h2> |
| 18 | <div id="cs-options" class="csb cs-options"> |
| 19 | <button type="button" class="button button-primary cs-action btn-create-sidebar"> |
| 20 | <i class="dashicons dashicons-plus-alt"></i> |
| 21 | <?php esc_html_e( 'Create a new sidebar', 'custom-sidebars' ); ?> |
| 22 | </button> |
| 23 | <?php |
| 24 | /** |
| 25 | * Show additional functions in the widget header. |
| 26 | */ |
| 27 | do_action( 'cs_widget_header' ); |
| 28 | ?> |
| 29 | </div> |
| 30 | </div> |
| 31 | |
| 32 | |
| 33 | <?php /* |
| 34 | ============================================================================ |
| 35 | ===== LANGUAGE |
| 36 | ============================================================================ |
| 37 | */ ?> |
| 38 | <script> |
| 39 | csSidebarsData = { |
| 40 | 'title_edit': "<?php esc_html_e( 'Edit [Sidebar]', 'custom-sidebars' ); ?>", |
| 41 | 'title_new': "<?php esc_html_e( 'New Custom Sidebar', 'custom-sidebars' ); ?>", |
| 42 | 'btn_edit': "<?php esc_html_e( 'Save Changes', 'custom-sidebars' ); ?>", |
| 43 | 'btn_new': "<?php esc_html_e( 'Create Sidebar', 'custom-sidebars' ); ?>", |
| 44 | 'title_delete': "<?php esc_html_e( 'Delete Sidebar', 'custom-sidebars' ); ?>", |
| 45 | 'title_location': "<?php esc_html_e( 'Define where you want this sidebar to appear.', 'custom-sidebars' ); ?>", |
| 46 | 'title_export': "<?php esc_html_e( 'Import / Export Sidebars', 'custom-sidebars' ); ?>", |
| 47 | 'custom_sidebars': "<?php esc_html_e( 'Custom Sidebars', 'custom-sidebars' ); ?>", |
| 48 | 'theme_sidebars': "<?php esc_html_e( 'Theme Sidebars', 'custom-sidebars' ); ?>", |
| 49 | 'ajax_error': "<?php esc_html_e( 'Couldn\'t load data from WordPress...', 'custom-sidebars' ); ?>", |
| 50 | 'lbl_replaceable': "<?php esc_html_e( 'This sidebar can be replaced on certain pages', 'custom-sidebars' ); ?>", |
| 51 | 'replace_tip': "<?php esc_html_e( 'Activate this option to replace the sidebar with one of your custom sidebars.', 'custom-sidebars' ); ?>", |
| 52 | 'filter': "<?php esc_html_e( 'Filter...', 'custom-sidebars' ); ?>", |
| 53 | 'replaceable': <?php echo json_encode( (object) CustomSidebars::get_options( 'modifiable' ) ); ?>, |
| 54 | '_wpnonce_get': "<?php echo esc_attr( wp_create_nonce( 'custom-sidebars-get' ) ); ?>" |
| 55 | }; |
| 56 | </script> |
| 57 | |
| 58 | |
| 59 | <?php /* |
| 60 | ============================================================================ |
| 61 | ===== TOOLBAR for custom sidebars |
| 62 | ============================================================================ |
| 63 | */ ?> |
| 64 | <div class="cs-custom-sidebar cs-toolbar"> |
| 65 | <a |
| 66 | class="cs-tool delete-sidebar" |
| 67 | data-action="delete" |
| 68 | href="#" |
| 69 | title="<?php esc_html_e( 'Delete this sidebar.', 'custom-sidebars' ); ?>" |
| 70 | > |
| 71 | <i class="dashicons dashicons-trash"></i> |
| 72 | </a> |
| 73 | <span class="cs-separator">|</span> |
| 74 | <a |
| 75 | class="cs-tool" |
| 76 | data-action="edit" |
| 77 | href="#" |
| 78 | title="<?php esc_html_e( 'Edit this sidebar.', 'custom-sidebars' ); ?>" |
| 79 | > |
| 80 | <?php esc_html_e( 'Edit', 'custom-sidebars' ); ?> |
| 81 | </a> |
| 82 | <span class="cs-separator">|</span> |
| 83 | <a |
| 84 | class="cs-tool" |
| 85 | data-action="location" |
| 86 | href="#" |
| 87 | title="<?php esc_html_e( 'Where do you want to show the sidebar?', 'custom-sidebars' ); ?>" |
| 88 | > |
| 89 | <?php esc_html_e( 'Sidebar Location', 'custom-sidebars' ); ?> |
| 90 | </a> |
| 91 | <span class="cs-separator">|</span> |
| 92 | </div> |
| 93 | |
| 94 | |
| 95 | <?php /* |
| 96 | ============================================================================ |
| 97 | ===== TOOLBAR for theme sidebars |
| 98 | ============================================================================ |
| 99 | */ ?> |
| 100 | <div class="cs-theme-sidebar cs-toolbar"> |
| 101 | <label |
| 102 | for="cs-replaceable" |
| 103 | class="cs-tool btn-replaceable" |
| 104 | data-action="replaceable" |
| 105 | data-on="<?php esc_html_e( 'This sidebar can be replaced on certain pages', 'custom-sidebars' ); ?>" |
| 106 | data-off="<?php esc_html_e( 'This sidebar will always be same on all pages', 'custom-sidebars' ); ?>" |
| 107 | > |
| 108 | <span class="icon"></span> |
| 109 | <input |
| 110 | type="checkbox" |
| 111 | id="" |
| 112 | class="has-label chk-replaceable" |
| 113 | /> |
| 114 | <span class="is-label"> |
| 115 | <?php esc_html_e( 'Allow this sidebar to be replaced', 'custom-sidebars' ); ?> |
| 116 | </span> |
| 117 | </label> |
| 118 | </div> |
| 119 | |
| 120 | |
| 121 | <?php /* |
| 122 | ============================================================================ |
| 123 | ===== DELETE SIDEBAR confirmation |
| 124 | ============================================================================ |
| 125 | */ ?> |
| 126 | <div class="cs-delete"> |
| 127 | <?php include CSB_VIEWS_DIR . 'widgets-delete.php'; ?> |
| 128 | </div> |
| 129 | |
| 130 | |
| 131 | <?php /* |
| 132 | ============================================================================ |
| 133 | ===== ADD/EDIT SIDEBAR |
| 134 | ============================================================================ |
| 135 | */ ?> |
| 136 | <div class="cs-editor"> |
| 137 | <?php include CSB_VIEWS_DIR . 'widgets-editor.php'; ?> |
| 138 | </div> |
| 139 | |
| 140 | |
| 141 | <?php /* |
| 142 | ============================================================================ |
| 143 | ===== EXPORT |
| 144 | ============================================================================ |
| 145 | */ ?> |
| 146 | <div class="cs-export"> |
| 147 | <?php include CSB_VIEWS_DIR . 'widgets-export.php'; ?> |
| 148 | </div> |
| 149 | |
| 150 | <?php /* |
| 151 | ============================================================================ |
| 152 | ===== LOCATION popup. |
| 153 | ============================================================================ |
| 154 | */ ?> |
| 155 | <div class="cs-location"> |
| 156 | <?php include CSB_VIEWS_DIR . 'widgets-location.php'; ?> |
| 157 | </div> |
| 158 | |
| 159 | </div> |
| 160 |