PageRenderTime 48ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/monkeyman-rewrite-analyzer/ui/rewrite-analyzer.php

https://github.com/obihann/BigScaryList
PHP | 64 lines | 60 code | 4 blank | 0 comment | 7 complexity | f034c5957e0166cb016f4e7c1730d6c0 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1
  1. <div class="wrap">
  2. <h2><?php _e( 'Rewrite analyzer', $gettext_domain ); ?></h2>
  3. <?php if ( ! $rewrite_rules ) : ?>
  4. <div class="error"><p><?php printf( __( 'Pretty permalinks are disabled, you can change this on <a href="%s">the Permalinks settings page</a>.',
  5. $gettext_domain ), admin_url( 'options-permalink.php' ) ); ?></p></div>
  6. <?php else : ?>
  7. <form>
  8. <table class="form-table">
  9. <tbody>
  10. <tr valign="top">
  11. <th scope="row"><label for="monkeyman-regex-tester"><?php _e( 'Test URL: ', $gettext_domain ); ?></label></th>
  12. <td><code><?php echo $url_prefix; ?></code><input id="monkeyman-regex-tester" type="text" class="regular-text code" /><input type="button" id="monkeyman-regex-tester-clear" value="<?php esc_attr_e( 'Clear', $gettext_domain ); ?>" /></td>
  13. </tr>
  14. </tbody>
  15. </table>
  16. </form>
  17. <table class="widefat fixed" cellspacing="0">
  18. <thead>
  19. <tr>
  20. <th><?php _e( 'Pattern', $gettext_domain ); ?></th>
  21. <th><?php _e( 'Substitution', $gettext_domain ); ?></th>
  22. </tr>
  23. </thead>
  24. <tfoot>
  25. <tr>
  26. <th><?php _e( 'Pattern', $gettext_domain ); ?></th>
  27. <th><?php _e( 'Substitution', $gettext_domain ); ?></th>
  28. </tr>
  29. </tfoot>
  30. <tbody>
  31. <?php foreach ( $rewrite_rules_ui as $idx => $rewrite_rule_ui ) : ?>
  32. <tr id="rewrite-rule-<?php echo $idx; ?>" class="rewrite-rule-line">
  33. <?php if ( array_key_exists( 'error', $rewrite_rule_ui ) ) : ?>
  34. <td colspan="2">
  35. <code><?php echo $rewrite_rule_ui['pattern']; ?></code>
  36. <p class="error"><?php printf( __( 'Error parsing regex: %s', $gettext_domain ), $rewrite_rule_ui['error'] ) ?></p>
  37. </td>
  38. <?php else : ?>
  39. <td><code><?php echo $rewrite_rule_ui['print']; ?></code></td>
  40. <td>
  41. <pre><?php foreach ( $rewrite_rule_ui['substitution_parts'] as $substitution_part_ui ) {
  42. if ( $substitution_part_ui['is_public'] ) {
  43. echo '<span class="queryvar-public">';
  44. } else {
  45. echo '<span class="queryvar-unread" title="' . esc_attr( __( 'This query variable is not public and will not be saved', $gettext_domain ) ) . '">';
  46. }
  47. printf( "%' 15s: <span class='queryvalue'>%s</span>\n", $substitution_part_ui['query_var'], $substitution_part_ui['query_value_ui'] );
  48. echo '</span>';
  49. } ?></pre>
  50. </td>
  51. <?php endif; ?>
  52. </tr>
  53. <?php endforeach; ?>
  54. </tbody>
  55. </table>
  56. <?php endif; ?>
  57. <p><?php printf( __( 'Can\'t get your rewrite rules like you want them? Ask for help on <a href="%s">the WordPress Stack Exchange</a>!', $gettext_domain ), 'http://wordpress.stackexchange.com' ); ?></p>
  58. </div>