PageRenderTime 49ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/advanced-excerpt/template/options.php

https://gitlab.com/edgarze188/sunrise
PHP | 220 lines | 209 code | 11 blank | 0 comment | 27 complexity | 795002960f6d3fa92609b2da9fd014ad MD5 | raw file
  1. <div class="wrap advanced-excerpt">
  2. <h2><?php _e( "Advanced Excerpt Options", 'advanced-excerpt' ); ?></h2>
  3. <?php if ( isset( $_GET['settings-updated'] ) ) : ?>
  4. <div id="message" class="updated fade"><p><?php _e( 'Options saved.', 'advanced-excerpt' ); ?></p></div>
  5. <?php endif; ?>
  6. <div class="advanced-excerpt-container">
  7. <div class="advanced-excerpt-main">
  8. <form method="post" action="" autocomplete="off">
  9. <?php if ( function_exists( 'wp_nonce_field' ) ) wp_nonce_field( 'advanced_excerpt_update_options' ); ?>
  10. <table class="form-table">
  11. <tr valign="top">
  12. <th scope="row">
  13. <label for="length">
  14. <?php _e( "Excerpt Length:", 'advanced-excerpt' ); ?>
  15. </label>
  16. </th>
  17. <td>
  18. <input name="length" type="text" id="length" value="<?php echo $length; ?>" size="2" />
  19. <select name="length_type">
  20. <option value="characters"<?php echo ( 'characters' == $length_type ) ? ' selected="selected"' : ''; ?>><?php _e( "Characters", 'advanced-excerpt' ); ?></option>
  21. <option value="words"<?php echo ( 'words' == $length_type ) ? ' selected="selected"' : ''; ?>><?php _e( "Words", 'advanced-excerpt' ); ?></option>
  22. </select>
  23. </td>
  24. </tr>
  25. <tr valign="top">
  26. <th scope="row">
  27. <label for="ellipsis">
  28. <?php _e( "Ellipsis:", 'advanced-excerpt' ); ?>
  29. </label>
  30. </th>
  31. <td>
  32. <p>
  33. <input name="ellipsis" type="text" id="ellipsis" value="<?php echo $ellipsis; ?>" size="5" />
  34. <?php printf( __( '(use <a href="%s" target="_blank">HTML entities</a>)', 'advanced-excerpt' ), 'http://entitycode.com' ); ?>
  35. </p>
  36. <p class="description"><?php _e( "Will substitute the part of the post that is omitted in the excerpt.", 'advanced-excerpt' ); ?></p>
  37. </td>
  38. </tr>
  39. <tr valign="top">
  40. <th scope="row">
  41. <?php _e( "Finish:", 'advanced-excerpt' ); ?>
  42. </th>
  43. <td>
  44. <p>
  45. <label for="finish-none">
  46. <input type="radio" id="finish-none" name="finish" value="exact"<?php echo ( 'exact' == $finish ) ? ' checked="checked"' : ''; ?> />
  47. <?php _e( "Exact", 'advanced-excerpt' ); ?>
  48. </label><br />
  49. <label for="finish-word">
  50. <input type="radio" id="finish-word" name="finish" value="word"<?php echo ( 'word' == $finish ) ? ' checked="checked"' : ''; ?> />
  51. <?php _e( "Word", 'advanced-excerpt' ); ?>
  52. </label><br />
  53. <label for="finish-sentence">
  54. <input type="radio" id="finish-sentence" name="finish" value="sentence"<?php echo ( 'sentence' == $finish ) ? ' checked="checked"' : ''; ?> />
  55. <?php _e( "Sentence", 'advanced-excerpt' ); ?>
  56. </label>
  57. </p>
  58. <p class="description"><?php _e( "Prevents cutting a word or sentence at the end of an excerpt. This option can result in (slightly) longer excerpts.", 'advanced-excerpt' ); ?></p>
  59. </td>
  60. </tr>
  61. <tr valign="top">
  62. <th scope="row">
  63. <?php _e( "Read More Link:", 'advanced-excerpt' ); ?>
  64. </th>
  65. <td>
  66. <label for="add-link">
  67. <input name="add_link" type="checkbox" id="add-link" value="on" <?php echo ( 1 == $add_link ) ? 'checked="checked"' : ''; ?> />
  68. <?php _e( "Add read more link to excerpt", 'advanced-excerpt' ); ?>
  69. </label><br />
  70. <input name="read_more" type="text" id="read-more" value="<?php echo $read_more; ?>" <?php echo ( 1 !== $add_link ) ? 'disabled="disabled"' : ''; ?> />
  71. </td>
  72. </tr>
  73. <tr valign="top">
  74. <th scope="row">
  75. <label for="no-custom">
  76. <?php _e( "No Custom Excerpts:", 'advanced-excerpt' ); ?>
  77. </label>
  78. </th>
  79. <td>
  80. <label for="no-custom">
  81. <input name="no_custom" type="checkbox" id="no-custom" value="on" <?php echo ( 1 == $no_custom ) ? 'checked="checked"' : ''; ?> />
  82. <?php _e( "Generate excerpts even if a post has a custom excerpt attached.", 'advanced-excerpt' ); ?>
  83. </label>
  84. </td>
  85. </tr>
  86. <tr valign="top">
  87. <th scope="row">
  88. <label for="no-shortcode">
  89. <?php _e( "Strip Shortcodes:", 'advanced-excerpt' ); ?>
  90. </label>
  91. </th>
  92. <td>
  93. <label for="no-shortcode">
  94. <input name="no_shortcode" type="checkbox" id="no-shortcode" value="on" <?php echo ( 1 == $no_shortcode ) ? 'checked="checked"' : ''; ?> />
  95. <?php _e( "Remove shortcodes from the excerpt. <em>(recommended)</em>", 'advanced-excerpt' ); ?>
  96. </label>
  97. </td>
  98. </tr>
  99. <tr valign="top">
  100. <th scope="row">
  101. <?php _e( "Filter:", 'advanced-excerpt' ); ?>
  102. </th>
  103. <td>
  104. <p>
  105. <label for="the-excerpt">
  106. <input name="the_excerpt" type="checkbox" id="the-excerpt" value="on" <?php echo ( 1 == $the_excerpt ) ? 'checked="checked"' : ''; ?> />
  107. <span class='monospaced'>the_excerpt()</span>
  108. </label><br />
  109. <label for="the-content">
  110. <input name="the_content" type="checkbox" id="the-content" value="on" <?php echo ( 1 == $the_content ) ? 'checked="checked"' : ''; ?> />
  111. <span class='monospaced'>the_content()</span>
  112. </label>
  113. </p>
  114. <ul class="sub-options">
  115. <li>
  116. <label id="the-content-no-break-label" for="the-content-no-break" <?php echo ( 1 !== $the_content ) ? 'class="disabled"' : ''; ?>>
  117. <input name="the_content_no_break" type="checkbox" id="the-content-no-break" value="on" <?php echo ( 1 == $the_content_no_break && 1 == $the_content ) ? 'checked="checked"' : ''; ?> <?php echo ( 1 !== $the_content ) ? 'disabled="disabled"' : ''; ?> />
  118. <?php _e( "Only filter <span class='monospaced'>the_content()</span> when there's no break (&lt;!--more--&gt;) tag in the post content", 'advanced-excerpt' ); ?>
  119. </label>
  120. </li>
  121. </ul>
  122. <p class="description">
  123. <?php _e( 'Themes may use <code>the_excerpt()</code> for some pages (e.g. search results) and <code>the_content()</code> on others (e.g. blog archives). Depending on your theme and what pages you want this plugin to affect, you may need to adjust these settings.', 'advanced-excerpt' ); ?>
  124. </p>
  125. </td>
  126. </tr>
  127. <tr valign="top">
  128. <th scope="row">
  129. <?php _e( "Disable On:", 'advanced-excerpt' ); ?>
  130. </th>
  131. <td>
  132. <p>
  133. <?php foreach ( $exclude_pages_list as $key => $label ) :
  134. $key_dashed = str_replace( '_', '-', $key ); ?>
  135. <label for="<?php echo $key_dashed; ?>">
  136. <input name="exclude_pages[]" type="checkbox" id="<?php echo $key_dashed; ?>" value="<?php echo $key; ?>" <?php echo ( in_array( $key, $exclude_pages ) ) ? 'checked="checked"' : ''; ?> />
  137. <?php echo $label; ?>
  138. </label><br />
  139. <?php endforeach; ?>
  140. <p>
  141. <p class="description">
  142. <?php _e( 'Disables excerpt filtering for certain page types.', 'advanced-excerpt' ); ?>
  143. </p>
  144. </td>
  145. </tr>
  146. <tr valign="top">
  147. <th scope="row">
  148. <?php _e( "Strip Tags:", 'advanced-excerpt' ); ?>
  149. </th>
  150. <td>
  151. <table id="tags-table">
  152. <tr>
  153. <td colspan="<?php echo $tag_cols; ?>">
  154. <p>
  155. <label for="dont-remove-any-tags">
  156. <input name="allowed_tags_option" type="radio" id="dont-remove-any-tags" value="dont_remove_any" <?php echo ( 'dont_remove_any' == $allowed_tags_option ) ? 'checked="checked"' : ''; ?> />
  157. <?php _e( "Don't remove any tags", 'advanced-excerpt' ); ?>
  158. </label><br />
  159. <label for="remove-all-tags-except">
  160. <input name="allowed_tags_option" type="radio" id="remove-all-tags-except" value="remove_all_tags_except" <?php echo ( 'remove_all_tags_except' == $allowed_tags_option ) ? 'checked="checked"' : ''; ?> />
  161. <?php _e( "Remove all tags except the following", 'advanced-excerpt' ); ?>
  162. </label>
  163. </p>
  164. </td>
  165. </tr>
  166. <?php
  167. $i = 0;
  168. foreach ( $tag_list as $tag ) :
  169. if ( 0 == $i % $tag_cols ) : ?>
  170. <tr<?php echo ( 'dont_remove_any' == $allowed_tags_option ) ? ' style="display: none;"' : '' ?>>
  171. <?php endif; $i++; ?>
  172. <td>
  173. <label for="<?php echo 'ae-' . $tag; ?>">
  174. <input name="allowed_tags[]" type="checkbox" id="<?php echo 'ae-' . $tag; ?>" value="<?php echo $tag; ?>" <?php echo ( in_array( $tag, $allowed_tags ) ) ? 'checked="checked" ' : ''; ?> />
  175. <code><?php echo $tag; ?></code>
  176. </label>
  177. </td>
  178. <?php
  179. if ( 0 == $i % $tag_cols ):
  180. $i = 0;
  181. echo '</tr>';
  182. endif;
  183. endforeach;
  184. if ( 0 != $i % $tag_cols ): ?>
  185. <td colspan="<?php echo $tag_cols - $i; ?>">&nbsp;</td>
  186. </tr>
  187. <?php endif; ?>
  188. </table>
  189. <div class="tags-control"<?php echo ( 'dont_remove_any' == $allowed_tags_option ) ? ' style="display: none;"' : '' ?>>
  190. <a href="" id="select-all"><?php _e( "Select all", 'advanced-excerpt' ); ?></a> / <a href="" id="select-none"><?php _e( "Select none", 'advanced-excerpt' ); ?></a><br />
  191. <?php _e( "More tags", 'advanced-excerpt' ); ?>
  192. <select name="more_tags" id="more-tags">
  193. <?php foreach ( array_diff( $this->options_all_tags, $this->options_basic_tags ) as $tag ) : ?>
  194. <option value="<?php echo $tag; ?>"><?php echo $tag; ?></option>
  195. <?php endforeach; ?>
  196. </select>
  197. <input type="button" name="add_tag" id="add-tag" class="button" value="<?php _e( "Add tag", 'advanced-excerpt' ); ?>" />
  198. </div>
  199. </td>
  200. </tr>
  201. </table>
  202. <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( "Save Changes", 'advanced-excerpt' ); ?>" /></p>
  203. </form>
  204. </div>
  205. <?php require_once $this->plugin_dir_path . 'template/sidebar.php'; ?>
  206. </div>
  207. </div>