| 1 |
<?php |
| 2 |
/** |
| 3 |
* CryptX option page "General"-Tab |
| 4 |
*/ |
| 5 |
function rw_cryptx_settings_tab_content_general() { |
| 6 |
$CryptX_instance = Cryptx\CryptX::getInstance(); |
| 7 |
$cryptXOptions = $CryptX_instance->loadCryptXOptionsWithDefaults(); |
| 8 |
if ( 'general' != rw_cryptx_getActiveTab() ) |
| 9 |
return; |
| 10 |
?> |
| 11 |
|
| 12 |
<h4><?php _e( "General",'cryptx' ); ?></h4> |
| 13 |
<table> |
| 14 |
<tr> |
| 15 |
<th scope="row"><?php _e("Apply CryptX to...",'cryptx'); ?></th> |
| 16 |
<td> |
| 17 |
<input name="cryptX_var[the_content]" type="checkbox" value="1" <?php checked( $cryptXOptions['the_content'], 1 ); ?> /> <?php _e("Content",'cryptx'); ?> <?php _e("(<i>this can be disabled per Post by an Option</i>)",'cryptx'); ?><br/> |
| 18 |
<input name="cryptX_var[the_meta_key]" type="checkbox" value="1" <?php checked( $cryptXOptions['the_meta_key'], 1 ); ?> /> <?php _e("Custom fields (<strong>works only with the_meta()!</strong>)",'cryptx'); ?><br/> |
| 19 |
<input name="cryptX_var[the_excerpt]" type="checkbox" value="1" <?php checked( $cryptXOptions['the_excerpt'], 1 ); ?> /> <?php _e("Excerpt",'cryptx'); ?><br/> |
| 20 |
<input name="cryptX_var[comment_text]" type="checkbox" value="1" <?php checked( $cryptXOptions['comment_text'], 1 ); ?> /> <?php _e("Comments",'cryptx'); ?><br/> |
| 21 |
<input name="cryptX_var[widget_text]" type="checkbox" value="1" <?php checked( $cryptXOptions['widget_text'], 1 ); ?> /> <?php _e("Widgets",'cryptx'); ?> <?php _e("(<i>works only on all widgets, not on a single widget</i>!)",'cryptx'); ?> |
| 22 |
</td> |
| 23 |
</tr> |
| 24 |
|
| 25 |
<tr class="spacer"> |
| 26 |
<td colspan="3"><hr></td> |
| 27 |
</tr> |
| 28 |
|
| 29 |
<tr> |
| 30 |
<th scope="row"><?php _e("Excluded ID's...",'cryptx'); ?></th> |
| 31 |
<td><input name="cryptX_var[excludedIDs]" value="<?php echo $cryptXOptions['excludedIDs']; ?>" type="text" class="regular-text" /> |
| 32 |
<br/><span class="setting-description"><?php _e("Enter all Page/Post ID's to exclude from CryptX as comma seperated list.",'cryptx'); ?></span> |
| 33 |
<br/><input name="cryptX_var[metaBox]" type="checkbox" value="1" <?php checked( $cryptXOptions['metaBox'], 1 ); ?> /> <?php _e("Enable the CryptX Widget on editing a post or page.",'cryptx'); ?></td> |
| 34 |
</tr> |
| 35 |
|
| 36 |
<tr class="spacer"> |
| 37 |
<td colspan="3"><hr></td> |
| 38 |
</tr> |
| 39 |
|
| 40 |
<tr> |
| 41 |
<th scope="row"><?php _e("Type of decryption",'cryptx'); ?></th> |
| 42 |
<td><input name="cryptX_var[java]" type="radio" value="1" <?php checked( $cryptXOptions['java'], 1 ); ?>/> <?php _e("Use javascript to hide the Email-Link.",'cryptx'); ?><br/> |
| 43 |
<input name="cryptX_var[java]" type="radio" value="0" <?php checked( $cryptXOptions['java'], 0 ); ?>/> <?php _e("Use Unicode to hide the Email-Link.",'cryptx'); ?></td> |
| 44 |
</tr> |
| 45 |
|
| 46 |
<tr class="spacer"> |
| 47 |
<td colspan="3"><hr></td> |
| 48 |
</tr> |
| 49 |
|
| 50 |
<tr> |
| 51 |
<th scope="row"><?php _e("Where to load the needed javascript...",'cryptx'); ?></th> |
| 52 |
<td><input name="cryptX_var[load_java]" type="radio" value="0" <?php checked( $cryptXOptions['load_java'], 0 ); ?>/> <?php _e("Load the javascript in the <b>header</b> of the page.",'cryptx'); ?><br/> |
| 53 |
<input name="cryptX_var[load_java]" type="radio" value="1" <?php checked( $cryptXOptions['load_java'], 1 ); ?>/> <?php _e("Load the javascript in the <b>footer</b> of the page.",'cryptx'); ?></td> |
| 54 |
</tr> |
| 55 |
|
| 56 |
<tr class="spacer"> |
| 57 |
<td colspan="3"><hr></td> |
| 58 |
</tr> |
| 59 |
|
| 60 |
<tr> |
| 61 |
<th scope="row" colspan="2"><input name="cryptX_var[autolink]" type="checkbox" value="1" <?php checked( $cryptXOptions['autolink'], 1 ); ?>/> <?php _e("Add mailto to all unlinked email addresses",'cryptx'); ?></th> |
| 62 |
</tr> |
| 63 |
|
| 64 |
<tr class="spacer"> |
| 65 |
<td colspan="3"><hr></td> |
| 66 |
</tr> |
| 67 |
|
| 68 |
<tr> |
| 69 |
<th scope="row"><?php _e("Whitelist of extensions",'cryptx'); ?></th> |
| 70 |
<td><input name="cryptX_var[whiteList]" value="<?php echo $cryptXOptions['whiteList']; ?>" type="text" class="regular-text" /> |
| 71 |
<br/><span class="setting-description"><?php _e("<strong>This is a workaround for the 'retina issue'.</strong><br/>You can provide a comma seperated list of extensions like 'jpeg,jpg,png,gif' which will be ignored by CryptX.",'cryptx'); ?></span> |
| 72 |
</tr> |
| 73 |
|
| 74 |
<tr class="spacer"> |
| 75 |
<td colspan="3"><hr></td> |
| 76 |
</tr> |
| 77 |
|
| 78 |
<tr> |
| 79 |
<th scope="row" colspan="2" class="warning"><input name="cryptX_var_reset" type="checkbox" value="1"/> <?php _e("Reset CryptX options to defaults. Use it carefully and at your own risk. All changes will be deleted!",'cryptx'); ?></th> |
| 80 |
</tr> |
| 81 |
</table> |
| 82 |
<input type='hidden' name='cryptX_save_general_settings' value='true'> |
| 83 |
<?php submit_button(); ?> |
| 84 |
<?php |
| 85 |
} |
| 86 |
add_action( 'rw_cryptx_settings_content', 'rw_cryptx_settings_tab_content_general' ); |