芝麻web文件管理V1.00
编辑当前文件:/home/paymbalq/public_html/wp-content/plugins/w3-total-cache/Extension_CloudFlare_Page.php
get_string( array( 'cloudflare', 'email' ) ); $key = $c->get_string( array( 'cloudflare', 'key' ) ); $zone_id = $c->get_string( array( 'cloudflare', 'zone_id' ) ); if ( empty( $email ) || empty( $key ) || empty( $zone_id ) ) { $state = 'not_configured'; } else { $settings = array(); try { $settings = Extension_CloudFlare_SettingsForUi::settings_get( $api ); $state = 'available'; } catch ( \Exception $ex ) { $state = 'not_available'; $error_message = $ex->getMessage(); } } $config = $c; include W3TC_DIR . '/Extension_CloudFlare_Page_View.php'; } /** * Renders a checkbox input for the Cloudflare settings. * * @param array $settings The current Cloudflare settings. * @param array $data Metadata for the checkbox input (key, label, description, etc.). * * @return void */ private static function cloudflare_checkbox( $settings, $data ) { if ( ! isset( $settings[ $data['key'] ] ) ) { return; } $value = ( 'on' === $settings[ $data['key'] ]['value'] ); $disabled = ! $settings[ $data['key'] ]['editable']; Util_Ui::table_tr( array( 'id' => $data['key'], 'label' => $data['label'], 'checkbox' => array( 'name' => 'cloudflare_api_' . $data['key'], 'value' => $value, 'disabled' => $disabled, 'label' => 'Enable', ), 'description' => $data['description'], ) ); } /** * Renders a select box input for the Cloudflare settings. * * @param array $settings The current Cloudflare settings. * @param array $data Metadata for the select box input (key, label, values, etc.). * * @return void */ private static function cloudflare_selectbox( $settings, $data ) { if ( ! isset( $settings[ $data['key'] ] ) ) { return; } $value = $settings[ $data['key'] ]['value']; $disabled = ! $settings[ $data['key'] ]['editable']; Util_Ui::table_tr( array( 'id' => $data['key'], 'label' => $data['label'], 'selectbox' => array( 'name' => 'cloudflare_api_' . $data['key'], 'value' => $value, 'disabled' => $disabled, 'values' => $data['values'], ), 'description' => $data['description'], ) ); } /** * Renders a text input box for the Cloudflare settings. * * @param array $settings The current Cloudflare settings. * @param array $data Metadata for the text input box (key, label, description, etc.). * * @return void */ private static function cloudflare_textbox( $settings, $data ) { if ( ! isset( $settings[ $data['key'] ] ) ) { return; } $value = $settings[ $data['key'] ]['value']; $disabled = ! $settings[ $data['key'] ]['editable']; Util_Ui::table_tr( array( 'id' => $data['key'], 'label' => $data['label'], 'textbox' => array( 'name' => 'cloudflare_api_' . $data['key'], 'value' => $value, 'disabled' => $disabled, ), 'description' => $data['description'], ) ); } }