| 1 |
<?php |
| 2 |
/** |
| 3 |
* CryptX option page "Presentation"-Tab |
| 4 |
*/ |
| 5 |
function rw_cryptx_settings_tab_content_presentation() { |
| 6 |
global $cryptX_var, $rw_cryptx_active_tab; |
| 7 |
if ( 'presentation' != $rw_cryptx_active_tab ) |
| 8 |
return; |
| 9 |
?> |
| 10 |
|
| 11 |
<h4><?php _e("Define CSS Options",'cryptx'); ?></h4> |
| 12 |
|
| 13 |
<table> |
| 14 |
<tr> |
| 15 |
<th><label for="cryptX_var[css_id]"><?php _e("CSS ID",'cryptx'); ?></label></th> |
| 16 |
<td><input name="cryptX_var[css_id]" value="<?php echo $cryptX_var['css_id']; ?>" type="text" class="regular-text" /><br /><?php _e("Please be careful using this feature! IDs should be unique. You should prefer of using a css class instead.",'cryptx'); ?></td> |
| 17 |
</tr> |
| 18 |
<tr> |
| 19 |
<th><label for="cryptX_var[css_class]"><?php _e("CSS Class",'cryptx'); ?></label></th> |
| 20 |
<td><input name="cryptX_var[css_class]" value="<?php echo $cryptX_var['css_class']; ?>" type="text" class="regular-text" /></td> |
| 21 |
</tr> |
| 22 |
</table> |
| 23 |
|
| 24 |
<h4><?php _e("Define Presentation Options",'cryptx'); ?></h4> |
| 25 |
|
| 26 |
<table> |
| 27 |
<tbody> |
| 28 |
<tr> |
| 29 |
<td><input name="cryptX_var[opt_linktext]" type="radio" id="opt_linktext" value="0" <?php checked( $cryptX_var['opt_linktext'], 0 ); ?> /></td> |
| 30 |
<th scope="row"><label for="cryptX_var[at]"><?php _e("Replacement for '@'",'cryptx'); ?></label></th> |
| 31 |
<td><input name="cryptX_var[at]" value="<?php echo $cryptX_var['at']; ?>" type="text" class="regular-text" /></td> |
| 32 |
</tr> |
| 33 |
<tr> |
| 34 |
<td> </td> |
| 35 |
<th scope="row"><label for="cryptX_var[dot]"><?php _e("Replacement for '.'",'cryptx'); ?></label></th> |
| 36 |
<td><input name="cryptX_var[dot]" value="<?php echo $cryptX_var['dot']; ?>" type="text" class="regular-text" /></td> |
| 37 |
</tr> |
| 38 |
|
| 39 |
<tr class="spacer"> |
| 40 |
<td colspan="3"><hr></td> |
| 41 |
</tr> |
| 42 |
|
| 43 |
<tr> |
| 44 |
<td scope="row"><input type="radio" name="cryptX_var[opt_linktext]" id="opt_linktext2" value="1" <?php checked( $cryptX_var['opt_linktext'], 1 ); ?> /></td> |
| 45 |
<th><label for="cryptX_var[alt_linktext]"><?php _e("Text for link",'cryptx'); ?></label></th> |
| 46 |
<td><input name="cryptX_var[alt_linktext]" value="<?php echo $cryptX_var['alt_linktext']; ?>" type="text" class="regular-text" /></td> |
| 47 |
</tr> |
| 48 |
|
| 49 |
<tr class="spacer"> |
| 50 |
<td colspan="3"><hr></td> |
| 51 |
</tr> |
| 52 |
|
| 53 |
<tr> |
| 54 |
<td scope="row"><input type="radio" name="cryptX_var[opt_linktext]" id="opt_linktext3" value="2" <?php checked( $cryptX_var['opt_linktext'], 2 ); ?> /></td> |
| 55 |
<th><label for="cryptX_var[alt_linkimage]"><?php _e("Image-URL",'cryptx'); ?></label></th> |
| 56 |
<td><input name="cryptX_var[alt_linkimage]" value="<?php echo $cryptX_var['alt_linkimage']; ?>" type="text" class="regular-text" /></td> |
| 57 |
</tr> |
| 58 |
<tr> |
| 59 |
<td scope="row"> </td> |
| 60 |
<th><label for="cryptX_var[http_linkimage_title]"><?php _e("Title-Tag for the Image",'cryptx'); ?></label></th> |
| 61 |
<td><input name="cryptX_var[http_linkimage_title]" value="<?php echo $cryptX_var['http_linkimage_title']; ?>" type="text" class="regular-text" /></td> |
| 62 |
</tr> |
| 63 |
|
| 64 |
<tr class="spacer"> |
| 65 |
<td colspan="3"><hr></td> |
| 66 |
</tr> |
| 67 |
|
| 68 |
<tr> |
| 69 |
<td scope="row"><input type="radio" name="cryptX_var[opt_linktext]" id="opt_linktext4" value="3" <?php checked( $cryptX_var['opt_linktext'], 3 ); ?>/></td> |
| 70 |
<th><label for="upload_image_button"><?php _e("Select an uploaded image",'cryptx'); ?></label></th> |
| 71 |
<td> |
| 72 |
<input id="upload_image_button" type="button" class="button" value="<?php _e( 'Upload image' ); ?>" /> |
| 73 |
<input id="remove_image_button" type="button" class="button button-link-delete hidden" value="<?php _e( 'Delete image' ); ?>" /> |
| 74 |
<span id="opt_linktext4_notice"><?php _e("You have to upload an image first before this option can be activated.",'cryptx'); ?></span> |
| 75 |
<input type='hidden' name='cryptX_var[alt_uploadedimage]' id='image_attachment_id' value='<?php echo $cryptX_var['alt_uploadedimage']; ?>'> |
| 76 |
<div> |
| 77 |
<img id='image-preview' src='<?php echo wp_get_attachment_url( $cryptX_var['alt_uploadedimage'] ); ?>'> |
| 78 |
</div> |
| 79 |
</td> |
| 80 |
</tr> |
| 81 |
<tr> |
| 82 |
<td> </td> |
| 83 |
<th><label for="cryptX_var[alt_linkimage_title]"><?php _e("Title-Tag for the Image",'cryptx'); ?></label></th> |
| 84 |
<td><input name="cryptX_var[alt_linkimage_title]" value="<?php echo $cryptX_var['alt_linkimage_title']; ?>" type="text" class="regular-text" /></td> |
| 85 |
</tr> |
| 86 |
|
| 87 |
<tr class="spacer"> |
| 88 |
<td colspan="3"><hr></td> |
| 89 |
</tr> |
| 90 |
|
| 91 |
<tr> |
| 92 |
<td scope="row"><input type="radio" name="cryptX_var[opt_linktext]" id="opt_linktext4" value="4" <?php checked( $cryptX_var['opt_linktext'], 4 ); ?> /></td> |
| 93 |
<th colspan="2"><?php _e("Text scrambled by AntiSpamBot (<small>Try it and look at your site and check the html source!</small>)",'cryptx'); ?></th> |
| 94 |
</tr> |
| 95 |
|
| 96 |
<tr class="spacer"> |
| 97 |
<td colspan="3"><hr></td> |
| 98 |
</tr> |
| 99 |
|
| 100 |
<tr> |
| 101 |
<td scope="row"><input type="radio" name="cryptX_var[opt_linktext]" id="opt_linktext5" value="5" <?php checked( $cryptX_var['opt_linktext'], 5 ); ?> /></td> |
| 102 |
<th><?php _e("Convert Email to PNG-image",'cryptx'); ?></th> |
| 103 |
<td><?php _e("Example with the saved options: ",'cryptx'); ?> <img src="<?php echo get_bloginfo('url'); ?>/<?php echo md5( get_bloginfo('url') ); ?>/<?php echo antispambot("CryptX@".rw_cryptx_getDomain()); ?>" align="absmiddle" alt="<?php echo antispambot("CryptX@".rw_cryptx_getDomain()); ?>" title="<?php echo antispambot("CryptX@".rw_cryptx_getDomain()); ?>"></td> |
| 104 |
</tr> |
| 105 |
<tr> |
| 106 |
<td> </td> |
| 107 |
<th><label for="cryptX_var[c2i_font]"><?php _e("Font",'cryptx'); ?></label></th> |
| 108 |
<td><select name="cryptX_var[c2i_font]"> |
| 109 |
<?php |
| 110 |
foreach(rw_cryptx_listDir(CRYPTX_DIR_PATH.'fonts', "ttf") as $font) { |
| 111 |
printf('<option value="%1$s" %3$s>%2$s</option>', |
| 112 |
$font, |
| 113 |
str_replace(".ttf", "", $font), |
| 114 |
($cryptX_var['c2i_font'] == $font)? "selected" : "" |
| 115 |
); |
| 116 |
} |
| 117 |
?> |
| 118 |
</select></td> |
| 119 |
</tr> |
| 120 |
<tr> |
| 121 |
<td> </td> |
| 122 |
<th><label for="cryptX_var[c2i_fontSize]"><?php _e("Font size (pixel)",'cryptx'); ?></label></th> |
| 123 |
<td><input name="cryptX_var[c2i_fontSize]" value="<?php echo $cryptX_var['c2i_fontSize']; ?>" type="number" class="regular-text" /></td> |
| 124 |
</tr> |
| 125 |
<tr> |
| 126 |
<td> </td> |
| 127 |
<th><label for="cryptX_var[c2i_fontRGB]"><?php _e("Font color (RGB)",'cryptx'); ?></label></th> |
| 128 |
<td><input name="cryptX_var[c2i_fontRGB]" value="<?php echo $cryptX_var['c2i_fontRGB']; ?>" type="text" class="color-field regular-text" /></td> |
| 129 |
</tr> |
| 130 |
</tbody> |
| 131 |
</table> |
| 132 |
<?php submit_button(); ?> |
| 133 |
<?php |
| 134 |
} |
| 135 |
add_action( 'rw_cryptx_settings_content', 'rw_cryptx_settings_tab_content_presentation' ); |