# Path: exe/webui/common.py
# def newId():
# def docType():
# def header(style=u'default'):
# def footer():
# def hiddenField(name, value=u""):
# def textInput(name, value=u"", size=40, disabled=u"", **kwargs):
# def textArea(name, value="", disabled="", cols="80", rows="8"):
# def richTextArea(name, value="", width="100%", height=100, package=None):
# def image(name, value, width="", height="", alt=None):
# def flash(src, width, height, id_=None, params=None, **kwparams):
# def flashMovie(movie, width, height, resourcesDir='', autoplay='false'):
# def submitButton(name, value, enabled=True, **kwargs):
# def button(name, value, enabled=True, **kwargs):
# def feedbackButton(name, value=None, enabled=True, **kwparams):
# def submitImage(action, object_, imageFile, title=u"", isChanged=1):
# def insertSymbol(name, image, title, string, text ='', num=0):
# def confirmThenSubmitImage(message, action, object_, imageFile, 
#                            title=u"", isChanged=1):
# def option(name, checked, value):
# def checkbox(name, checked, value="", title="", instruction=""):
# def elementInstruc(instruc, imageFile="help.gif", label=None):
# def formField(type_, package, caption, action, object_='', instruction='', \
#         *args, **kwargs):
# def select(action, object_='', options=[], selection=None):
# def editModeHeading(text):
# def removeInternalLinks(html, anchor_name=""):
# def removeInternalLinkNodes(html):
# def findLinkedField(package, exe_node_path, anchor_name):
# def findLinkedNode(package, exe_node_path, anchor_name, check_fields=True):
# def getAnchorNameFromLinkName(link_name):
# def renderInternalLinkNodeFilenames(package, html):
# def requestHasCancel(request):


import logging
from twisted.web.resource      import Resource
from exe.webui                 import common
from exe.webui.renderable      import RenderableResource
        Initialize
        """
        RenderableResource.__init__(self, parent)
        self.localeNames  = []
        
        for locale, translation in self.config.locales.items():
            localeName  = locale + ": " 
            langName = translation.info().get('x-exe-language', None)
            if langName == None:
                langName = translation.info().get('x-poedit-language', 'English')
            localeName += langName
            self.localeNames.append((localeName, locale))
        self.localeNames.sort()

        
    def getChild(self, name, request):
        """
        Try and find the child for the name given
        """
        if name == "":
            return self
        else:
            return Resource.getChild(self, name, request)


    def render_GET(self, request):
        """Render the preferences"""
        log.debug("render_GET")
        
        # Rendering

# Path: exe/webui/common.py
# def newId():
# def docType():
# def header(style=u'default'):
# def footer():
# def hiddenField(name, value=u""):
# def textInput(name, value=u"", size=40, disabled=u"", **kwargs):
# def textArea(name, value="", disabled="", cols="80", rows="8"):
# def richTextArea(name, value="", width="100%", height=100, package=None):
# def image(name, value, width="", height="", alt=None):
# def flash(src, width, height, id_=None, params=None, **kwparams):
# def flashMovie(movie, width, height, resourcesDir='', autoplay='false'):
# def submitButton(name, value, enabled=True, **kwargs):
# def button(name, value, enabled=True, **kwargs):
# def feedbackButton(name, value=None, enabled=True, **kwparams):
# def submitImage(action, object_, imageFile, title=u"", isChanged=1):
# def insertSymbol(name, image, title, string, text ='', num=0):
# def confirmThenSubmitImage(message, action, object_, imageFile, 
#                            title=u"", isChanged=1):
# def option(name, checked, value):
# def checkbox(name, checked, value="", title="", instruction=""):
# def elementInstruc(instruc, imageFile="help.gif", label=None):
# def formField(type_, package, caption, action, object_='', instruction='', \
#         *args, **kwargs):
# def select(action, object_='', options=[], selection=None):
# def editModeHeading(text):
# def removeInternalLinks(html, anchor_name=""):
# def removeInternalLinkNodes(html):
# def findLinkedField(package, exe_node_path, anchor_name):
# def findLinkedNode(package, exe_node_path, anchor_name, check_fields=True):
# def getAnchorNameFromLinkName(link_name):
# def renderInternalLinkNodeFilenames(package, html):
# def requestHasCancel(request):


# Path: exe/webui/preferencespage.py
import logging
from twisted.web.resource      import Resource
from exe.webui                 import common
from exe.webui.renderable      import RenderableResource

        Initialize
        """
        RenderableResource.__init__(self, parent)
        self.localeNames  = []
        
        for locale, translation in self.config.locales.items():
            localeName  = locale + ": " 
            langName = translation.info().get('x-exe-language', None)
            if langName == None:
                langName = translation.info().get('x-poedit-language', 'English')
            localeName += langName
            self.localeNames.append((localeName, locale))
        self.localeNames.sort()

        
    def getChild(self, name, request):
        """
        Try and find the child for the name given
        """
        if name == "":
            return self
        else:
            return Resource.getChild(self, name, request)


    def render_GET(self, request):
        """Render the preferences"""
        log.debug("render_GET")
        
        # Rendering

        html  = common.docType()