mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 02:04:35 +02:00
Various minor/small updates
This commit is contained in:
@@ -176,12 +176,12 @@ class AdminThemeUikitConfigHelper extends Wire {
|
||||
|
||||
/** @var InputfieldRadios $f */
|
||||
$f = $modules->get('InputfieldRadios');
|
||||
$f->attr('id+name', 'noGrid');
|
||||
$f->attr('id+name', 'ukGrid');
|
||||
$f->label = $this->_('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, 'B: ' . $this->_('Percentage-based widths (additional flexibility)'));
|
||||
$f->attr('value', (int) $adminTheme->get('noGrid'));
|
||||
$f->addOption(1, 'A: ' . $this->_('Uikit uk-width classes (up-to 6 columns)'));
|
||||
$f->addOption(0, 'B: ' . $this->_('Percentage-based widths (additional flexibility)'));
|
||||
$f->attr('value', (int) $adminTheme->get('ukGrid'));
|
||||
$f->columnWidth = 50;
|
||||
$fieldset->add($f);
|
||||
|
||||
|
@@ -156,9 +156,9 @@ InputfieldWrapper::setMarkup($markup);
|
||||
|
||||
if(!$config->get('InputfieldWrapper')) $config->set('InputfieldWrapper', array());
|
||||
|
||||
if($adminTheme->noGrid) {
|
||||
$config->InputfieldWrapper('useColumnWidth', 2); // 2=use both style='width:%' and data-colwidth attributes
|
||||
} else {
|
||||
if($adminTheme->ukGrid) {
|
||||
$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->attr('value', $this->getSetting('checkboxLabel'));
|
||||
$f->icon = 'check-square';
|
||||
$f->collapsed = Inputfield::collapsedBlank;
|
||||
if($languages) {
|
||||
$f->useLanguages = true;
|
||||
foreach($languages as $language) {
|
||||
|
@@ -1387,6 +1387,30 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
|
||||
*/
|
||||
public function ___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 */
|
||||
$f = $this->modules->get("InputfieldCheckbox");
|
||||
|
@@ -18,7 +18,7 @@ class InputfieldName extends InputfieldText {
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class InputfieldName extends InputfieldText {
|
||||
$this->set('required', true);
|
||||
$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->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) {
|
||||
|
@@ -326,6 +326,17 @@ class InputfieldPageName extends InputfieldName implements ConfigurableModule {
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default replacements setting
|
||||
*
|
||||
* @return array
|
||||
* @since 3.0.170
|
||||
*
|
||||
*/
|
||||
public static function getDefaultReplacements() {
|
||||
return self::$defaultReplacements;
|
||||
}
|
||||
}
|
||||
|
||||
function InputfieldPageName_saveModuleConfigData(HookEvent $event) {
|
||||
|
@@ -42,6 +42,7 @@ class PageFrontEditConfig extends ModuleConfig {
|
||||
$fieldset->attr('id+name', 'inlineSettings');
|
||||
$inputfields->add($fieldset);
|
||||
|
||||
/** @var InputfieldCheckboxes $f */
|
||||
$f = $this->wire('modules')->get('InputfieldCheckboxes');
|
||||
$f->name = 'inlineEditFields';
|
||||
$f->icon = 'cube';
|
||||
@@ -57,7 +58,8 @@ class PageFrontEditConfig extends ModuleConfig {
|
||||
}
|
||||
// $f->attr('value', $this->inlineEditFields);
|
||||
$fieldset->add($f);
|
||||
|
||||
|
||||
/** @var InputfieldRadios $f */
|
||||
$f = $this->wire('modules')->get('InputfieldRadios');
|
||||
$f->name = 'inlineLimitPage';
|
||||
$f->label = $this->_('Option A: editor scope');
|
||||
@@ -73,6 +75,7 @@ class PageFrontEditConfig extends ModuleConfig {
|
||||
$fieldset2->collapsed = Inputfield::collapsedYes;
|
||||
$fieldset->add($fieldset2);
|
||||
|
||||
/** @var InputfieldRadios $f */
|
||||
$f = $this->modules->get('InputfieldRadios');
|
||||
$f->name = 'buttonLocation';
|
||||
$f->label = $this->_('Buttons location');
|
||||
@@ -101,7 +104,7 @@ class PageFrontEditConfig extends ModuleConfig {
|
||||
|
||||
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');
|
||||
$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
|
||||
*
|
||||
|
Reference in New Issue
Block a user