mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 00:37:02 +02:00
Correct issue with InputfieldText placeholder attribute sometimes not working for multi-language (like outside the page editor).
This commit is contained in:
@@ -144,6 +144,15 @@ class InputfieldText extends Inputfield {
|
||||
|
||||
if(isset($attrs['maxlength']) && (int) $attrs['maxlength'] < 1) unset($attrs['maxlength']);
|
||||
|
||||
// placeholder attribute, languages support
|
||||
if(!empty($attrs['placeholder']) && $this->wire('languages')) {
|
||||
$language = $this->wire('user')->language;
|
||||
if($language && $language->id && !$language->isDefault()) {
|
||||
$placeholder = parent::get("placeholder$language->id");
|
||||
if(strlen($placeholder)) $attrs['placeholder'] = $placeholder;
|
||||
}
|
||||
}
|
||||
|
||||
return $attrs;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user