buttons as $button) { //$fields = array(); $active = isset($button['active']) ? $button['active'] : false; if ($active && $first) { $first = false; } elseif ($active && !$first) { $active = false; } $formatted_buttons[] = array( 'name' => $button['name'], 'icon' => isset($button['icon']) ? $button['icon'] : '', 'fields' => $button['fields'], 'active' => $active, ); $all_fields = array_merge($all_fields, $button['fields']); } $this->json['buttons'] = $formatted_buttons; $this->json['fields'] = $all_fields; } public function content_template() { ?>
<# if ( data.buttons ) { #>
<# for (tab in data.buttons) { #> <# if ( data.buttons[tab].icon ) { #> <# } #> {{ data.buttons[tab].name }} <# } #>
<# } #>
label ); ?>
link(); ?> />
label ); ?>
link(); checked( $this->value() ); ?>>
label ); ?> description ) ) { ?> description ); ?>