xref: /plugin/oauth/RedirectSetting.php (revision 3e5be593f2844bd5cd3f1462bf2800fef9d6a6ac)
1*3e5be593SAndreas Gohr<?php
2*3e5be593SAndreas Gohr
3*3e5be593SAndreas Gohrnamespace dokuwiki\plugin\oauth;
4*3e5be593SAndreas Gohr
5*3e5be593SAndreas Gohruse dokuwiki\plugin\config\core\Setting\Setting;
6*3e5be593SAndreas Gohr
7*3e5be593SAndreas Gohr/**
8*3e5be593SAndreas Gohr * Custom Setting to display the default redirect URL
9*3e5be593SAndreas Gohr */
10*3e5be593SAndreas Gohrclass RedirectSetting  extends Setting {
11*3e5be593SAndreas Gohr
12*3e5be593SAndreas Gohr    /** @inheritdoc  */
13*3e5be593SAndreas Gohr    function update($input) {
14*3e5be593SAndreas Gohr        return true;
15*3e5be593SAndreas Gohr    }
16*3e5be593SAndreas Gohr
17*3e5be593SAndreas Gohr
18*3e5be593SAndreas Gohr    /** @inheritdoc  */
19*3e5be593SAndreas Gohr    public function html(\admin_plugin_config $plugin, $echo = false)
20*3e5be593SAndreas Gohr    {
21*3e5be593SAndreas Gohr        /** @var \helper_plugin_oauth $hlp */
22*3e5be593SAndreas Gohr        $hlp = plugin_load('helper', 'oauth');
23*3e5be593SAndreas Gohr
24*3e5be593SAndreas Gohr        $key   = htmlspecialchars($this->key);
25*3e5be593SAndreas Gohr        $value = '<code>'.$hlp->redirectURI().'</code>';
26*3e5be593SAndreas Gohr
27*3e5be593SAndreas Gohr        $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
28*3e5be593SAndreas Gohr        $input = '<div>'.$value.'</div>';
29*3e5be593SAndreas Gohr        return array($label, $input);
30*3e5be593SAndreas Gohr    }
31*3e5be593SAndreas Gohr
32*3e5be593SAndreas Gohr}
33