private function mainForm() { $str = ""; $str .= "<form action=\"{$this->here}\" method=\"post\" name=\"main_form\">"; $str .= '<input type="hidden" name="main_form"/>'; if ($this->isConnected()) { $str .= "<hr>"; $str .= 'Split multiday rides?: <input type="checkbox" value="split" ' . ($this->preferences->getSplitRides() ? "checked" : "") . ' name="split_rides"/>'; $str .= '<br>Save elevation as feet (MyCyclingLog only): <input type="checkbox" name="elevation_units" value="feet" ' . ($this->preferences->getMclUseFeet() ? "checked" : "") . "/>"; $str .= "<hr>\n"; $str .= $this->dateButtons($this->preferences->getTimezone()); } $str .= "<table class=\"w3-table-all\">"; if ($this->isConnected()) { $str .= $this->datePicker($this->preferences->getTimezone()); } if ($this->isConnected()) { $colSpan = ' colspan="3"'; } else { $colSpan = ''; } if ($this->strava->isConnected()) { $str .= '<tr><td' . $colSpan . '><input type="submit" name="calculate_from_strava" value="Eddington Number from Strava"/>'; $str .= '</td></tr>'; $str .= "\n"; } if ($this->myCyclingLog->isConnected()) { $str .= '<tr><td' . $colSpan . '><input type="submit" name="calculate_from_mcl" value="Eddington Number from MyCyclingLog"/></td></tr>'; $str .= "\n"; } if ($this->endomondo->isConnected()) { $str .= '<tr><td' . $colSpan . '><input type="submit" name="calculate_from_endo" value="Eddington Number from Endomondo"/></td></tr>'; $str .= "\n"; } if ($this->rideWithGps->isConnected()) { $str .= '<tr><td' . $colSpan . '><input type="submit" name="calculate_from_rwgps" value="Eddington Number from RideWithGPS"/></td></tr>'; $str .= "\n"; } if ($this->strava->isConnected() && $this->myCyclingLog->isConnected()) { $str .= '<tr><td' . $colSpan . '><input type="submit" name="copy_strava_to_mcl" value="Copy ride data from Strava to MyCyclingLog"/>'; $str .= "</td></tr>"; } if ($this->strava->isConnected() && $this->endomondo->isConnected() && $this->strava->writeScope()) { $str .= "\n<tr><td" . $colSpan . '><input type="submit" name="copy_endo_to_strava" value="Copy rides and routes from Endomondo to Strava"/> <br>'; $str .= "</td></tr>"; $str .= "\n<tr><td" . $colSpan . '><input type="submit" name="queue_delete_endo_from_strava" value="Delete Strava rides copied from Endomondo"/> <br>'; $str .= "</td></tr>"; } if ($this->rideWithGps->isConnected() && $this->endomondo->isConnected()) { $str .= "\n<tr><td" . $colSpan . '><input type="submit" name="copy_endo_to_rwgps" value="Copy rides and routes from Endomondo to RideWithGPS"/> <br>'; $str .= "</td></tr>"; } if ($this->myCyclingLog->isConnected()) { $str .= "\n<tr><td" . $colSpan . '>' . $this->mclDeleteButton($this->preferences->getMclUsername()); $str .= "</td></tr>"; $str .= "\n"; } $str .= " <tr>\n <td {$colSpan}><input type=\"submit\" name=\"clear_cookies\" value=\"Delete Cookies\"/></td>\n </tr>\n <tr>\n <td {$colSpan}><input type=\"submit\" name=\"delete_files\" value=\"Delete temporary files\"/>\n </td>\n </tr>\n </table>"; // $str .= $this->copyForm(); $str .= "<hr>"; if (!$this->connectedToAll()) { $str .= '<p>More options are available if you connect to <a href="#services">other services</a>.</p>'; } $str .= "</form>"; return $str; }