WPSEO_GSC_Modal

Represents the Google Search Console modal.

Defined (1)

The class is defined in the following location(s).

/admin/google_search_console/class-gsc-modal.php  
  1. class WPSEO_GSC_Modal { 
  2.  
  3. /** @var string */ 
  4. protected $view; 
  5.  
  6. /** @var int */ 
  7. protected $height; 
  8.  
  9. /** @var array */ 
  10. protected $view_vars; 
  11.  
  12. /** 
  13. * Sets the required attributes for this object. 
  14. * @param string $view The file with the view content. 
  15. * @param int $height The height that the modal will get. 
  16. * @param array $view_vars The attributes to use in the view. 
  17. */ 
  18. public function __construct( $view, $height, array $view_vars = array() ) { 
  19. $this->view = $view; 
  20. $this->height = $height; 
  21. $this->view_vars = $view_vars; 
  22.  
  23. /** 
  24. * Returns the height of the modal. 
  25. * @return int The set height. 
  26. */ 
  27. public function get_height() { 
  28. return $this->height; 
  29.  
  30. /** 
  31. * Loads the view of the modal. 
  32. * @param string $unique_id An unique identifier for the modal. 
  33. */ 
  34. public function load_view( $unique_id ) { 
  35. extract( $this->view_vars ); 
  36.  
  37. echo '<div id="redirect-' . $unique_id . '" class="hidden">'; 
  38. echo '<div class="form-wrap wpseo_content_wrapper">'; 
  39. require( $this->view ); 
  40. echo '</div>'; 
  41. echo '</div>';