| 1 |
<?php |
| 2 |
|
| 3 |
// If this file is called directly, abort. |
| 4 |
if ( ! defined( 'WPINC' ) ) { |
| 5 |
die; |
| 6 |
} |
| 7 |
|
| 8 |
|
| 9 |
/** |
| 10 |
* Print HTML Option page : wpLingua Exclusions |
| 11 |
* |
| 12 |
* @return void |
| 13 |
*/ |
| 14 |
function wplng_option_page_exclusions() { |
| 15 |
?> |
| 16 |
|
| 17 |
<h1 class="wplng-option-page-title"><span class="dashicons dashicons-translation"></span> <?php esc_html_e( 'wpLingua - Exclusion rules', 'wplingua' ); ?></h1> |
| 18 |
|
| 19 |
<div class="wrap"> |
| 20 |
<hr class="wp-header-end"> |
| 21 |
<form method="post" action="options.php"> |
| 22 |
<?php |
| 23 |
settings_fields( 'wplng_exclusions' ); |
| 24 |
do_settings_sections( 'wplng_exclusions' ); |
| 25 |
?> |
| 26 |
<table class="form-table wplng-form-table"> |
| 27 |
<tr> |
| 28 |
<th scope="row"><span class="dashicons dashicons-admin-links"></span> <?php esc_html_e( 'Exclude URL', 'wplingua' ); ?></th> |
| 29 |
<td> |
| 30 |
<fieldset> |
| 31 |
<label for="wplng_excluded_url"><strong><?php esc_html_e( 'Exclude URL from translation: ', 'wplingua' ); ?></strong></label> |
| 32 |
|
| 33 |
<hr> |
| 34 |
|
| 35 |
<p><?php esc_html_e( 'You can exclude from translations pages you wish to offer only in the website\'s original language. To do this, list the REGEXs that match the URL to be excluded, one per line. Examples: ', 'wplingua' ); ?></p> |
| 36 |
|
| 37 |
<ul> |
| 38 |
<li><code>^/my-page/$</code> - <?php esc_html_e( 'Exclude URL "/my-page/"', 'wplingua' ); ?></li> |
| 39 |
<li><code>^/my-page/</code> - <?php esc_html_e( 'Exclude URL starting with "/my-page/"', 'wplingua' ); ?></li> |
| 40 |
<li><code>/my-page/$</code> - <?php esc_html_e( 'Exclude URL ending with "/my-page/"', 'wplingua' ); ?></li> |
| 41 |
<li><code>/my-page/</code> - <?php esc_html_e( 'Exclude URL containing "/my-page/"', 'wplingua' ); ?></li> |
| 42 |
</ul> |
| 43 |
<br> |
| 44 |
<textarea name="wplng_excluded_url" id="wplng_excluded_url" rows="6"><?php echo esc_textarea( get_option( 'wplng_excluded_url' ) ); ?></textarea> |
| 45 |
</fieldset> |
| 46 |
</td> |
| 47 |
</tr> |
| 48 |
<tr> |
| 49 |
<th scope="row"><span class="dashicons dashicons-welcome-widgets-menus"></span> <?php esc_html_e( 'Exclude elements', 'wplingua' ); ?></th> |
| 50 |
<td> |
| 51 |
<fieldset> |
| 52 |
<label for="wplng_excluded_selectors"><strong><?php esc_html_e( 'Exclude HTML elements: ', 'wplingua' ); ?></strong></label> |
| 53 |
|
| 54 |
<hr> |
| 55 |
|
| 56 |
<p><?php esc_html_e( 'You can leave some elements of your web pages untranslated. To do this, list below the CSS selectors for the elements to be excluded, one per line. Examples: ', 'wplingua' ); ?></p> |
| 57 |
|
| 58 |
<ul> |
| 59 |
<li><code>#website-main-title</code> - <?php esc_html_e( 'Exclude elements by ID attribute', 'wplingua' ); ?></li> |
| 60 |
<li><code>.author-name</code> - <?php esc_html_e( 'Exclude elements by class attribute', 'wplingua' ); ?></li> |
| 61 |
<li><code>.entry-content pre</code> - <?php esc_html_e( 'Exclude elements by CSS selector', 'wplingua' ); ?></li> |
| 62 |
</ul> |
| 63 |
<br> |
| 64 |
<textarea name="wplng_excluded_selectors" id="wplng_excluded_selectors" rows="6"><?php echo esc_textarea( get_option( 'wplng_excluded_selectors' ) ); ?></textarea> |
| 65 |
</fieldset> |
| 66 |
</td> |
| 67 |
</tr> |
| 68 |
<tr class="wplng-tr-submit"> |
| 69 |
<th scope="row"><span class="dashicons dashicons-yes-alt"></span> <?php esc_html_e( 'Save', 'wplingua' ); ?></th> |
| 70 |
<td> |
| 71 |
<?php submit_button(); ?> |
| 72 |
</td> |
| 73 |
</tr> |
| 74 |
</table> |
| 75 |
</form> |
| 76 |
</div> |
| 77 |
<?php |
| 78 |
} |
| 79 |
|