| Total Complexity | 3 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class checkbox extends cfg_field_base |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @inheritdoc |
||
| 21 | */ |
||
| 22 | public function get_name() |
||
| 23 | { |
||
| 24 | return 'checkbox'; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * {@inheritdoc} |
||
| 29 | */ |
||
| 30 | public function prep_field(array &$vars, array &$type, $field, array $db_settings) |
||
| 31 | { |
||
| 32 | $vars['method'] = 'build_checkbox'; |
||
| 33 | $vars['params'][] = $field; |
||
| 34 | $type[0] = 'custom'; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Used to build multi-column checkboxes for blocks config |
||
| 39 | * |
||
| 40 | * if multi-dimensional array, we break the checkboxes into columns ex. |
||
| 41 | * array( |
||
| 42 | * 'news' => array( |
||
| 43 | * 'field1' => 'Label 1', |
||
| 44 | * 'field2' => 'Label 2', |
||
| 45 | * ), |
||
| 46 | * 'articles' => array( |
||
| 47 | * 'field1' => 'Label 1', |
||
| 48 | * 'field2' => 'Label 2', |
||
| 49 | * ), |
||
| 50 | * ) |
||
| 51 | * @param array $option_ary |
||
| 52 | * @param mixed $selected_items |
||
| 53 | * @param string $field |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | public function build_checkbox(array $option_ary, $selected_items, $field) |
||
| 70 | } |
||
| 71 | } |
||
| 72 |