public function testToken() { // If we don't have a token, try to get it again $activated = !empty(WiziappConfig::getInstance()->app_token); if (!$activated) { $cms = new WiziappCms(); $activated = $cms->activate(); } if (!$activated) { $errors = new WiziappError(); if (!$this->testedConnection) { $connTest = $this->testConnection(); if (WiziappError::isError($connTest)) { $errors = $connTest; } } if (!$this->hadConnectionError) { // If we already had connections errors, we are showing the problems from those errors // Else... $this->critical = TRUE; $errors->add('missing_token', __('Oops! It seems that the main server is not responding. Please make sure that your internet connection is working, and try again.', 'wiziapp')); } return $errors; } return TRUE; }
private function getStatusRow($check_name, $display_name, $extra_class = '') { $desc = ''; $passed = TRUE; $testMethod = 'test' . $check_name; $test = $this->checker->{$testMethod}(); if (WiziappError::isError($test)) { $passed = FALSE; $desc .= $test->getHTML(); } $statusClass = $passed ? 'success' : 'failed'; $rowButtons = $passed ? '' : '<a href="" class="details">Details</a><span class="sep"> | </span><a href="" class="retry">Retry</a>'; $html = "<tr class=\"{$extra_class}\">\n <td class=\"v_first-col\">{$display_name}</td>\n <td class=\"status_col\">\n <div class=\"{$statusClass}\"></div>\n </td>\n <td>{$rowButtons}</td>\n </tr>"; if (!empty($desc)) { $html .= '<tr class="details ' . $extra_class . '"><td colspan="3">' . $desc . '</td></tr>'; } return $html; }