WordPress.org

Plugin Directory


Ignore:
Timestamp:
12/18/17 11:35:02 (5 weeks ago)
Author:
hideokamoto
Message:

update v0.5.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • amimoto-dashboard/trunk/module/view/c3-cloudfront-clear-cache.php

    r1508672 r1788721  
    6262    public function get_content_html() { 
    6363        $html = ''; 
    64         $html .= $this->_get_cf_invalidation_form(); 
    65         $html .= $this->_get_cf_setting_form(); 
    66         if ( $this->is_activated_ncc() ) { 
    67             $html .= '<hr/>'; 
    68             $html .= $this->_get_ncc_update_form(); 
     64        if ( $this->is_amimoto_managed() ) { 
     65            $html .= $this->_get_amimoto_managed_cache_control_form(); 
     66        } else { 
     67            $html .= $this->_get_cf_invalidation_form(); 
     68            $html .= $this->_get_cf_setting_form(); 
     69            if ( $this->is_activated_ncc() ) { 
     70                $html .= '<hr/>'; 
     71                $html .= $this->_get_ncc_update_form(); 
     72            } 
    6973        } 
    7074        return apply_filters( 'amimoto_c3_add_settings', $html ); 
     
    133137    } 
    134138 
     139    /** 
     140     * Get CloudFront Distribution Id Form 
     141     * 
     142     * @params string $dist_id CloudFront Distribution Id 
     143     * @return string HTML tag to show Distribution ID input form 
     144     * @access private 
     145     * @since 0.5.0 
     146     */ 
     147    private function __get_cf_dist_input( $dist_id ) { 
     148        $disabled = false; 
     149        if ( $this->is_amimoto_managed() && defined( 'AMIMOTO_CDN_ID' ) ) { 
     150            $disabled = true; 
     151            $dist_id = AMIMOTO_CDN_ID; 
     152        } 
     153        $html = ''; 
     154        $html .= '<tr><th>'. __( 'CloudFront Distribution ID', self::$text_domain ). '</th>'; 
     155        $html .= "<td><input type='text' class='regular-text code' name='c3_settings[distribution_id]' value='{$dist_id}' disabled='{$disabled}' /></td>"; 
     156        $html .= '</tr>'; 
     157        return $html; 
     158    } 
     159 
    135160 
    136161    /** 
     
    155180        } 
    156181        $c3_settings = apply_filters( 'c3_settings', $c3_settings ); 
    157         if ( ( ! isset( $c3_settings['access_key'] ) || ! $c3_settings['access_key'] ) && ( ! isset( $c3_settings['secret_key'] ) || ! $c3_settings['secret_key'] ) ) { 
     182        if ( ! isset( $c3_settings['access_key'] ) && ! isset( $c3_settings['secret_key'] ) ) { 
    158183            $has_ec2_instance_role = true; 
    159184        } 
     
    165190        $html .= '</thead>'; 
    166191        $html .= '<tbody>'; 
    167         $html .= '<tr><th>'. __( 'CloudFront Distribution ID', self::$text_domain ). '</th>'; 
    168         $html .= "<td><input type='text' class='regular-text code' name='c3_settings[distribution_id]' value='{$c3_settings['distribution_id']}' /></td>"; 
    169         $html .= '</tr>'; 
     192        $html .= $this->__get_cf_dist_input($c3_settings['distribution_id']); 
    170193        if ( ! $has_ec2_instance_role ) { 
    171194            $html .= '<tr><th>'. __( 'AWS Access Key', self::$text_domain ). '</th>'; 
Note: See TracChangeset for help on using the changeset viewer.