13e5be593SAndreas Gohr<?php 23e5be593SAndreas Gohr 33e5be593SAndreas Gohrnamespace dokuwiki\plugin\oauth; 43e5be593SAndreas Gohr 53e5be593SAndreas Gohruse dokuwiki\plugin\config\core\Setting\Setting; 63e5be593SAndreas Gohr 73e5be593SAndreas Gohr/** 83e5be593SAndreas Gohr * Custom Setting to display the default redirect URL 93e5be593SAndreas Gohr */ 10*290e9b1fSAndreas Gohrclass RedirectSetting extends Setting 11*290e9b1fSAndreas Gohr{ 123e5be593SAndreas Gohr /** @inheritdoc */ 13*290e9b1fSAndreas Gohr public function update($input) 14*290e9b1fSAndreas Gohr { 153e5be593SAndreas Gohr return true; 163e5be593SAndreas Gohr } 173e5be593SAndreas Gohr 183e5be593SAndreas Gohr 193e5be593SAndreas Gohr /** @inheritdoc */ 203e5be593SAndreas Gohr public function html(\admin_plugin_config $plugin, $echo = false) 213e5be593SAndreas Gohr { 223e5be593SAndreas Gohr /** @var \helper_plugin_oauth $hlp */ 233e5be593SAndreas Gohr $hlp = plugin_load('helper', 'oauth'); 243e5be593SAndreas Gohr 253e5be593SAndreas Gohr $key = htmlspecialchars($this->key); 263e5be593SAndreas Gohr $value = '<code>' . $hlp->redirectURI() . '</code>'; 273e5be593SAndreas Gohr 283e5be593SAndreas Gohr $label = '<label for="config___' . $key . '">' . $this->prompt($plugin) . '</label>'; 293e5be593SAndreas Gohr $input = '<div>' . $value . '</div>'; 30*290e9b1fSAndreas Gohr return [$label, $input]; 313e5be593SAndreas Gohr } 323e5be593SAndreas Gohr} 33