public static function include_jquery_ui()
    {
        if (self::$disabled || in_array('jquery_ui', self::$included)) {
            return;
        }
        // Avoid conflicts with jquery ui version of the cms
        if (self::isAdminBackend()) {
            self::$included[] = 'jquery_ui';
            return;
        }
        switch (self::config()->jquery_ui_version) {
            case self::JQUERY_UI_FRAMEWORK:
                $path = THIRDPARTY_DIR . '/jquery-ui/jquery-ui';
                break;
            case self::JQUERY_UI_V1:
                $path = FORM_EXTRAS_PATH . '/javascript/jquery-ui/jquery-ui';
                break;
            default:
                $path = THIRDPARTY_DIR . '/jquery-ui/jquery-ui';
                break;
        }
        if (Director::isDev()) {
            Requirements::javascript($path . '.js');
            Requirements::block($path . '.min.js');
        } else {
            Requirements::javascript($path . '.min.js');
            Requirements::block($path . '.js');
        }
        if (self::config()->jquery_ui_theme != self::JQUERY_UI_THEME_DEFAULT) {
            Requirements::block(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
            Requirements::block(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.min.css');

            $theme = self::config()->jquery_ui_theme;
            // in case the less styles are used, developer should include it himself
            if ($theme != self::JQUERY_UI_THEME_NONE) {
                Requirements::css($theme);
            }
        } else {
            if (Director::isDev()) {
                Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
            } else {
                Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.min.css');
            }
        }
        self::$included[] = 'jquery_ui';
    }