SettingImConvert.php 605 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace dokuwiki\plugin\config\core\Setting;
  3. /**
  4. * Class setting_im_convert
  5. */
  6. class SettingImConvert extends SettingString {
  7. /** @inheritdoc */
  8. public function update($input) {
  9. if($this->isProtected()) return false;
  10. $input = trim($input);
  11. $value = is_null($this->local) ? $this->default : $this->local;
  12. if($value == $input) return false;
  13. if($input && !file_exists($input)) {
  14. $this->error = true;
  15. $this->input = $input;
  16. return false;
  17. }
  18. $this->local = $input;
  19. return true;
  20. }
  21. }