'Include JS & CSS needed for hierarchical CRUD'

@staticmethod
def include_scripts(widget_id, widget_opts):

    s3 = current.response.s3
    scripts = s3.scripts
    theme = current.deployment_settings.get_ui_hierarchy_theme()
    script_dir = ('/%s/static/scripts' % current.request.application)
    if s3.debug:
        script = ('%s/jstree.js' % script_dir)
        if (script not in scripts):
            scripts.append(script)
        script = ('%s/S3/s3.ui.hierarchicalcrud.js' % script_dir)
        if (script not in scripts):
            scripts.append(script)
        style = ('%s/jstree.css' % theme.get('css', 'plugins'))
        if (style not in s3.stylesheets):
            s3.stylesheets.append(style)
    else:
        script = ('%s/S3/s3.jstree.min.js' % script_dir)
        if (script not in scripts):
            scripts.append(script)
        style = ('%s/jstree.min.css' % theme.get('css', 'plugins'))
        if (style not in s3.stylesheets):
            s3.stylesheets.append(style)
    script = ("$('#%(widget_id)s').hierarchicalcrud(%(widget_opts)s)" % {'widget_id': widget_id, 'widget_opts': json.dumps(widget_opts, separators=SEPARATORS)})
    s3.jquery_ready.append(script)
    return
