| Total Complexity | 5 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 3 | class admin_plugin_swarmwebhook extends DokuWiki_Admin_Plugin |
||
| 4 | { |
||
| 5 | |||
| 6 | public function forAdminOnly() |
||
| 9 | } |
||
| 10 | |||
| 11 | public function handle() |
||
| 13 | } |
||
| 14 | |||
| 15 | |||
| 16 | public function html() |
||
| 17 | { |
||
| 18 | echo '<h1>Instructions to create the swarm webhook with IFTTT</h1>'; |
||
| 19 | $secret = $this->getConf('hook_secret'); |
||
| 20 | if (empty($secret)) { |
||
| 21 | $exampleSecret = md5(time()); |
||
| 22 | $settingsID = 'plugin____swarmwebhook____plugin_settings_name'; |
||
| 23 | $configHRef = DOKU_REL . DOKU_SCRIPT . '?do=admin&page=config#' . $settingsID; |
||
| 24 | $configLink = '<a href="' . $configHRef . '">' . $this->getLang('configuration') . '</a>'; |
||
| 25 | $secretNeededMsg = sprintf( |
||
| 26 | $this->getLang('secret needed'), |
||
| 27 | $configLink, |
||
| 28 | '<code>' . $exampleSecret . '</code>' |
||
| 29 | ); |
||
| 30 | echo '<p>' . $secretNeededMsg . '</p>'; |
||
| 31 | return; |
||
| 32 | } |
||
| 33 | |||
| 34 | echo $this->iftttInstructionsHTML(); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get the instructions for IFTTT |
||
| 39 | * |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | protected function iftttInstructionsHTML() |
||
| 52 | } |
||
| 53 | } |
||
| 54 |