WordPress.org

Plugin Directory

Changeset 698500


Ignore:
Timestamp:
04/16/13 12:17:08 (12 months ago)
Author:
donncha
Message:

Check if Jetpack is installed before showing helper form

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-super-cache/trunk/plugins/jetpack.php

    r698491 r698500  
    2222    $id = 'jetpack-section'; 
    2323    ?> 
    24         <fieldset id="<?php echo $id; ?>" class="options">  
    25         <h4><?php _e( 'Jetpack Mobile Theme', 'wp-super-cache' ); ?></h4> 
     24    <fieldset id="<?php echo $id; ?>" class="options">  
     25    <h4><?php _e( 'Jetpack Mobile Theme', 'wp-super-cache' ); ?></h4> 
     26    <?php 
     27    if ( false == file_exists( dirname( WPCACHEHOME ) . '/jetpack/class.jetpack-user-agent.php' ) ) { 
     28        echo "<strong>" . sprintf( __( "Jetpack not found in %s. Install it and enable the mobile theme and this helper plugin to cache visits by mobile visitors." ), dirname( WPCACHEHOME ) ) . "</strong>>"; 
     29    } else { ?> 
    2630        <form name="wp_manager" action="" method="post"> 
    2731        <label><input type="radio" name="cache_jetpack" value="1" <?php if( $cache_jetpack ) { echo 'checked="checked" '; } ?>/> <?php _e( 'Enabled', 'wp-super-cache' ); ?></label> 
     
    3640            echo "<p><strong>" . sprintf( __( "Jetpack Mobile Theme support is now %s", 'wp-super-cache' ), $status ) . "</strong></p>"; 
    3741        } 
    38     echo '<div class="submit"><input ' . SUBMITDISABLED . 'type="submit" value="' . __( 'Update', 'wp-super-cache' ) . '" /></div>'; 
    39     wp_nonce_field('wp-cache'); 
    40     ?> 
    41     </form> 
     42        echo '<div class="submit"><input ' . SUBMITDISABLED . 'type="submit" value="' . __( 'Update', 'wp-super-cache' ) . '" /></div>'; 
     43        wp_nonce_field('wp-cache'); 
     44        ?> 
     45        </form> 
     46    <?php } ?> 
    4247    </fieldset> 
    4348    <?php 
Note: See TracChangeset for help on using the changeset viewer.