1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 07:47:00 +02:00
This commit is contained in:
Ryan Cramer
2016-12-20 06:27:26 -05:00
parent 381293e0c7
commit 0844bf2e47
3 changed files with 16 additions and 10 deletions

View File

@@ -1253,7 +1253,7 @@ abstract class Inputfield extends WireData implements Module {
$field = $this->modules->get('InputfieldInteger');
$value = (int) $this->getSetting('columnWidth');
if($value < 10 || $value >= 100) $value = 100;
$field->label = sprintf($this->_("Column Width (%d%%)"), $value);
$field->label = sprintf($this->_('Column width (%d%%)'), $value);
$field->icon = 'arrows-h';
$field->attr('id+name', 'columnWidth');
$field->attr('type', 'text');

View File

@@ -1082,6 +1082,7 @@ class InputfieldPage extends Inputfield implements ConfigurableModule {
}
$field->label = $this->_('Custom PHP code');
$field->icon = 'code';
$field->showIf = 'inputfield!=InputfieldPageAutocomplete|InputfieldPageListSelect|InputfieldPageListSelectMultiple';
$fieldset->append($field);
$inputfields->append($fieldset);

View File

@@ -450,7 +450,7 @@ class InputfieldSelect extends Inputfield {
*
* @param string $key
* @param mixed $value
* @return $this
* @return Inputfield|InputfieldSelect
*
*/
public function set($key, $value) {
@@ -469,7 +469,7 @@ class InputfieldSelect extends Inputfield {
*
* @param array|string $key
* @param array|int|string $value
* @return $this
* @return Inputfield|InputfieldSelect
*
*/
public function setAttribute($key, $value) {
@@ -528,14 +528,19 @@ class InputfieldSelect extends Inputfield {
$inputfields = parent::___getConfigInputfields();
$f = $this->wire('modules')->get('InputfieldTextarea');
if($this instanceof InputfieldHasArrayValue) {
$f = $this->wire('modules')->get('InputfieldTextarea');
$f->description = $this->_('To have pre-selected default value(s), enter the option values (one per line) below.');
} else {
$f = $this->wire('modules')->get('InputfieldText');
$f->description = $this->_('To have a pre-selected default value, enter the option value below.');
}
$f->attr('name', 'defaultValue');
$f->attr('value', $this->defaultValue);
$f->label = $this->_('Default Value');
$f->description = $this->_('To have pre-selected default value(s), enter the option values (one per line) below. For page selections, this would be the page ID number(s).');
$f->notes = $this->_('This default value(s) option is available because you checked the "required" box above.');
$f->showIf = 'required>0';
$f->collapsed = Inputfield::collapsedBlank;
$f->label = $this->_('Default value');
$f->attr('value', $this->defaultValue);
$f->description .= ' ' . $this->_('For default page selection, the value would be the page ID number.');
$f->notes = $this->_('IMPORTANT: The default value is not used unless the field is required (see the required” checkbox on this screen).');
$f->collapsed = $this->hasFieldtype === false ? Inputfield::collapsedBlank : Inputfield::collapsedNo;
$inputfields->add($f);