public static function buttonToolbar(array $groups, $htmlOptions = array())
    {
        if (!empty($groups)) {
            self::addCssClass('btn-toolbar', $htmlOptions);
            $parentOptions = array(
                'color' => TbArray::popValue('color', $htmlOptions),
                'size' => TbArray::popValue('size', $htmlOptions),
                'disabled' => TbArray::popValue('disabled', $htmlOptions)
            );
            $output = self::openTag('div', $htmlOptions);
            foreach ($groups as $groupOptions) {
                if (isset($groupOptions['visible']) && $groupOptions['visible'] === false) {
                    continue;
                }
                $items = TbArray::popValue('items', $groupOptions, array());
                if (empty($items)) {
                    continue;
                }
                // todo: consider removing the support for htmlOptions.
                $options = TbArray::popValue('htmlOptions', $groupOptions, array());
                if (!empty($options)) {
                    $groupOptions = TbArray::merge($options, $groupOptions);
                }
                $groupOptions = TbArray::copyValues(array('color', 'size', 'disabled'), $parentOptions, $groupOptions);
                $output .= self::buttonGroup($items, $groupOptions);
            }
            $output .= '</div>';
            return $output;
        }
        return '';
    }
public static function buttonToolbar(array $groups, $htmlOptions = array())
    {
        if (!empty($groups)) {
            self::addCssClass('btn-toolbar', $htmlOptions);
            $parentOptions = array(
                'color' => TbArray::popValue('color', $htmlOptions),
                'size' => TbArray::popValue('size', $htmlOptions),
                'disabled' => TbArray::popValue('disabled', $htmlOptions)
            );
            $output = self::openTag('div', $htmlOptions);
            foreach ($groups as $groupOptions) {
                if (isset($groupOptions['visible']) && $groupOptions['visible'] === false) {
                    continue;
                }
                $items = TbArray::popValue('items', $groupOptions, array());
                if (empty($items)) {
                    continue;
                }
                // todo: consider removing the support for htmlOptions.
                $options = TbArray::popValue('htmlOptions', $groupOptions, array());
                if (!empty($options)) {
                    $groupOptions = TbArray::merge($options, $groupOptions);
                }
                $groupOptions = TbArray::copyValues(array('color', 'size', 'disabled'), $parentOptions, $groupOptions);
                $output .= self::buttonGroup($items, $groupOptions);
            }
            $output .= '</div>';
            return $output;
        }
        return '';
    }
public static function buttonToolbar ( array $ groups , $ htmlOptions = array ( ) ) { if ( ! empty ( $ groups ) ) { self :: addCssClass ( 'btn-toolbar' , $ htmlOptions ) ; $ parentOptions = array ( 'color' => TbArray :: popValue ( 'color' , $ htmlOptions ) , 'size' => TbArray :: popValue ( 'size' , $ htmlOptions ) , 'disabled' => TbArray :: popValue ( 'disabled' , $ htmlOptions ) ) ; $ output = self :: openTag ( 'div' , $ htmlOptions ) ; foreach ( $ groups as $ groupOptions ) { if ( isset ( $ groupOptions [ 'visible' ] ) && $ groupOptions [ 'visible' ] === false ) { continue ; } $ items = TbArray :: popValue ( 'items' , $ groupOptions , array ( ) ) ; if ( empty ( $ items ) ) { continue ; } // todo: consider removing the support for htmlOptions. $ options = TbArray :: popValue ( 'htmlOptions' , $ groupOptions , array ( ) ) ; if ( ! empty ( $ options ) ) { $ groupOptions = TbArray :: merge ( $ options , $ groupOptions ) ; } $ groupOptions = TbArray :: copyValues ( array ( 'color' , 'size' , 'disabled' ) , $ parentOptions , $ groupOptions ) ; $ output .= self :: buttonGroup ( $ items , $ groupOptions ) ; } $ output .= '</div>' ; return $ output ; } return '' ; }
Generates a button toolbar.
@param array $groups the button group configurations.
@param array $htmlOptions additional HTML options.
@return string the generated button toolbar.
Generates a button toolbar .