* @package Amimoto-dashboard * @since 0.0.1 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } /** * Define AMMIMOTO Dashboard plugin's common comnponents * * @class Amimoto_Dash_Component * @since 0.0.1 */ class Amimoto_Dash_Component extends Amimoto_Dash_Base { private static $instance; private static $text_domain; private function __construct() { self::$text_domain = Amimoto_Dash_Base::text_domain(); } /** * Get Instance Class * * @return Amimoto_Dash_Component * @since 0.0.1 * @access public */ public static function get_instance() { if ( ! isset( self::$instance ) ) { $c = __CLASS__; self::$instance = new $c(); } return self::$instance; } /** * Show AMIMOTO Dashboard Plugin admin page html * * @access public * @param none * @since 0.0.1 */ public function show_panel_html() { $content = $this->get_content_html(); $html = $this->get_layout_html( $content ); echo $html; } /** * Create AMIMOTO Dashboard Plugin's admin page header * * @access private * @param none * @return string(HTML) * @since 0.0.1 */ private function _get_header() { $html = '
'; $html .= '

' . __( 'AMIMOTO Plugin Dashboard', self::$text_domain ) . '

'; $html .= '
'; $html .= '
'; return $html; } /** * Create AMIMOTO Dashboard Plugin's admin page html * * @access public * @param none * @return string(HTML) * @since 0.0.1 */ public function get_layout_html( $content ) { $html = "
"; $html .= $this->_get_header(); $html .= "
"; $html .= $content; $html .= '
'; $html .= $this->_get_subcontent_html(); return $html; } /** * Create AMIMOTO Dashboard's side content html * * @access private * @param none * @return string(HTML) * @since 0.0.1 */ private function _get_subcontent_html() { $html = "
"; $html .= $this->_get_amimoto_logo(); $html .= $this->_get_support_search_form(); $html .= '
'; return $html; } /** * Create AMIMOTO LOGO Widget html * * @access private * @param none * @return string(HTML) * @since 0.0.1 */ private function _get_amimoto_logo() { $html = ''; $logo_url = path_join( AMI_DASH_URL, 'assets/amimoto.png' ); $html .= "
"; $html .= "

". __( 'High Performance WordPress Cloud', self::$text_domain ). '

'; $html .= "
"; $html .= "Amimoto"; $html .= '
'; $html .= '
'; return $html; } /** * Search AMIMOTO FAQ (Intercom) * * @access private * @return string * @since 0.5.0 **/ private function _get_support_search_form() { $html = ''; $html .= "
"; $html .= "

". __( 'Search AMIMOTO FAQ', self::$text_domain ). '

'; $html .= "
"; $html .= "
"; $html .= '

'; $html .= ''; $html .= ''; $html .= ''; $html .= '

'; $html .= "
"; $html .= '
'; $html .= '
'; return $html; } /** * Get AMIMOTO Managed cache control HTML * * @access protected * @param none * @return string HTML tag to show cache control form * @since 0.5.0 */ protected function _get_amimoto_managed_cache_control_form() { $html = ''; if ( ! $this->is_amimoto_managed() ) { return $html; } $html .= ""; $html .= ''; $html .= "'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '

" . __( 'AMIMOTO Cache Control', self::$text_domain ). '

'. __( 'Flush All CDN Cache', self::$text_domain ). ''; $html .= '

'; $html .= "
"; $html .= ""; $html .= wp_nonce_field( self::CLOUDFRONT_INVALIDATION , self::CLOUDFRONT_INVALIDATION , true , false ); $html .= get_submit_button( __( 'Flush All CDN Cache', self::$text_domain ) ); $html .= '
'; $html .= '
'. __( 'Reset Nginx Cache Setting', self::$text_domain ). ''; $html .= '

' . __( 'All Nginx Cache Expires change 30sec.', self::$text_domain ) . '

'; $html .= "
"; $html .= ""; $html .= wp_nonce_field( self::CLOUDFRONT_UPDATE_NCC , self::CLOUDFRONT_UPDATE_NCC , true , false ); $html .= get_submit_button( __( 'Reset Nginx Cache Setting', self::$text_domain ) ); $html .= '
'; $html .= '
'; return $html; } }