mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 00:06:55 +02:00
Fix issue processwire/processwire-issues#199 add clarification notes to InputfieldFile "Inputfield Type" option, and prevent selection of "Image" type when in a FieldtypeFile
This commit is contained in:
@@ -680,13 +680,15 @@ class FieldtypeFile extends FieldtypeMulti {
|
|||||||
$f->attr('name', 'inputfieldClass');
|
$f->attr('name', 'inputfieldClass');
|
||||||
$f->label = $this->_('Inputfield Type');
|
$f->label = $this->_('Inputfield Type');
|
||||||
$f->description = $this->_('The type of field that will be used to collect input.');
|
$f->description = $this->_('The type of field that will be used to collect input.');
|
||||||
|
$f->notes = $this->_('Change this only if instructed to do so by 3rd party Inputfield module instructions.');
|
||||||
$f->required = true;
|
$f->required = true;
|
||||||
$baseClass = $this->defaultInputfieldClass;
|
$baseClass = $this->defaultInputfieldClass;
|
||||||
|
|
||||||
foreach($this->wire('modules') as $fm) {
|
foreach($this->wire('modules')->findByPrefix('Inputfield') as $fm) {
|
||||||
if(strpos($fm->className(), 'Inputfield') !== 0) continue;
|
if($baseClass == 'InputfieldFile' && strpos($fm, 'InputfieldImage') === 0) continue;
|
||||||
if("$fm" == $baseClass || is_subclass_of($fm->className(true), __NAMESPACE__ . "\\$baseClass"))
|
if("$fm" == $baseClass || is_subclass_of(__NAMESPACE__ . "\\$fm", __NAMESPACE__ . "\\$baseClass")) {
|
||||||
$f->addOption("$fm", str_replace("Inputfield", '', "$fm"));
|
$f->addOption("$fm", str_replace("Inputfield", '', "$fm"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$inputfieldClass = $field->get('inputfieldClass');
|
$inputfieldClass = $field->get('inputfieldClass');
|
||||||
|
Reference in New Issue
Block a user