function pte_get_user_options()
{
    $pte_options = get_option(pte_get_option_name());
    if (!is_array($pte_options)) {
        $pte_options = array();
    }
    $defaults = array('pte_tb_width' => 750, 'pte_tb_height' => 550, 'pte_debug' => false, 'pte_thickbox' => true);
    return array_merge($defaults, $pte_options);
}
Пример #2
0
function pte_reset_display()
{
    ?>
	<input class="button-secondary" name="<?php 
    echo pte_get_option_name();
    ?>
[reset]" type="submit" value="<?php 
    esc_attr_e('Reset User Options', PTE_DOMAIN);
    ?>
" />
<?php 
}
Пример #3
0
function pte_update_user_options()
{
    require_once PTE_PLUGINPATH . 'php/options.php';
    $options = pte_get_user_options();
    // Check nonce
    if (!check_ajax_referer("pte-options", 'pte-nonce', false)) {
        return pte_json_error("CSRF Check failed");
    }
    if (isset($_REQUEST['pte_crop_save'])) {
        if (strtolower($_REQUEST['pte_crop_save']) === "true") {
            $options['pte_crop_save'] = true;
        } else {
            $options['pte_crop_save'] = false;
        }
    }
    if (isset($_REQUEST['pte_thumbnail_bar'])) {
        if (strtolower($_REQUEST['pte_thumbnail_bar']) == 'vertical') {
            $options['pte_thumbnail_bar'] = 'vertical';
        } else {
            $options['pte_thumbnail_bar'] = 'horizontal';
        }
    }
    update_option(pte_get_option_name(), $options);
}
Пример #4
0
function pte_update_user_options()
{
    require_once PTE_PLUGINPATH . 'php/options.php';
    $options = pte_get_user_options();
    if (isset($_REQUEST['pte_crop_save'])) {
        if (strtolower($_REQUEST['pte_crop_save']) === "true") {
            $options['pte_crop_save'] = true;
        } else {
            $options['pte_crop_save'] = false;
        }
    }
    if (isset($_REQUEST['pte_thumbnail_bar'])) {
        if (strtolower($_REQUEST['pte_thumbnail_bar']) == 'vertical') {
            $options['pte_thumbnail_bar'] = 'vertical';
        } else {
            $options['pte_thumbnail_bar'] = 'horizontal';
        }
    }
    update_option(pte_get_option_name(), $options);
}
Пример #5
0
function pte_jpeg_compression_display()
{
    $options = pte_get_options();
    $option_label = pte_get_option_name();
    ?>
	<span><input class="small-text" type="text" 
			 name="pte-site-options[pte_jpeg_compression]" 
			 value="<?php 
    print $options['pte_jpeg_compression'];
    ?>
" 
          id="pte_jpeg_compression">&nbsp; 
	<?php 
    _e("Set the compression level for resizing jpeg images (0 to 100).", PTE_DOMAIN);
    ?>
	</span>
	<?php 
}