Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Fieldtypes/CheckBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ protected function render_additional_settings() {
}

public static function register() {
$types = array(
'ccbox' => array(__('CC: option for user', 'cforms2'), true),
'checkbox' => array(__('Check Box', 'cforms2'), false)
);
foreach ($types as $id => $label) {
$t = new CheckBox($id, $label[0], $label[1]);
$t->register_at_filter();
}

add_action('init', function() {
$types = array(
'ccbox' => array(__('CC: option for user', 'cforms2'), true),
'checkbox' => array(__('Check Box', 'cforms2'), false)
);
foreach ($types as $id => $label) {
$t = new CheckBox($id, $label[0], $label[1]);
$t->register_at_filter();
}
});
}

}
19 changes: 10 additions & 9 deletions Fieldtypes/CheckBoxGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ protected function render_additional_settings() {
}

public static function register() {
$types = array(
'checkboxgroup' => __('Check Box Group', 'cforms2'),
'radiobuttons' => __('Radio Buttons', 'cforms2')
);
foreach ($types as $id => $label) {
$t = new CheckBoxGroup($id, $label);
$t->register_at_filter();
}

add_action('init', function() {
$types = array(
'checkboxgroup' => __('Check Box Group', 'cforms2'),
'radiobuttons' => __('Radio Buttons', 'cforms2')
);
foreach ($types as $id => $label) {
$t = new CheckBoxGroup($id, $label);
$t->register_at_filter();
}
});
}

}
39 changes: 20 additions & 19 deletions Fieldtypes/Html5.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,26 @@ protected function render_additional_settings() {
}

public static function register() {
$types = array(
'html5color' => 'HTML5 ' . __('Color Field', 'cforms2'),
'html5date' => 'HTML5 ' . __('Date Field', 'cforms2'),
'html5datetime-local' => 'HTML5 ' . __('Date/Time (local) Field', 'cforms2'),
'html5email' => 'HTML5 ' . __('Email Field', 'cforms2'),
'html5month' => 'HTML5 ' . __('Month Field', 'cforms2'),
'html5number' => 'HTML5 ' . __('Number Field', 'cforms2'),
'html5range' => 'HTML5 ' . __('Range Field', 'cforms2'),
'html5search' => 'HTML5 ' . __('Search Field', 'cforms2'),
'html5time' => 'HTML5 ' . __('Time Field', 'cforms2'),
'html5url' => 'HTML5 ' . __('URL Field', 'cforms2'),
'html5week' => 'HTML5 ' . __('Week Field', 'cforms2'),
'html5tel' => 'HTML5 ' . __('Telephone Number Field', 'cforms2')
);
foreach ($types as $id => $label) {
$t = new Html5($id, $label);
$t->register_at_filter();
}

add_action('init', function() {
$types = array(
'html5color' => 'HTML5 ' . __('Color Field', 'cforms2'),
'html5date' => 'HTML5 ' . __('Date Field', 'cforms2'),
'html5datetime-local' => 'HTML5 ' . __('Date/Time (local) Field', 'cforms2'),
'html5email' => 'HTML5 ' . __('Email Field', 'cforms2'),
'html5month' => 'HTML5 ' . __('Month Field', 'cforms2'),
'html5number' => 'HTML5 ' . __('Number Field', 'cforms2'),
'html5range' => 'HTML5 ' . __('Range Field', 'cforms2'),
'html5search' => 'HTML5 ' . __('Search Field', 'cforms2'),
'html5time' => 'HTML5 ' . __('Time Field', 'cforms2'),
'html5url' => 'HTML5 ' . __('URL Field', 'cforms2'),
'html5week' => 'HTML5 ' . __('Week Field', 'cforms2'),
'html5tel' => 'HTML5 ' . __('Telephone Number Field', 'cforms2')
);
foreach ($types as $id => $label) {
$t = new Html5($id, $label);
$t->register_at_filter();
}
});
}

}
8 changes: 4 additions & 4 deletions Fieldtypes/MultiId.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public function is_special() {
}

public static function register() {
$t = new MultiId('fieldsetend', __('End Fieldset', 'cforms2'), false);
$t->register_at_filter();

add_action('init', function() {
$t = new MultiId('fieldsetend', __('End Fieldset', 'cforms2'), false);
$t->register_at_filter();
});
}

}
21 changes: 11 additions & 10 deletions Fieldtypes/SelectBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ protected function render_additional_settings() {
}

public static function register() {
$types = array(
'emailtobox' => array(__('Multiple Recipients', 'cforms2'), true),
'selectbox' => array(__('Select Box', 'cforms2'), false),
'multiselectbox' => array(__('Multi Select Box', 'cforms2'), false)
);
foreach ($types as $id => $label) {
$t = new SelectBox($id, $label[0], $label[1]);
$t->register_at_filter();
}

add_action('init', function() {
$types = array(
'emailtobox' => array(__('Multiple Recipients', 'cforms2'), true),
'selectbox' => array(__('Select Box', 'cforms2'), false),
'multiselectbox' => array(__('Multi Select Box', 'cforms2'), false)
);
foreach ($types as $id => $label) {
$t = new SelectBox($id, $label[0], $label[1]);
$t->register_at_filter();
}
});
}

}
25 changes: 13 additions & 12 deletions Fieldtypes/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,19 @@ protected function get_text_inputs() {
}

public static function register() {
$types = array(
'textfield' => array(__('Single line of text', 'cforms2'), false),
'upload' => array(__('File Upload Box', 'cforms2'), false),
'textarea' => array(__('Multiple lines of text', 'cforms2'), false),
'pwfield' => array(__('Password Field', 'cforms2'), false),
'hidden' => array(__('Hidden Field', 'cforms2'), false)
);
foreach ($types as $id => $label) {
$t = new Text($id, $label[0], $label[1]);
$t->register_at_filter();
}

add_action('init', function() {
$types = array(
'textfield' => array(__('Single line of text', 'cforms2'), false),
'upload' => array(__('File Upload Box', 'cforms2'), false),
'textarea' => array(__('Multiple lines of text', 'cforms2'), false),
'pwfield' => array(__('Password Field', 'cforms2'), false),
'hidden' => array(__('Hidden Field', 'cforms2'), false)
);
foreach ($types as $id => $label) {
$t = new Text($id, $label[0], $label[1]);
$t->register_at_filter();
}
});
}

}