/**
 *
 * @param <type> $id
 * @param <type> $defaultPath
 * @param <type> $type
 */
function set_ui_extra_widgets_configuration_files($id, $defaultPath, $type = null)
{
    $ui_css = sfConfig::get(sprintf('app_ys_jquery_%s_css', $id), array());
    $ui_js = sfConfig::get(sprintf('app_ys_jquery_%s_js', $id), array());
    $css_path = get_ui_extra_widgets_css_path($id, $defaultPath['css']);
    $js_path = get_ui_extra_widgets_js_path($id, $defaultPath['js']);
    $type = strtolower(trim($type));
    switch ($type) {
        case 'css':
            foreach ($ui_css as $style) {
                add_css_configuration_file($style, 'last', $css_path);
            }
            break;
        case 'js':
            foreach ($ui_js as $js) {
                add_js_configuration_file($js, 'last', $js_path);
            }
            break;
        default:
            foreach ($ui_css as $style) {
                add_css_configuration_file($style, 'last', $css_path);
            }
            foreach ($ui_js as $js) {
                add_js_configuration_file($js, 'last', $js_path);
            }
            break;
    }
}
/**
 * Make the tabs sortable.
 * @param string $selector jQuery Selector
 * @param string $axis If defined, the items can be dragged only horizontally or vertically,
 * default horizontally
 * @param boolean $add_configuration_file For add ui.sortable.js automatically
 * @return <type>
 */
function ui_tabs_sortable($selector, $axis = 'x', $add_configuration_file = true)
{
    if ($add_configuration_file) {
        add_js_configuration_file('ui.sortable.js');
    }
    return jquery_support($selector, 'tabs', null, true, '.find(".ui-tabs-nav").sortable({axis:"' . $axis . '"})');
}