Plugin Directory

Changeset 360756


Ignore:
Timestamp:
03/16/2011 02:26:54 PM (15 years ago)
Author:
rukbat
Message:

Upgrade to version 1.3

Location:
nginx-manager/trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nginx-manager/trunk/admin/admin.php

    r326618 r360756  
    6060                    }
    6161                   
     62                    $nginxm->global_options['log_level']            = $_POST['log_level'];
     63                   
    6264                    if ( (!is_numeric($_POST['log_filesize'])) || (empty($_POST['log_filesize'])) ) {
    6365                        $error_log_filesize = "Log file size must be a number";
     
    7274                    $nginxm->options['automatically_purge_purls']                   = (isset($_POST['automatically_purge_purls']) and ($_POST['automatically_purge_purls'] == 1) ) ? 1 : 0;
    7375                   
     76                    // When a post is published
    7477                    $nginxm->options['automatically_purge_page']                    = (isset($_POST['automatically_purge_page']) and ($_POST['automatically_purge_page'] == 1) ) ? 1 : 0;
    7578                    $nginxm->options['automatically_purge_page_archive']            = (isset($_POST['automatically_purge_page_archive']) and ($_POST['automatically_purge_page_archive'] == 1) ) ? 1 : 0;
    7679                    $nginxm->options['automatically_purge_page_custom_taxa']        = (isset($_POST['automatically_purge_page_custom_taxa']) and ($_POST['automatically_purge_page_custom_taxa'] == 1) ) ? 1 : 0;
    7780                   
     81                    // When a comment is published
    7882                    $nginxm->options['automatically_purge_comment_page']            = (isset($_POST['automatically_purge_comment_page']) and ($_POST['automatically_purge_comment_page'] == 1) ) ? 1 : 0;
    7983                    $nginxm->options['automatically_purge_comment_archive']         = (isset($_POST['automatically_purge_comment_archive']) and ($_POST['automatically_purge_comment_archive'] == 1) ) ? 1 : 0;
    8084                    $nginxm->options['automatically_purge_comment_custom_taxa']     = (isset($_POST['automatically_purge_comment_custom_taxa']) and ($_POST['automatically_purge_comment_custom_taxa'] == 1) ) ? 1 : 0;
    8185                   
    82                     $nginxm->global_options['log_level']                            = $_POST['log_level'];
    83                    
     86                    // When a post is moved to the Trash
     87                    $nginxm->options['automatically_purge_all_on_delete']           = (isset($_POST['automatically_purge_all_on_delete']) and ($_POST['automatically_purge_all_on_delete'] == 1) ) ? 1 : 0;
     88                    $nginxm->options['automatically_purge_archives_on_delete']      = (isset($_POST['automatically_purge_archives_on_delete']) and ($_POST['automatically_purge_archives_on_delete'] == 1) ) ? 1 : 0;
     89                    $nginxm->options['automatically_purge_customtaxa_on_delete']    = (isset($_POST['automatically_purge_customtaxa_on_delete']) and ($_POST['automatically_purge_customtaxa_on_delete'] == 1) ) ? 1 : 0;
     90                   
     91                    // Update site and blog options
    8492                    update_site_option( "nginxm_global_options", $nginxm->global_options );
    8593                    update_option( "nginxm_options", $nginxm->options );
     
    149157                            <td>
    150158                                <select name="log_level">
    151                                     <option value="NONE"<?php if($nginxm->global_options['log_level'] == 'NONE') { echo " selected='selected'"; } ?>><?php _e('None', 'nginxm'); ?></option>
    152                                     <option value="INFO"<?php if($nginxm->global_options['log_level'] == 'INFO') { echo " selected='selected'"; } ?>><?php _e('Info', 'nginxm'); ?></option>
    153                                     <option value="WARNING"<?php if($nginxm->global_options['log_level'] == 'WARNING') { echo " selected='selected'"; } ?>><?php _e('Warning', 'nginxm'); ?></option>
    154                                     <option value="ERROR"<?php if($nginxm->global_options['log_level'] == 'ERROR') { echo " selected='selected'"; } ?>><?php _e('Error', 'nginxm'); ?></option>
     159                                    <option value="NONE"<?php selected( $nginxm->global_options['log_level'],'NONE' ); ?>><?php _e('None', 'nginxm'); ?></option>
     160                                    <option value="INFO"<?php selected( $nginxm->global_options['log_level'],'INFO' ); ?>><?php _e('Info', 'nginxm'); ?></option>
     161                                    <option value="WARNING"<?php selected( $nginxm->global_options['log_level'],'WARNING' ); ?>><?php _e('Warning', 'nginxm'); ?></option>
     162                                    <option value="ERROR"<?php selected( $nginxm->global_options['log_level'],'ERROR' ); ?>><?php _e('Error', 'nginxm'); ?></option>
    155163                                </select>
    156164                            </td>
     
    171179                </table>
    172180               
     181                <br />
     182               
    173183                <h3>Blog options</h3>
    174184               
     
    182192                            <fieldset>
    183193                                <legend class="screen-reader-text"><span>When a post/page is modified</span></legend>
    184                                 <label for="automatically_purge_homepage"><input type="checkbox" value="1" id="automatically_purge_homepage" name="automatically_purge_homepage"<?php if ($nginxm->options['automatically_purge_homepage'] == 1) { echo " checked='checked'"; }?>>Always purge the homepage</label><br />
     194                                <label for="automatically_purge_homepage"><input type="checkbox" value="1" id="automatically_purge_homepage" name="automatically_purge_homepage"<?php checked( $nginxm->options['automatically_purge_homepage'], 1 ); ?>>Always purge the homepage</label><br />
    185195                            </fieldset>
    186196                        </td>
     
    192202                            <fieldset>
    193203                                <legend class="screen-reader-text"><span>When a post/page is modified</span></legend>
    194                                 <label for="automatically_purge_purls"><input type="checkbox" value="1" id="automatically_purge_purls" name="automatically_purge_purls"<?php if ($nginxm->options['automatically_purge_purls'] == 1) { echo " checked='checked'"; }?>>Always purge the personal URLs</label><br />
     204                                <label for="automatically_purge_purls"><input type="checkbox" value="1" id="automatically_purge_purls" name="automatically_purge_purls"<?php checked( $nginxm->options['automatically_purge_purls'], 1 ); ?>>Always purge the personal URLs</label><br />
    195205                            </fieldset>
    196206                        </td>
     
    202212                            <fieldset>
    203213                                <legend class="screen-reader-text"><span>When a post/page is modified</span></legend>
    204                                 <label for="automatically_purge_page"><input type="checkbox" value="1" id="automatically_purge_page" name="automatically_purge_page"<?php if ($nginxm->options['automatically_purge_page'] == 1) { echo " checked='checked'"; }?>>Purge cache for the page/post</label><br />
    205                                 <label for="automatically_purge_page_archive"><input type="checkbox" value="1" id="automatically_purge_page_archive" name="automatically_purge_page_archive"<?php if ($nginxm->options['automatically_purge_page_archive'] == 1) { echo " checked='checked'"; }?>>Purge cache for the archive (author, category, date)</label><br />
    206                                 <label for="automatically_purge_page_custom_taxa"><input type="checkbox" value="1" id="automatically_purge_page_custom_taxa" name="automatically_purge_page_custom_taxa"<?php if ($nginxm->options['automatically_purge_page_custom_taxa'] == 1) { echo " checked='checked'"; }?>>Purge cache for the related custom taxonomies</label><br />
     214                                <label for="automatically_purge_page"><input type="checkbox" value="1" id="automatically_purge_page" name="automatically_purge_page"<?php checked( $nginxm->options['automatically_purge_page'], 1 ); ?>>Purge cache for the page/post</label><br />
     215                                <label for="automatically_purge_page_archive"><input type="checkbox" value="1" id="automatically_purge_page_archive" name="automatically_purge_page_archive"<?php checked( $nginxm->options['automatically_purge_page_archive'], 1 ); ?>>Purge cache for the archive (date, category, tag, author)</label><br />
     216                                <label for="automatically_purge_page_custom_taxa"><input type="checkbox" value="1" id="automatically_purge_page_custom_taxa" name="automatically_purge_page_custom_taxa"<?php checked( $nginxm->options['automatically_purge_page_custom_taxa'], 1); ?>>Purge cache for the related custom taxonomies</label><br />
    207217                            </fieldset>
    208218                        </td>
     
    214224                            <fieldset>
    215225                                <legend class="screen-reader-text"><span>When a new comment is published</span></legend>
    216                                 <label for="automatically_purge_comment_page"><input type="checkbox" value="1" id="automatically_purge_comment_page" name="automatically_purge_comment_page"<?php if ($nginxm->options['automatically_purge_comment_page'] == 1) { echo " checked='checked'"; }?>>Purge cache for the related page/post</label><br />
    217                                 <label for="automatically_purge_comment_archive"><input type="checkbox" value="1" id="automatically_purge_comment_archive" name="automatically_purge_comment_archive"<?php if ($nginxm->options['automatically_purge_comment_archive'] == 1) { echo " checked='checked'"; }?>>Purge cache for archive related to the page (author, category, date)</label><br />
    218                                 <label for="automatically_purge_comment_custom_taxa"><input type="checkbox" value="1" id="automatically_purge_comment_custom_taxa" name="automatically_purge_comment_custom_taxa"<?php if ($nginxm->options['automatically_purge_comment_custom_taxa'] == 1) { echo " checked='checked'"; }?>>Purge cache for the related custom taxonomies</label><br />
     226                                <label for="automatically_purge_comment_page"><input type="checkbox" value="1" id="automatically_purge_comment_page" name="automatically_purge_comment_page"<?php checked( $nginxm->options['automatically_purge_comment_page'], 1); ?>>Purge cache for the related page/post</label><br />
     227                                <label for="automatically_purge_comment_archive"><input type="checkbox" value="1" id="automatically_purge_comment_archive" name="automatically_purge_comment_archive"<?php checked( $nginxm->options['automatically_purge_comment_archive'], 1 ); ?>>Purge cache for archive related to the page (date, category, tag, author)</label><br />
     228                                <label for="automatically_purge_comment_custom_taxa"><input type="checkbox" value="1" id="automatically_purge_comment_custom_taxa" name="automatically_purge_comment_custom_taxa"<?php checked( $nginxm->options['automatically_purge_comment_custom_taxa'], 1 ); ?>>Purge cache for the related custom taxonomies</label><br />
     229                            </fieldset>
     230                        </td>
     231                    </tr>
     232                   
     233                    <tr valign="top">
     234                        <th scope="row"><?php _e( "When a post is moved to the Trash:", "nginxm" ); ?></th>
     235                        <td>
     236                            <fieldset>
     237                                <legend class="screen-reader-text"><span><?php _e( "When a post is moved to the Trash:", "nginxm" ); ?></span></legend>
     238                                <label for="automatically_purge_all_on_delete">
     239                                    <input onclick="if(jQuery('#automatically_purge_all_on_delete').is(':checked')){jQuery('#automatically_purge_archives_on_delete').attr('disabled','disabled');jQuery('#automatically_purge_customtaxa_on_delete').attr('disabled','disabled');}else{jQuery('#automatically_purge_archives_on_delete').removeAttr('disabled');jQuery('#automatically_purge_customtaxa_on_delete').removeAttr('disabled');}" type="checkbox" value="1" id="automatically_purge_all_on_delete" name="automatically_purge_all_on_delete"<?php checked( $nginxm->options['automatically_purge_all_on_delete'], 1 ); ?>><?php _e( "Purge all the blog", "nginxm" ); ?>
     240                                </label><br />
     241                                <label for="automatically_purge_archives_on_delete">
     242                                    <input type="checkbox" value="1" id="automatically_purge_archives_on_delete" name="automatically_purge_archives_on_delete"<?php checked( $nginxm->options['automatically_purge_archives_on_delete'], 1 ); ?><?php disabled( $nginxm->options['automatically_purge_all_on_delete'] ); ?>>Purge cache for the archive (date, category, tag, author)
     243                                </label><br />
     244                                <label for="automatically_purge_customtaxa_on_delete">
     245                                    <input type="checkbox" value="1" id="automatically_purge_customtaxa_on_delete" name="automatically_purge_customtaxa_on_delete"<?php checked( $nginxm->options['automatically_purge_customtaxa_on_delete'], 1); ?><?php disabled( $nginxm->options['automatically_purge_all_on_delete'] ); ?>>Purge cache for the related custom taxonomies
     246                                </label><br />
    219247                            </fieldset>
    220248                        </td>
  • nginx-manager/trunk/admin/upgrade.php

    r326626 r360756  
    9292            $nginxmNginx->log("UPGRADE :: Update to version 1.2 ... DONE");
    9393            echo "<p><i>Update to version 1.2 ... DONE</i></p>";
     94           
     95        }
     96       
     97        /*
     98         * v1.2 -> v1.3
     99         * 1) Set options for post moved to the trash
     100         * */
     101        if (version_compare($current_db_version, '1.3', '<')) {
     102           
     103            echo "<h4>Updating up to 1.3</h4>";
     104       
     105            echo "<p><i>Setting local option for purge when a post is moved to the trash</i></p>";
     106            if (is_multisite()) {
     107               
     108                $blogs = get_blogs_of_user(true);
     109               
     110                foreach ($blogs as $b) {
     111                   
     112                    $nginxm_blog_options = get_blog_option($b->userblog_id, 'nginxm_options');
     113                   
     114                    // Set
     115                    $nginxm_blog_options['automatically_purge_all_on_delete']        = 0;
     116                    $nginxm_blog_options['automatically_purge_archives_on_delete']   = 1;
     117                    $nginxm_blog_options['automatically_purge_customtaxa_on_delete'] = 1;
     118                   
     119                    update_blog_option($b->userblog_id, "nginxm_options", $nginxm_blog_options);
     120                   
     121                    $nginxmNginx->log("UPGRADE :: Update up to version 1.3, blog (id ".$b->userblog_id.") ... DONE");
     122                    echo "<p>UPGRADE :: Update up to version 1.3, blog (id ".$b->userblog_id.") ... DONE</p>";
     123                }
     124               
     125            } else {
     126               
     127                $nginxm_options = get_option('nginxm_options');
     128               
     129                // Set
     130                $nginxm_options['automatically_purge_all_on_delete']        = 0;
     131                $nginxm_options['automatically_purge_archives_on_delete']   = 1;
     132                $nginxm_options['automatically_purge_customtaxa_on_delete'] = 1;
     133               
     134                update_option('nginxm_options', $nginxm_options);
     135               
     136                $nginxmNginx->log("UPGRADE :: Update up to version 1.3 ... DONE");
     137                echo "<p>UPGRADE :: Update up to version 1.3 ... DONE</p>";
     138               
     139            }
     140           
     141            $nginxmNginx->log("UPGRADE :: Update to version 1.3 ... DONE");
     142            echo "<p><i>Update to version 1.3 ... DONE</i></p>";
    94143           
    95144        }
Note: See TracChangeset for help on using the changeset viewer.