<commit_before><?php
/**
 * Creates multiple buttons without gaps.
 *
 * Reference:
 * http://agiletoolkit.org/doc/ref
 */
/*==ATK4===================================================
   This file is part of Agile Toolkit 4
    http://agiletoolkit.org/

   (c) 2008-2013 Agile Toolkit Limited <<EMAIL>>
   Distributed under Affero General Public License v3 and
   commercial license.

   See LICENSE or LICENSE_COM for more information
=====================================================ATK4=*/
class View_ButtonSet extends HtmlElement
{
    // options to pass to buttonset JS widget
    public $options = array();
    
    // buttonset direction (false = horizontal, true = vertical)
    public $vertical = false;



    /**
     * Add button to buttonset
     *
     * @param string $label Label of button
     * @param array $options Options to pass to button
     *
     * @return Button
     */
    function addButton($label = null, $options = array())
    {
        $but = $this->add('Button', $options)->setLabel($label);
        if ($this->vertical) {
            $but->js(true)->css('margin-top', '-3px');
        }
        return $but;
    }

    /**
     * Render
     *
     * @return void
     */
    function render()
    {
        if ($this->vertical) {
            $this->js(true)->_load('jquery-ui.buttonset-vertical');
            $this->js(true)->buttonsetv($this->options);
        } else {
            $this->js(true)->buttonset($this->options);
        }
        parent::render();
    }
}<commit_msg>make buttonset more friendly to tohse who extend it<commit_after><?php
/**
 * Creates multiple buttons without gaps.
 *
 * Reference:
 * http://agiletoolkit.org/doc/ref
 */
/*==ATK4===================================================
   This file is part of Agile Toolkit 4
    http://agiletoolkit.org/

   (c) 2008-2013 Agile Toolkit Limited <<EMAIL>>
   Distributed under Affero General Public License v3 and
   commercial license.

   See LICENSE or LICENSE_COM for more information
=====================================================ATK4=*/
class View_ButtonSet extends HtmlElement
{
    // options to pass to buttonset JS widget
    public $options = array();
    
    // buttonset direction (false = horizontal, true = vertical)
    public $vertical = false;



    /**
     * Add button to buttonset
     *
     * @param string $label Label of button
     * @param array $options Options to pass to button
     *
     * @return Button
     */
    function addButton($label = null, $options = array())
    {
        $but = $this->add('Button', $options)->setLabel($label);
        if ($this->vertical) {
            $but->js(true)->css('margin-top', '-3px');
        }
        return $but;
    }

    function jsButtonSet() {
        if ($this->vertical) {
            $this->js(true)->_load('jquery-ui.buttonset-vertical');
            $this->js(true)->buttonsetv($this->options);
        } else {
            $this->js(true)->buttonset($this->options);
        }
    }

    /**
     * Render
     *
     * @return void
     */
    function render()
    {
        $this->jsButtonSet();
        parent::render();
    }
}
{'fraction_non_alphanumeric': 0.19555555555555557, 'fraction_numerical': 0.008253968253968255, 'mean_word_length': 2.4324618736383443, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3673177', 'n_tokens_mistral': 907, 'n_tokens_neox': 872, 'n_words': 233}