Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F727083
D381.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 6, 6:29 AM
Size
2 KB
Mime Type
text/x-diff
Expires
Tue, Jan 7, 6:29 AM (3 d, 4 h ago)
Engine
blob
Format
Raw Data
Handle
537147
Attached To
D381: INP-1783 - Add "checkboxes" control type for configuration settings
D381.diff
View Options
Index: core/admin_templates/incs/config_blocks.tpl
===================================================================
--- core/admin_templates/incs/config_blocks.tpl
+++ core/admin_templates/incs/config_blocks.tpl
@@ -53,6 +53,17 @@
<inp2:PredefinedOptions field="$field" block="config_radio_item" selected="checked"/>
</inp2:m_DefineElement>
+<inp2:m_DefineElement name="config_checkbox_item">
+ <input type="checkbox" <inp2:m_param name='checked'/> id="<inp2:InputName field='$field'/>_<inp2:m_param name='key'/>" value="<inp2:m_param name='key'/>" onclick="update_checkbox_options(/^<inp2:InputName field='$field' as_preg='1'/>_([0-9A-Za-z-_]+)/, '<inp2:InputName field='$field'/>');"/>
+ <label for="<inp2:InputName field='$field'/>_<inp2:m_param name='key'/>"><inp2:m_param name="option"/></label>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_checkboxes">
+ <inp2:PredefinedOptions field="$field" block="config_checkbox_item" selected="checked"/>
+
+ <inp2:m_RenderElement prefix="$PrefixSpecial" name="inp_edit_hidden" field="$field" db="db"/>
+</inp2:m_DefineElement>
+
<inp2:m_DefineElement name="cf_default_value">
<inp2:ConfigFormElement PrefixSpecial="$PrefixSpecial" field="VariableValue" blocks_prefix="config_edit_" element_type_field="ElementType" value_list_field="ValueList"/>
</inp2:m_DefineElement>
Index: core/kernel/db/db_tag_processor.php
===================================================================
--- core/kernel/db/db_tag_processor.php
+++ core/kernel/db/db_tag_processor.php
@@ -2157,6 +2157,7 @@
case 'select':
case 'multiselect':
case 'radio':
+ case 'checkboxes':
if ($object->GetDBField('DirectOptions')) {
// used for custom fields
$options = $object->GetDBField('DirectOptions');
Index: core/units/configuration/configuration_config.php
===================================================================
--- core/units/configuration/configuration_config.php
+++ core/units/configuration/configuration_config.php
@@ -101,7 +101,7 @@
),
'ElementType' => Array (
'type' => 'string',
- 'formatter' => 'kOptionsFormatter', 'options' => Array ('text' => 'la_type_text', 'select' => 'la_type_select', 'multiselect' => 'la_type_multiselect', 'radio' => 'la_type_radio', 'checkbox' => 'la_type_checkbox', 'password' => 'la_type_password', 'textarea' => 'la_type_textarea'), 'use_phrases' => 1,
+ 'formatter' => 'kOptionsFormatter', 'options' => Array ('text' => 'la_type_text', 'select' => 'la_type_select', 'multiselect' => 'la_type_multiselect', 'radio' => 'la_type_radio', 'checkbox' => 'la_type_SingleCheckbox', 'checkboxes' => 'la_type_checkbox', 'password' => 'la_type_password', 'textarea' => 'la_type_textarea'), 'use_phrases' => 1,
'not_null' => 1, 'required' => 1, 'default' => ''
),
'Validation' => Array ('type' => 'string', 'default' => NULL),
@@ -123,4 +123,4 @@
'VirtualFields' => Array (
'DirectOptions' => Array ('type' => 'string', 'default' => ''),
),
-);
\ No newline at end of file
+);
Event Timeline
Log In to Comment