capability.phtml
9 years ago
login-redirect.phtml
9 years ago
menu.phtml
9 years ago
metabox.phtml
9 years ago
post.phtml
9 years ago
redirect.phtml
9 years ago
teaser.phtml
9 years ago
metabox.phtml
101 lines
| 1 | <?php if (defined('AAM_KEY')) { ?> |
| 2 | <div class="aam-feature" id="metabox-content"> |
| 3 | <div class="aam-feature-top-actions text-right"> |
| 4 | <a href="#" class="btn btn-xs btn-primary" id="refresh-metabox-list"><i class="icon-arrows-cw"></i> <?php echo __('Refresh', AAM_KEY); ?></a> |
| 5 | <a href="#init-url-modal" class="btn btn-xs btn-primary" data-toggle="modal"><i class="icon-link"></i> <?php echo __('Init URL', AAM_KEY); ?></a> |
| 6 | </div> |
| 7 | |
| 8 | <?php if ($this->isOverwritten()) { ?> |
| 9 | <div class="row"> |
| 10 | <div class="col-xs-12"> |
| 11 | <div class="aam-overwrite"> |
| 12 | <span><i class="icon-check"></i> <?php echo __('Settings are customized', AAM_KEY); ?></span> |
| 13 | <span><a href="#" id="metabox-reset" class="btn btn-xs btn-danger"><?php echo __('Reset To Default', AAM_KEY); ?></a> |
| 14 | </div> |
| 15 | </div> |
| 16 | </div> |
| 17 | <?php } ?> |
| 18 | |
| 19 | <?php |
| 20 | global $wp_post_types; |
| 21 | |
| 22 | $first = false; |
| 23 | $object = AAM_Backend_View::getSubject()->getObject('metabox'); |
| 24 | $metaboxList = $this->getMetaboxList(); |
| 25 | ?> |
| 26 | |
| 27 | <?php if (!empty($metaboxList)) { ?> |
| 28 | <div class="panel-group" id="metabox-list" role="tablist"> |
| 29 | <?php foreach ($metaboxList as $screen => $metaboxes) { ?> |
| 30 | <div class="panel panel-default"> |
| 31 | <div class="panel-heading" role="tab" id="group-<?php echo $screen; ?>-heading"> |
| 32 | <h4 class="panel-title"> |
| 33 | <a role="button" data-toggle="collapse" data-parent="#metabox-list" href="#group-<?php echo $screen; ?>" aria-controls="group-<?php echo $screen; ?>" <?php if (!$first) { echo 'aria-expanded="true"'; } ?>> |
| 34 | <?php |
| 35 | switch ($screen) { |
| 36 | case 'dashboard': |
| 37 | echo __('Dashboard Widgets', AAM_KEY); |
| 38 | break; |
| 39 | |
| 40 | case 'widgets': |
| 41 | echo __('Frontend Widgets', AAM_KEY); |
| 42 | break; |
| 43 | |
| 44 | default: |
| 45 | echo $wp_post_types[$screen]->labels->name; |
| 46 | break; |
| 47 | } |
| 48 | ?> |
| 49 | </a> |
| 50 | </h4> |
| 51 | </div> |
| 52 | <div id="group-<?php echo $screen; ?>" class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>" role="tabpanel" aria-labelledby="group-<?php echo $screen; ?>-heading"> |
| 53 | <div class="panel-body"> |
| 54 | <div class="row aam-bordered"> |
| 55 | <?php foreach ($metaboxes as $metabox) { ?> |
| 56 | <div class="col-xs-12 col-md-6 aam-submenu-item"> |
| 57 | <label for="metabox-<?php echo $screen; ?>-<?php echo $metabox['id']; ?>"><?php echo $metabox['title']; ?></label> |
| 58 | <input type="checkbox" class="aam-checkbox-danger" id="metabox-<?php echo $screen; ?>-<?php echo $metabox['id']; ?>" data-metabox="<?php echo $screen; ?>|<?php echo $metabox['id']; ?>"<?php echo ($object->has($screen, $metabox['id']) ? ' checked="checked"' : ''); ?> /> |
| 59 | <label for="metabox-<?php echo $screen; ?>-<?php echo $metabox['id']; ?>"></label> |
| 60 | </div> |
| 61 | <?php } ?> |
| 62 | </div> |
| 63 | </div> |
| 64 | </div> |
| 65 | </div> |
| 66 | <?php } ?> |
| 67 | </div> |
| 68 | <?php } else { ?> |
| 69 | <div class="row"> |
| 70 | <div class="col-xs-12 text-center"> |
| 71 | <p class="aam-notification-message"><?php echo __('The list is not initialized. Click Refresh button above.'); ?></p> |
| 72 | </div> |
| 73 | </div> |
| 74 | <?php } ?> |
| 75 | |
| 76 | <div class="modal fade" id="init-url-modal" tabindex="-1" role="dialog"> |
| 77 | <div class="modal-dialog" role="document"> |
| 78 | <div class="modal-content"> |
| 79 | <div class="modal-header"> |
| 80 | <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button> |
| 81 | <h4 class="modal-title"><?php echo __('Initialize URL', AAM_KEY); ?></h4> |
| 82 | </div> |
| 83 | <div class="modal-body"> |
| 84 | <p class="aam-info"> |
| 85 | <?php echo __('Some metaboxes are conditional and appear on an edit screen when certain conditions are met. For example metabox "Comments" appears only for existing page and not for new page. That is why if you do not see a desired metabox below, try to copy & paste full URL to an edit screen where that metabox appears.'); ?> |
| 86 | </p> |
| 87 | <div class="form-group"> |
| 88 | <label><?php echo __('Backend page URL', AAM_KEY); ?></label> |
| 89 | <input type="text" class="form-control" id="init-url" placeholder="<?php echo __('Insert valid URL', AAM_KEY); ?>" /> |
| 90 | </div> |
| 91 | </div> |
| 92 | <div class="modal-footer"> |
| 93 | <button type="button" class="btn btn-success" id="init-url-btn"><?php echo __('Initialize', AAM_KEY); ?></button> |
| 94 | <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button> |
| 95 | </div> |
| 96 | </div> |
| 97 | </div> |
| 98 | </div> |
| 99 | |
| 100 | </div> |
| 101 | <?php } |