Browse Source

Remove yesno option from Storage backend

pull/8243/head
Hypolite Petovan 1 year ago
parent
commit
a7a38da62d
3 changed files with 8 additions and 3 deletions
  1. +0
    -1
      doc/AddonStorageBackend.md
  2. +1
    -2
      src/Model/Storage/IStorage.php
  3. +7
    -0
      src/Module/Admin/Site.php

+ 0
- 1
doc/AddonStorageBackend.md View File

@ -73,7 +73,6 @@ Optional. Depends on which 'type' this option is:
- 'select': array `[ value => label ]` of choices
- 'intcheckbox': value of input element
- 'select_raw': prebuild html string of `<option >` tags
- 'yesno': array `[ 'label no', 'label yes']`
Each label should be translatable


+ 1
- 2
src/Model/Storage/IStorage.php View File

@ -63,7 +63,7 @@ interface IStorage
* 'type', // define the field used in form, and the type of data.
* // one of 'checkbox', 'combobox', 'custom', 'datetime',
* // 'input', 'intcheckbox', 'password', 'radio', 'richtext'
* // 'select', 'select_raw', 'textarea', 'yesno'
* // 'select', 'select_raw', 'textarea'
*
* 'label', // Translatable label of the field
* 'value', // Current value
@ -72,7 +72,6 @@ interface IStorage
* // select: array [ value => label ] of choices
* // intcheckbox: value of input element
* // select_raw: prebuild html string of < option > tags
* // yesno: array [ 'label no', 'label yes']
* ]
*
* See https://github.com/friendica/friendica/wiki/Quick-Template-Guide


+ 7
- 0
src/Module/Admin/Site.php View File

@ -556,6 +556,13 @@ class Site extends BaseAdmin
if (!is_null($current_storage_backend) && $current_storage_backend != '') {
foreach ($current_storage_backend->getOptions() as $name => $info) {
$type = $info[0];
// Backward compatibilty with yesno field description
if ($type == 'yesno') {
$type = 'checkbox';
// Remove translated labels Yes No from field info
unset($info[4]);
}
$info[0] = $storage_form_prefix . '_' . $name;
$info['type'] = $type;
$info['field'] = 'field_' . $type . '.tpl';


Loading…
Cancel
Save