access-denied-redirect.php
1 year ago
admin-toolbar.php
1 year ago
api-route.php
1 year ago
backend-menu.php
1 year ago
capability.php
1 year ago
content.php
1 year ago
identity.php
1 year ago
jwt.php
5 months ago
login-redirect.php
1 year ago
logout-redirect.php
1 year ago
metabox.php
1 year ago
not-found-redirect.php
1 year ago
policy.php
1 year ago
url.php
1 year ago
welcome.php
1 year ago
widget.php
1 year ago
admin-toolbar.php
193 lines
| 1 | <?php /** @version 7.0.0 **/ ?> |
| 2 | |
| 3 | <?php if (defined('AAM_KEY')) { ?> |
| 4 | <?php |
| 5 | $access_level = AAM_Backend_AccessLevel::get_instance(); |
| 6 | $service = $access_level->admin_toolbar(); |
| 7 | ?> |
| 8 | <div class="aam-feature" id="toolbar-content"> |
| 9 | <div class="row"> |
| 10 | <div class="col-xs-12"> |
| 11 | <p class="aam-info"> |
| 12 | <?php echo AAM_Backend_View_Helper::preparePhrase('[Note!] Toolbar service does not restrict direct access to linked pages. It is used only to remove unnecessary items from the top toolbar. Use the [Backend Menu] service to manage direct access to backend pages or customize it with capabilities.', 'b', 'b'); ?> |
| 13 | </p> |
| 14 | </div> |
| 15 | </div> |
| 16 | |
| 17 | <div class="row"> |
| 18 | <div class="col-xs-12"> |
| 19 | <div |
| 20 | class="aam-overwrite" |
| 21 | id="aam_toolbar_overwrite" |
| 22 | style="display: <?php echo ($service->is_customized() ? 'block' : 'none'); ?>" |
| 23 | > |
| 24 | <span><i class="icon-check"></i> <?php echo __('Settings are customized', 'advanced-access-manager'); ?></span> |
| 25 | <span><a href="#" id="toolbar_reset" class="btn btn-xs btn-primary"><?php echo __('Reset to default', 'advanced-access-manager'); ?></a></span> |
| 26 | </div> |
| 27 | </div> |
| 28 | </div> |
| 29 | |
| 30 | <?php echo apply_filters('aam_ui_admin_toolbar_mode_panel_filter', '', $service); ?> |
| 31 | |
| 32 | <div class="panel-group" id="toolbar_list" role="tablist" aria-multiselectable="true"> |
| 33 | <?php |
| 34 | $first = false; |
| 35 | $toolbar = $service->get_items(); |
| 36 | |
| 37 | if (!empty($toolbar)) { ?> |
| 38 | <?php foreach ($toolbar as $branch) { ?> |
| 39 | <div class="panel panel-default"> |
| 40 | <div |
| 41 | class="panel-heading" |
| 42 | role="tab" |
| 43 | id="toolbar_<?php echo esc_attr($branch['slug']); ?>_heading" |
| 44 | > |
| 45 | <h4 class="panel-title"> |
| 46 | <a |
| 47 | role="button" |
| 48 | data-toggle="collapse" |
| 49 | data-parent="#toolbar_list" |
| 50 | href="#toolbar_<?php echo esc_attr($branch['slug']); ?>" |
| 51 | aria-controls="toolbar_<?php echo esc_attr($branch['slug']); ?>" |
| 52 | <?php if (!$first) { echo 'aria-expanded="true"'; } ?> |
| 53 | > |
| 54 | <?php echo esc_js($branch['name']); ?> <small class="aam-menu-capability"><?php echo esc_js($branch['uri']); ?></small> |
| 55 | </a> |
| 56 | <?php if ($branch['is_restricted']) { ?> |
| 57 | <i class="aam-panel-title-icon icon-lock text-danger"></i> |
| 58 | <?php } ?> |
| 59 | </h4> |
| 60 | </div> |
| 61 | |
| 62 | <div |
| 63 | id="toolbar_<?php echo esc_attr($branch['slug']); ?>" |
| 64 | class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>" |
| 65 | role="tabpanel" |
| 66 | aria-labelledby="toolbar_<?php echo esc_attr($branch['slug']); ?>_heading" |
| 67 | > |
| 68 | <div class="panel-body"> |
| 69 | <div class="row aam-inner-tab"> |
| 70 | <div class="col-xs-12 text-center"> |
| 71 | <small class="aam-menu-capability"><?php echo __('Item ID:', 'advanced-access-manager'); ?> <b><?php echo esc_js($branch['slug']); ?></b></small> |
| 72 | </div> |
| 73 | </div> |
| 74 | |
| 75 | <hr class="aam-divider" /> |
| 76 | |
| 77 | <?php if (count($branch['children'])) { ?> |
| 78 | <div class="row aam-inner-tab aam-menu-expended-list"> |
| 79 | <?php foreach ($branch['children'] as $child) { ?> |
| 80 | <div class="col-xs-12 col-md-6 aam-submenu-item"> |
| 81 | <div class="aam-menu-details"> |
| 82 | <?php echo esc_js($child['name']); ?> |
| 83 | <small> |
| 84 | <a |
| 85 | href="#toolbar-details-modal" |
| 86 | data-toggle="modal" |
| 87 | data-uri="<?php echo esc_attr($child['uri']); ?>" |
| 88 | data-id="<?php echo esc_attr($child['slug']); ?>" |
| 89 | data-name="<?php echo esc_attr($child['name']); ?>" |
| 90 | class="aam-toolbar-item" |
| 91 | ><?php echo __('more details', 'advanced-access-manager'); ?></a> |
| 92 | </small> |
| 93 | </div> |
| 94 | |
| 95 | <?php if ($child['is_restricted']) { ?> |
| 96 | <i |
| 97 | class="aam-accordion-action icon-lock text-danger" |
| 98 | data-toolbar="<?php echo esc_attr($child['slug']); ?>" |
| 99 | ></i> |
| 100 | <?php } else { ?> |
| 101 | <i |
| 102 | class="aam-accordion-action icon-lock-open text-success" |
| 103 | data-toolbar="<?php echo esc_attr($child['slug']); ?>" |
| 104 | ></i> |
| 105 | <?php } ?> |
| 106 | |
| 107 | <label |
| 108 | for="toolbar_<?php echo esc_attr($child['slug']); ?>" |
| 109 | data-toggle="tooltip" |
| 110 | title="<?php echo ($child['is_restricted'] ? __('Uncheck to allow', 'advanced-access-manager') : __('Check to restrict', 'advanced-access-manager')); ?>" |
| 111 | ></label> |
| 112 | </div> |
| 113 | <?php } ?> |
| 114 | </div> |
| 115 | <hr class="aam-divider" /> |
| 116 | <?php } ?> |
| 117 | |
| 118 | <div class="row aam-margin-top-xs"> |
| 119 | <div class="col-xs-10 col-md-6 col-xs-offset-1 col-md-offset-3"> |
| 120 | <?php if ($branch['is_restricted']) { ?> |
| 121 | <a |
| 122 | href="#" |
| 123 | class="btn btn-primary btn-sm btn-block aam-restrict-toolbar" |
| 124 | data-toolbar="<?php echo esc_attr($branch['slug']); ?>" |
| 125 | data-target="#toolbar_<?php echo esc_attr($branch['slug']); ?>" |
| 126 | > |
| 127 | <i class="icon-lock-open"></i> <?php echo __('Show Menu Branch', 'advanced-access-manager'); ?> |
| 128 | </a> |
| 129 | <?php } else { ?> |
| 130 | <a |
| 131 | href="#" |
| 132 | class="btn btn-danger btn-sm btn-block aam-restrict-toolbar" |
| 133 | data-toolbar="<?php echo esc_attr($branch['slug']); ?>" |
| 134 | data-target="#toolbar_<?php echo esc_attr($branch['slug']); ?>" |
| 135 | > |
| 136 | <i class="icon-lock"></i> <?php echo __('Hide Menu Branch', 'advanced-access-manager'); ?> |
| 137 | </a> |
| 138 | <?php } ?> |
| 139 | </div> |
| 140 | </div> |
| 141 | </div> |
| 142 | </div> |
| 143 | </div> |
| 144 | |
| 145 | <div class="modal fade" id="toolbar-details-modal" tabindex="-1" role="dialog"> |
| 146 | <div class="modal-dialog" role="document"> |
| 147 | <div class="modal-content"> |
| 148 | <div class="modal-header"> |
| 149 | <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', 'advanced-access-manager'); ?>"><span aria-hidden="true">×</span></button> |
| 150 | <h4 class="modal-title"><?php echo __('Item Details', 'advanced-access-manager'); ?></h4> |
| 151 | </div> |
| 152 | <div class="modal-body"> |
| 153 | <table class="table table-striped table-bordered"> |
| 154 | <tbody> |
| 155 | <tr> |
| 156 | <th width="35%"><?php echo __('Name', 'advanced-access-manager'); ?></th> |
| 157 | <td id="toolbar-item-name"></td> |
| 158 | </tr> |
| 159 | <tr> |
| 160 | <th width="35%"><?php echo __('Admin Page URL', 'advanced-access-manager'); ?></th> |
| 161 | <td id="toolbar-item-uri"></td> |
| 162 | </tr> |
| 163 | <tr> |
| 164 | <th width="35%"><?php echo __('ID', 'advanced-access-manager'); ?></th> |
| 165 | <td id="toolbar-item-id"></td> |
| 166 | </tr> |
| 167 | </tbody> |
| 168 | </table> |
| 169 | </div> |
| 170 | <div class="modal-footer"> |
| 171 | <button |
| 172 | type="button" |
| 173 | class="btn btn-default" |
| 174 | data-dismiss="modal" |
| 175 | ><?php echo __('Close', 'advanced-access-manager'); ?></button> |
| 176 | </div> |
| 177 | </div> |
| 178 | </div> |
| 179 | </div> |
| 180 | <?php } ?> |
| 181 | <?php } else { ?> |
| 182 | <div class="row"> |
| 183 | <div class="col-xs-12"> |
| 184 | <p class="aam-info"> |
| 185 | <?php echo __('The list of admin toolbar items is not initialized. Reload the page.', 'advanced-access-manager'); ?> |
| 186 | </p> |
| 187 | </div> |
| 188 | </div> |
| 189 | <?php } |
| 190 | ?> |
| 191 | </div> |
| 192 | </div> |
| 193 | <?php } |