| | |
| | | [ |
| | | 'name' => 'Clear Credentials', |
| | | 'icon' => 'broom', |
| | | 'action' => [$this, 'clearCredentials'] |
| | | 'action' => [$this, 'deleteCredentials'] |
| | | ], |
| | | ]; |
| | | foreach ($actions as $a) { |
| | |
| | | return $result; |
| | | } |
| | | |
| | | public function response(bool $success, string $message):array |
| | | { |
| | | return [ |
| | | 'success' => $success, |
| | | 'message' => $message |
| | | ]; |
| | | } |
| | | |
| | | public function renderConnection():string |
| | | public function renderConnection(bool $return = false):string |
| | | { |
| | | if ($this->userID && !JVB()->userCanConnect($this->service_name, $this->userID)) { |
| | | return ''; |
| | |
| | | $form .= $this->renderOAuthConnectionForm(); |
| | | } |
| | | |
| | | if (!empty($this->optionalFields) || $this->hasExtraOptions) { |
| | | if (!empty($this->optionalFields) || $this->hasExtraOptions()) { |
| | | $form .= '<div class="integration-content">'; |
| | | if (!empty($this->optionalFields)) { |
| | | $form .= sprintf( |
| | |
| | | $this->outputFields($this->optionalFields) |
| | | ); |
| | | } |
| | | if ($this->hasExtraOptions) { |
| | | if ($this->hasExtraOptions()) { |
| | | $form .= sprintf( |
| | | '<a href="%s" class="btn">More Settings</a>', |
| | | $this->determineOptionPage() |
| | |
| | | $form .= $this->outputActionButtons(); |
| | | $form .= '</form>'; |
| | | |
| | | if (!$return) { |
| | | echo $form; |
| | | } |
| | | |
| | | return $form; |
| | | } |
| | | protected function outputActionButtons():string |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | } |