Exemplo n.º 1
0
function arras_admin()
{
    global $arras_options, $arras_image_sizes, $notices;
    if (isset($_GET['page']) && $_GET['page'] == 'arras-options') {
        //print_r($_POST);
        if (isset($_REQUEST['save'])) {
            arras_admin_save();
        }
        if (isset($_REQUEST['reset'])) {
            arras_admin_reset();
        }
        if (isset($_REQUEST['arras-regen-thumbs']) && is_plugin_active('regenerate-thumbnails/regenerate-thumbnails.php')) {
            check_admin_referer('arras-admin');
            ?>
			<script type="text/javascript">
				window.location = '<?php 
            echo admin_url('tools.php?page=regenerate-thumbnails');
            ?>
';
			</script>
			<?php 
        } else {
            if (!is_plugin_active('regenerate-thumbnails/regenerate-thumbnails.php')) {
                $notices = '<div class="error fade"><p>' . __('<strong>Notice:</strong> Having <a href="http://wordpress.org/extend/plugins/regenerate-thumbnails/">Regenerate Thumbnails</a> plugin installed and activated is highly recommended for Arras.', 'arras') . '</p></div>';
            }
            $arras_image_sizes = array();
            arras_add_default_thumbnails();
            include 'templates/options_page.php';
        }
    }
}
Exemplo n.º 2
0
function arras_admin()
{
    global $arras_options, $arras_image_sizes, $notices;
    if (isset($_GET['page']) && $_GET['page'] == 'arras-options') {
        //print_r($_POST);
        if (isset($_REQUEST['save'])) {
            arras_admin_save();
        }
        if (isset($_REQUEST['reset'])) {
            arras_admin_reset();
        }
        if (isset($_REQUEST['clearcache'])) {
            check_admin_referer('arras-admin');
            $cache_location = get_template_directory() . '/library/cache';
            if (!($dh = @opendir($cache_location))) {
                return false;
            }
            while (false !== ($obj = readdir($dh))) {
                if ($obj == '.' || $obj == '..') {
                    continue;
                }
                @unlink(trailingslashit($cache_location) . $obj);
            }
            closedir($dh);
            $notices = '<div class="updated fade"><p>' . __('Thumbnail cache has been cleared.', 'arras') . '</p></div>';
        }
        if (isset($_REQUEST['arras-regen-thumbs'])) {
            check_admin_referer('arras-admin');
            echo '<div class="wrap clearfix">';
            screen_icon('themes');
            ?>
 <h2 id="arras-header"><?php 
            _e('Arras Theme Options', 'arras');
            ?>
</h2> <?php 
            arras_regen_thumbs_process();
            echo '</div>';
        } else {
            $arras_image_sizes = array();
            arras_add_default_thumbnails();
            include 'templates/options_page.php';
        }
    }
}