HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpemobiq/wp-content/plugins/zendesk/classes/zendesk-wordpress-notices.php
<?php

/**
 * The Notices Class
 *
 * This is a helper class to display notices.
 *
 */

class Zendesk_Wordpress_Notices {
  protected static $instance = null;

  /*
   * get an instance of this class
   */
  public static function get_instance() {
    if ( is_null( self::$instance ) ) {
      self::$instance = new self();
    }

    return self::$instance;
  }

  /*
   * Add Notice
   *
   * An internal function to add a notice to a specific context, where
   * contexts are "places" that display notice messages, such as
   * 'login_form' or 'tickets_widget'. The $text is the text to display
   * and the $type is either 'note', 'confirm', or 'alert' which
   * differs in colors when output.
   *
   */
  public function _add_notice( $context, $text, $type = 'note' ) {
    if ( isset( $this->notices[ $context . '_' . $type ] ) ) {
      $this->notices[ $context . '_' . $type ][] = $text;
    } else {
      $this->notices[ $context . '_' . $type ] = array( $text );
    }
  }

  /*
   * Do Notices
   *
   * Process all the added notices for a specific context and output
   * them on screen using the _notice function. Loops through notes,
   * confirms and alerts for the given context.
   *
   */
  public function _do_notices( $context ) {
    echo '<div class="zendesk-notices-group">';
    foreach ( array( 'note', 'confirm', 'alert' ) as $type ) {
      if ( isset( $this->notices[ $context . '_' . $type ] ) ) {
        $notices = $this->notices[ $context . '_' . $type ];

        foreach ( $notices as $notice ) {
          $this->_notice( $notice, $type );
        }
      }
    }
    echo '</div>';
  }

  /*
   * Notice
   *
   * Prints the notice to screen given a certain $type, which can be
   * 'note', 'alert' and 'confirm' according to the stylesheets.
   *
   */
  private function _notice( $text, $type = 'note' ) {
    ?>
    <div class="zendesk-admin-notice zendesk-<?php echo $type; ?>">
      <p><?php echo $text; ?></p>
    </div>
  <?php
  }

}