/wp-content/plugins/wordpress-seo/admin/google_search_console/class-gsc-modal.php

https://bitbucket.org/carloskikea/helpet · PHP · 58 lines · 22 code · 8 blank · 28 comment · 0 complexity · d5fa10358d6383488d2de45cc56c513d MD5 · raw file

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