404redirect.phtml
8 years ago
capability.phtml
8 years ago
login-redirect.phtml
8 years ago
logout-redirect.phtml
8 years ago
menu.phtml
8 years ago
metabox.phtml
8 years ago
post.phtml
8 years ago
redirect.phtml
8 years ago
route.phtml
8 years ago
404redirect.phtml
65 lines
| 1 | <?php if (defined('AAM_KEY')) { ?> |
| 2 | <div class="aam-feature" id="404redirect-content"> |
| 3 | <?php if (AAM_Backend_Subject::getInstance()->getUID() == AAM_Core_Subject_Default::UID) { ?> |
| 4 | <div class="row"> |
| 5 | <div class="col-xs-12"> |
| 6 | <p class="aam-info"> |
| 7 | <?php echo AAM_Backend_View_Helper::preparePhrase('Setup [default] 404 redirect for all none-existing pages.', 'strong'); ?> |
| 8 | </p> |
| 9 | </div> |
| 10 | </div> |
| 11 | <?php } ?> |
| 12 | |
| 13 | <div class="row"> |
| 14 | <div class="col-xs-12"> |
| 15 | <?php if (AAM_Backend_Subject::getInstance()->getUID() == AAM_Core_Subject_Default::UID) { ?> |
| 16 | <?php $type = AAM_Core_Config::get('frontend.404redirect.type', 'default'); ?> |
| 17 | |
| 18 | <div class="radio"> |
| 19 | <input type="radio" name="frontend.404redirect.type" id="frontend-404redirect-default" value="default" data-action="none"<?php echo ($type == 'default' ? ' checked' : ''); ?> /> |
| 20 | <label for="frontend-404redirect-default"><?php echo AAM_Backend_View_Helper::preparePhrase('Default WordPress 404 handler', 'small'); ?></label> |
| 21 | </div> |
| 22 | <div class="radio"> |
| 23 | <input type="radio" name="frontend.404redirect.type" id="frontend-404redirect-page" data-action="#404redirect-page-action" value="page"<?php echo ($type == 'page' ? ' checked' : ''); ?> /> |
| 24 | <label for="frontend-404redirect-page"><?php echo AAM_Backend_View_Helper::preparePhrase('Redirected to existing page [(select from the drop-down)]', 'small'); ?></label> |
| 25 | </div> |
| 26 | <div class="radio"> |
| 27 | <input type="radio" name="frontend.404redirect.type" id="frontend-404redirect-url" data-action="#404redirect-url-action" value="url"<?php echo ($type == 'url' ? ' checked' : ''); ?> /> |
| 28 | <label for="frontend-404redirect-url"><?php echo AAM_Backend_View_Helper::preparePhrase('Redirected to the URL [(enter valid URL starting from http or https)]', 'small'); ?></label> |
| 29 | </div> |
| 30 | <div class="radio"> |
| 31 | <input type="radio" name="frontend.404redirect.type" id="frontend-404redirect-callback" data-action="#404redirect-callback-action" value="callback"<?php echo ($type == 'callback' ? ' checked' : ''); ?> /> |
| 32 | <label for="frontend-404redirect-callback"><?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('Trigger PHP callback function [(valid %sPHP callback%s is required)]', 'small'), '<a href="http://php.net/manual/en/language.types.callable.php" target="_blank">', '</a>'); ?></label> |
| 33 | </div> |
| 34 | |
| 35 | <div class="form-group aam-404redirect-action" id="404redirect-page-action" style="display: <?php echo ($type == 'page' ? 'block' : 'none'); ?>;"> |
| 36 | <label for="frontend-page"><?php echo __('Existing Page', AAM_KEY); ?></label> |
| 37 | <?php |
| 38 | wp_dropdown_pages(array( |
| 39 | 'depth' => 99, |
| 40 | 'selected' => AAM_Core_Config::get('frontend.404redirect.page'), |
| 41 | 'echo' => 1, |
| 42 | 'name' => 'frontend.404redirect.page', |
| 43 | 'id' => '404-redirect-page', // string |
| 44 | 'class' => 'form-control', // string |
| 45 | 'show_option_none' => __('-- Select Page --', AAM_KEY) // string |
| 46 | )); |
| 47 | ?> |
| 48 | </div> |
| 49 | |
| 50 | <div class="form-group aam-404redirect-action" id="404redirect-url-action" style="display: <?php echo ($type == 'url' ? 'block' : 'none'); ?>;"> |
| 51 | <label for="frontend-url"><?php echo __('The URL', AAM_KEY); ?></label> |
| 52 | <input type="text" class="form-control" name="frontend.404redirect.url" placeholder="http://" value="<?php echo AAM_Core_Config::get('frontend.404redirect.url'); ?>" /> |
| 53 | </div> |
| 54 | |
| 55 | <div class="form-group aam-404redirect-action" id="404redirect-callback-action" style="display: <?php echo ($type == 'callback' ? 'block' : 'none'); ?>;"> |
| 56 | <label for="frontend-url"><?php echo __('PHP Callback Function', AAM_KEY); ?></label> |
| 57 | <input type="text" class="form-control" placeholder="Enter valid callback" name="frontend.404redirect.callback" value="<?php echo AAM_Core_Config::get('frontend.404redirect.callback'); ?>" /> |
| 58 | </div> |
| 59 | <?php } else { ?> |
| 60 | <p class="alert alert-info text-center"><?php echo AAM_Backend_View_Helper::preparePhrase('You cannot setup 404 redirect for specific user, role or visitors. Switch to [Manage Default Access] and define default 404 redirect for everybody.', 'strong'); ?></p> |
| 61 | <?php } ?> |
| 62 | </div> |
| 63 | </div> |
| 64 | </div> |
| 65 | <?php } |