mirror of
https://github.com/processwire/processwire.git
synced 2025-08-24 15:23:11 +02:00
Various minor/small updates
This commit is contained in:
@@ -176,12 +176,12 @@ class AdminThemeUikitConfigHelper extends Wire {
|
|||||||
|
|
||||||
/** @var InputfieldRadios $f */
|
/** @var InputfieldRadios $f */
|
||||||
$f = $modules->get('InputfieldRadios');
|
$f = $modules->get('InputfieldRadios');
|
||||||
$f->attr('id+name', 'noGrid');
|
$f->attr('id+name', 'ukGrid');
|
||||||
$f->label = $this->_('Inputfield column widths');
|
$f->label = $this->_('Inputfield column widths');
|
||||||
$f->notes = $this->_('Choose option B if you are having any trouble achieving intended Inputfield column widths.');
|
$f->notes = $this->_('Choose option B if you are having any trouble achieving intended Inputfield column widths.');
|
||||||
$f->addOption(0, 'A: ' . $this->_('Uikit uk-width classes (up-to 6 columns)'));
|
$f->addOption(1, 'A: ' . $this->_('Uikit uk-width classes (up-to 6 columns)'));
|
||||||
$f->addOption(1, 'B: ' . $this->_('Percentage-based widths (additional flexibility)'));
|
$f->addOption(0, 'B: ' . $this->_('Percentage-based widths (additional flexibility)'));
|
||||||
$f->attr('value', (int) $adminTheme->get('noGrid'));
|
$f->attr('value', (int) $adminTheme->get('ukGrid'));
|
||||||
$f->columnWidth = 50;
|
$f->columnWidth = 50;
|
||||||
$fieldset->add($f);
|
$fieldset->add($f);
|
||||||
|
|
||||||
|
@@ -156,9 +156,9 @@ InputfieldWrapper::setMarkup($markup);
|
|||||||
|
|
||||||
if(!$config->get('InputfieldWrapper')) $config->set('InputfieldWrapper', array());
|
if(!$config->get('InputfieldWrapper')) $config->set('InputfieldWrapper', array());
|
||||||
|
|
||||||
if($adminTheme->noGrid) {
|
if($adminTheme->ukGrid) {
|
||||||
$config->InputfieldWrapper('useColumnWidth', 2); // 2=use both style='width:%' and data-colwidth attributes
|
|
||||||
} else {
|
|
||||||
$config->InputfieldWrapper('useColumnWidth', false);
|
$config->InputfieldWrapper('useColumnWidth', false);
|
||||||
|
} else {
|
||||||
|
$config->InputfieldWrapper('useColumnWidth', 2); // 2=use both style='width:%' and data-colwidth attributes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -312,6 +312,7 @@ class InputfieldCheckbox extends Inputfield {
|
|||||||
$f->notes = $this->_('If not specified, the field label will be used instead.');
|
$f->notes = $this->_('If not specified, the field label will be used instead.');
|
||||||
$f->attr('value', $this->getSetting('checkboxLabel'));
|
$f->attr('value', $this->getSetting('checkboxLabel'));
|
||||||
$f->icon = 'check-square';
|
$f->icon = 'check-square';
|
||||||
|
$f->collapsed = Inputfield::collapsedBlank;
|
||||||
if($languages) {
|
if($languages) {
|
||||||
$f->useLanguages = true;
|
$f->useLanguages = true;
|
||||||
foreach($languages as $language) {
|
foreach($languages as $language) {
|
||||||
|
@@ -1388,6 +1388,30 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
|
|||||||
public function ___getConfigInputfields() {
|
public function ___getConfigInputfields() {
|
||||||
$inputfields = parent::___getConfigInputfields();
|
$inputfields = parent::___getConfigInputfields();
|
||||||
|
|
||||||
|
if($this->hasFieldtype === false) {
|
||||||
|
/** @var InputfieldText $f */
|
||||||
|
$f = $this->modules->get('InputfieldText');
|
||||||
|
$f->attr('name', 'extensions');
|
||||||
|
$f->label = $this->_('Allowed file extensions for upload');
|
||||||
|
$f->description = $this->_('One or more file extensions separated by a space.');
|
||||||
|
$value = $this->getSetting('extensions');
|
||||||
|
if(empty($value)) $value = 'pdf jpg jpeg png gif doc docx csv xls xlsx ppt pptx';
|
||||||
|
$value = explode(' ', $value);
|
||||||
|
foreach($value as $k => $v) $value[$k] = trim($v, '. ');
|
||||||
|
$f->val(implode(' ', $value));
|
||||||
|
$inputfields->add($f);
|
||||||
|
|
||||||
|
/** @var InputfieldInteger $f */
|
||||||
|
$f = $this->modules->get('InputfieldInteger');
|
||||||
|
$f->attr('name', 'maxFiles');
|
||||||
|
$f->attr('value', (int) $this->getSetting('maxFiles'));
|
||||||
|
$f->attr('size', 4);
|
||||||
|
$f->label = $this->_('Maximum files allowed');
|
||||||
|
$f->description = $this->_('0=No limit');
|
||||||
|
$f->collapsed = Inputfield::collapsedBlank;
|
||||||
|
$inputfields->add($f);
|
||||||
|
}
|
||||||
|
|
||||||
/** @var InputfieldCheckbox $f */
|
/** @var InputfieldCheckbox $f */
|
||||||
$f = $this->modules->get("InputfieldCheckbox");
|
$f = $this->modules->get("InputfieldCheckbox");
|
||||||
$f->attr('name', 'unzip');
|
$f->attr('name', 'unzip');
|
||||||
|
@@ -18,7 +18,7 @@ class InputfieldName extends InputfieldText {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->sanitizeMethod = 'name'; // method from sanitizer to use for value sanitization
|
$this->set('sanitizeMethod', 'name'); // method from sanitizer to use for value sanitization
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ class InputfieldName extends InputfieldText {
|
|||||||
$this->set('required', true);
|
$this->set('required', true);
|
||||||
$this->label = $this->_('Name'); // default field label
|
$this->label = $this->_('Name'); // default field label
|
||||||
$this->description = $this->_('Any combination of letters (a-z), numbers (0-9) and underscores (no spaces).'); // default field description
|
$this->description = $this->_('Any combination of letters (a-z), numbers (0-9) and underscores (no spaces).'); // default field description
|
||||||
$this->sanitizeMethod = 'name'; // method from sanitizer to use for value sanitization
|
$this->set('sanitizeMethod', 'name'); // method from sanitizer to use for value sanitization
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setAttributeValue($value) {
|
protected function setAttributeValue($value) {
|
||||||
|
@@ -326,6 +326,17 @@ class InputfieldPageName extends InputfieldName implements ConfigurableModule {
|
|||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get default replacements setting
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
* @since 3.0.170
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static function getDefaultReplacements() {
|
||||||
|
return self::$defaultReplacements;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function InputfieldPageName_saveModuleConfigData(HookEvent $event) {
|
function InputfieldPageName_saveModuleConfigData(HookEvent $event) {
|
||||||
|
@@ -42,6 +42,7 @@ class PageFrontEditConfig extends ModuleConfig {
|
|||||||
$fieldset->attr('id+name', 'inlineSettings');
|
$fieldset->attr('id+name', 'inlineSettings');
|
||||||
$inputfields->add($fieldset);
|
$inputfields->add($fieldset);
|
||||||
|
|
||||||
|
/** @var InputfieldCheckboxes $f */
|
||||||
$f = $this->wire('modules')->get('InputfieldCheckboxes');
|
$f = $this->wire('modules')->get('InputfieldCheckboxes');
|
||||||
$f->name = 'inlineEditFields';
|
$f->name = 'inlineEditFields';
|
||||||
$f->icon = 'cube';
|
$f->icon = 'cube';
|
||||||
@@ -58,6 +59,7 @@ class PageFrontEditConfig extends ModuleConfig {
|
|||||||
// $f->attr('value', $this->inlineEditFields);
|
// $f->attr('value', $this->inlineEditFields);
|
||||||
$fieldset->add($f);
|
$fieldset->add($f);
|
||||||
|
|
||||||
|
/** @var InputfieldRadios $f */
|
||||||
$f = $this->wire('modules')->get('InputfieldRadios');
|
$f = $this->wire('modules')->get('InputfieldRadios');
|
||||||
$f->name = 'inlineLimitPage';
|
$f->name = 'inlineLimitPage';
|
||||||
$f->label = $this->_('Option A: editor scope');
|
$f->label = $this->_('Option A: editor scope');
|
||||||
@@ -73,6 +75,7 @@ class PageFrontEditConfig extends ModuleConfig {
|
|||||||
$fieldset2->collapsed = Inputfield::collapsedYes;
|
$fieldset2->collapsed = Inputfield::collapsedYes;
|
||||||
$fieldset->add($fieldset2);
|
$fieldset->add($fieldset2);
|
||||||
|
|
||||||
|
/** @var InputfieldRadios $f */
|
||||||
$f = $this->modules->get('InputfieldRadios');
|
$f = $this->modules->get('InputfieldRadios');
|
||||||
$f->name = 'buttonLocation';
|
$f->name = 'buttonLocation';
|
||||||
$f->label = $this->_('Buttons location');
|
$f->label = $this->_('Buttons location');
|
||||||
@@ -101,7 +104,7 @@ class PageFrontEditConfig extends ModuleConfig {
|
|||||||
|
|
||||||
public function fieldHelpInputfields(InputfieldWrapper $fieldset, Field $field) {
|
public function fieldHelpInputfields(InputfieldWrapper $fieldset, Field $field) {
|
||||||
|
|
||||||
$moreLabel = $this->_('More') . " [i.fa.fa-angle-right][/i]";
|
$moreLabel = $this->_('More');
|
||||||
|
|
||||||
$module = $this->wire('modules')->get('PageFrontEdit');
|
$module = $this->wire('modules')->get('PageFrontEdit');
|
||||||
$fieldset->description = $this->editHelpText;
|
$fieldset->description = $this->editHelpText;
|
||||||
|
@@ -3072,6 +3072,17 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Are we processing a submitted page edit form in this request?
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* @since 3.0.170
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function isSubmit() {
|
||||||
|
return $this->isPost;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL to redirect to after non-authenticated user is logged-in, or false if module does not support
|
* URL to redirect to after non-authenticated user is logged-in, or false if module does not support
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user