<?php
// =============================================================================
// File: settings.php
// Version: 1.0
//
// Renders synchi settings.
// =============================================================================
// check access
if(!defined('SYNCHI')) exit('Direct access is not allowed...');
?>
<script type="text/javascript">
$(function(){
$("#synchi_theme").change(function(){
$("#synchi_theme_preview").attr('src','<?php echo WP_PLUGIN_URL; ?>/synchi/theme-previews/' + $(this).val() + '.png');
});
$("#synchi_theme").change();
});
</script>
<div class="wrap">
<h2>Synchi Theming</h2>
<form method="post" action="<?php echo WP_ADMIN_URL; ?>/index.php">
<table class='form-table'>
<tr valign='top'>
<th scope='row'>Line Numbers</th>
<td>
<select name="synchi_option_lineNumbers">
<option value="0" <?php if($synchi_settings['lineNumbers'] == 0) echo 'selected="selected"'; ?>>no</option>
<option value="1" <?php if($synchi_settings['lineNumbers'] == 1) echo 'selected="selected"'; ?>>yes</option>
</select>
</td>
</tr>
<tr valign='top'>
<th scope='row'>Line Wrapping</th>
<td>
<select name="synchi_option_lineWrapping">
<option value="0" <?php if($synchi_settings['lineWrapping'] == 0) echo 'selected="selected"'; ?>>no</option>
<option value="1" <?php if($synchi_settings['lineWrapping'] == 1) echo 'selected="selected"'; ?>>yes</option>
</select>
</td>
</tr>
<tr valign='top'>
<th scope='row'>Match Brackets</th>
<td>
<select name="synchi_option_matchBrackets">
<option value="0" <?php if($synchi_settings['matchBrackets'] == 0) echo 'selected="selected"'; ?>>no</option>
<option value="1" <?php if($synchi_settings['matchBrackets'] == 1) echo 'selected="selected"'; ?>>yes</option>
</select>
</td>
</tr>
<tr valign='top'>
<th scope='row'>Font size (px)</th>
<td>
<select name="synchi_option_fontSize">
<?php for($i=10; $i<=16; $i++) { ?>
<option value="<?php echo $i; ?>" <?php if($synchi_settings['fontSize'] == $i) echo 'selected="selected"'; ?>><?php echo $i; ?> px</option>
<?php } ?>
</select>
</td>
</tr>
<tr valign='top'>
<th scope='row'>Theme</th>
<td>
<select id="synchi_theme" name="synchi_option_theme">
<?php foreach($synchi_themes as $theme_option) { ?>
<option
value="<?php echo $theme_option; ?>"
<?php if($theme_option == $theme) echo 'selected="selected"'; ?>>
<?php echo $theme_option; ?>
</option>
<?php } ?>
</select>
</td>
</tr>
<tr>
<th scope='row'></th>
<td>
theme preview:<br />
<img id="synchi_theme_preview" src="" style="width: 590px; height: 300px; border: 1px solid black;" />
</td>
</tr>
</table>
<?php submit_button(); ?>
<input type="hidden" name="synchi_action" value="update_settings" />
</form>
</div>