11<div class="wrap">
22 <?php include ( JUSTIMAGEOPTIMIZER_ROOT . '/views/_tabs.php ' ); ?>
3- <?php if ( ! $ model ->saved () ) : ?>
3+ <?php if ( ! $ model ->check_requirements () ) : ?>
4+ <div class="update-nag notice-nag">
5+ <strong>
6+ <?php echo sprintf ( __ ( 'Make %1$s writable using the chmod command through your ftp or server software.
7+ (<em>chmod 775 %1$s</em>) and refresh this page for continued settings plugin. ' ,
8+ \JustImageOptimizer::TEXTDOMAIN ), WP_CONTENT_DIR ); ?>
9+ </strong>
10+ </div>
11+ <?php endif ; ?>
12+ <?php if ( !$ model ->saved () && $ model ->check_requirements () ) : ?>
413 <div class="update-nag">
514 <strong>Please confirm the settings below and Save them.</strong>
615 </div><br>
1524 <form method="post" action="<?php get_permalink (); ?> " enctype="multipart/form-data">
1625 <table class="form-table">
1726 <tr>
18- <th scope="row"><?php _e ( 'Automatically optimize uploads ' , \JustImageOptimizer::TEXTDOMAIN ); ?> </th>
27+ <th scope="row">
28+ <?php _e ( 'Automatically optimize uploads ' , \JustImageOptimizer::TEXTDOMAIN ); ?>
29+ </th>
1930 <td>
2031 <input type="hidden" name="auto_optimize" value="0">
21- <input <?php checked ($ model ->auto_optimize ); ?>
22- type="checkbox"
23- name="auto_optimize"
24- value="1">
32+ <input <?php checked ( $ model ->auto_optimize ); ?>
33+ type="checkbox"
34+ name="auto_optimize"
35+ value="1">
2536 </td>
2637 </tr>
2738 <tr class="image_sizes_set">
28- <th scope="row"><?php _e ( 'Image sizes to optimize ' , \JustImageOptimizer::TEXTDOMAIN ); ?> </th>
39+ <th scope="row">
40+ <?php _e ( 'Image sizes to optimize ' , \JustImageOptimizer::TEXTDOMAIN ); ?>
41+ </th>
2942 <td class="additional_sizes">
3043 <input type="hidden" name="image_sizes_all" value="0">
3144 <label for="check_all_size">
32- <input <?php checked ($ model ->image_sizes_all ); ?>
45+ <input <?php checked ( $ model ->image_sizes_all ); ?>
3346 id="check_all_size" type="checkbox" name="image_sizes_all"
3447 value="1">All
3548 </label>
5871 <th scope="row"><?php _e ( 'Bulk media limit ' , \JustImageOptimizer::TEXTDOMAIN ); ?> </th>
5972 <td>
6073 <input type="text" name="image_limit"
61- value="<?php echo $ model ->image_limit ; ?> ">
74+ value="<?php echo $ model ->image_limit ; ?> ">
6275 <p class="description">How many Media can be optimized at a time</p>
6376 </td>
6477 </tr>
7891 </td>
7992 </tr>
8093 <?php /*
81- // TODO: add support in future releases.
94+ // TODO: add support in future releases.
8295 <tr>
8396 <th scope="row"><?php _e( 'Regenerate image thumbnails before optimize', \JustImageOptimizer::TEXTDOMAIN ); ?></th>
8497 <td>
90103 <p class="description">Can affect server performance if you upload images very often</p>
91104 </td>
92105 </tr>
93- */ ?>
106+ */ ?>
94107 </table>
95- <input
96- type="submit" name="submit-settings" class="button button-primary" value="Save">
108+ <input <?php echo ( $ model -> check_requirements () ? '' : ' disabled ' ); ?>
109+ type="submit" name="submit-settings" class="button button-primary" value="Save">
97110 </form>
98111</div>
99112<style>
100113 .size_checked {
101114 padding-top: 10px;
102115 }
116+
103117 .label-checkbox {
104- width:200px;
118+ width: 200px;
105119 display: inline-block;
106120 }
107121</style>
0 commit comments