Current File : //usr/share/lib/pkg/web/config.shtml
## -*- coding: utf-8 -*-
##
##
## Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
##
<%!
        import urlparse
        import re
%>\
<%page args="g_vars"/>\
## Please note that the opensolaris.org and sun.com themes can not be used
## unless authorized by Sun Microsystems, Inc.
<%
        web_config = g_vars["web_config"]

        # Specify the name of a theme to use below.  The value specified should
        # be the name of a directory found in the _themes directory.  If no
        # value is provided, an attempt to determine an appropriate theme will
        # be made.
        web_config["theme"] = ""
%>\
## Nothing below this line should normally be changed.
<%
        request = g_vars["request"]
        if not web_config["theme"]:
                # If a theme was not specified, attempt to determine which theme
                # to use based on an absolute URL to the current server.
                scheme, netloc, path, params, query, fragment = \
                    urlparse.urlparse(request.url(), allow_fragments=0)

                match = re.match("(?:.*[.])?(opensolaris.(?:com|org)|sun.com|oracle.com)", netloc)
                if match:
                        web_config["theme"] = match.group(1)
                else:
                        web_config["theme"] = "default"
%>\