Exemplo n.º 1
0
 /**
  * @since 1.0.0
  */
 protected function log_alert()
 {
     $dismiss_time = absint(get_user_meta(get_current_user_id(), self::DISMISS_ERRORS_META_KEY, true));
     $since = max($dismiss_time, Prompt_Logging::get_last_submission_time());
     $log = Prompt_Logging::get_log($since, ARRAY_A);
     if (empty($log)) {
         return '';
     }
     $rows = array();
     foreach ($log as $entry) {
         $rows[] = html('tr', html('td', date('Y-m-d H:i:s e', $entry['time'])), html('td', $entry['message']), html('td', html('textarea', json_encode($entry['data']))));
     }
     if (empty($rows)) {
         return '';
     }
     return html('div class="error"', html('form', array('method' => 'post', 'action' => ''), html('p', __('<strong>Attention:</strong> There have been some recent errors in your configuration. An error log can be found here: ')), html('table class="wp-list-table widefat"', implode('', $rows)), html('input', array('type' => 'hidden', 'name' => 'error_alert', 'value' => '1')), get_submit_button(__('Dismiss', 'Postmatic'), 'primary large', 'dismiss_errors'), get_submit_button(__('Submit A Bug Report', 'Postmatic'), 'left', 'submit_errors')));
 }