Exemplo n.º 1
0
def htmlSchemaAreas( areasList = False ):
  actualWebPath = currentPath()
  dirList = [ dir.strip() for dir in actualWebPath.split( "/" ) if not dir.strip() == "" ]
  htmlData = ""
  if not areasList:
    areasList = gWebConfig.getSchemaSections( "" )
  for area in areasList:
    htmlData += "<td id='%sPosition' class='menuSection'>" % area
    if area.lower() == dirList[0]:
      htmlData += "<div id='%sMenuAnchor' class='selectedLabel'>" % area
    else:
      htmlData += "<div id='%sMenuAnchor' class='label'>" % area
    htmlData += "%s</div></td>\n" % area.capitalize()
  return htmlData
Exemplo n.º 2
0
def htmlSchemaAreas( areasList = False ):
  actualWebPath = currentPath()
  dirList = [ dir.strip() for dir in actualWebPath.split( "/" ) if not dir.strip() == "" ]
  htmlData = ""
  if not areasList:
    areasList = gWebConfig.getSchemaSections( "" )
  for area in areasList:
    htmlData += "<td id='%sPosition' class='menuSection'>" % area
    if area.lower() == dirList[0]:
      htmlData += "<div id='%sMenuAnchor' class='selectedLabel'>" % area
    else:
      htmlData += "<div id='%sMenuAnchor' class='label'>" % area
    htmlData += "%s</div></td>\n" % area.capitalize()
  return htmlData
Exemplo n.º 3
0
def getSchemaContents( section = "" ):
  subContents = []
  for subSection in gWebConfig.getSchemaSections( section ):
    subSectionPath = "%s/%s" % ( section, subSection )
    subJSTxt = getSchemaContents( subSectionPath )
    if len( subJSTxt ) > 0:
      subContents.append( "{ text: '%s', menu : %s }" % ( subSection.capitalize(), subJSTxt ) )
  for page in gWebConfig.getSchemaPages( section ):
    pageData = gWebConfig.getSchemaPageData( "%s/%s" % ( section, page ) )
    if len( pageData ) < 3 or checkPropertiesWithUser( pageData[2:] ):
      if pageData[0].find( "http" ) == 0:
        pagePath = pageData[0]
      else:
        pagePath = diracURL( "/%s" % ( pageData[0] ) )
      subContents.append( "{ text : '%s', url : '%s' }" % ( page, pagePath ) )
  return "[%s]" % ",".join( subContents )
Exemplo n.º 4
0
def jsSchemaSection( area, section ):
  jsTxt = "["
  for subSection in gWebConfig.getSchemaSections( section ):
    subSectionPath = "%s/%s" % ( section, subSection )
    subJSTxt = jsSchemaSection( area, subSectionPath )
    if len( subJSTxt ) > 0:
      jsTxt += "{ text: '%s', submenu : { id: '%s', itemdata : %s } }, " % ( subSection, subSectionPath, subJSTxt )
  for page in gWebConfig.getSchemaPages( section ):
    pageData = gWebConfig.getSchemaPageData( "%s/%s" % ( section, page ) )
    if page != "Delimiter" or len( pageData ) < 3 or 'all' in pageData[2:] or credentials.getSelectedGroup() in pageData[2:]:
      if pageData[0].find( "http" ) == 0:
        pagePath = pageData[0]
      else:
        pagePath = diracURL( "/%s/%s" % ( area, pageData[0] ) )
      jsTxt += "{ text : '%s', url : '%s' }," % ( page, pagePath )
  jsTxt += "]"
  return jsTxt
Exemplo n.º 5
0
def jsSchemaSection( area, section ):
  jsTxt = "["
  for subSection in gWebConfig.getSchemaSections( section ):
    subSectionPath = "%s/%s" % ( section, subSection )
    subJSTxt = jsSchemaSection( area, subSectionPath )
    if len( subJSTxt ) > 0:
      jsTxt += "{ text: '%s', submenu : { id: '%s', itemdata : %s } }, " % ( subSection, subSectionPath, subJSTxt )
  for page in gWebConfig.getSchemaPages( section ):
    pageData = gWebConfig.getSchemaPageData( "%s/%s" % ( section, page ) )
    if page != "Delimiter" or len( pageData ) < 3 or 'all' in pageData[2:] or credentials.getSelectedGroup() in pageData[2:]:
      if pageData[0].find( "http" ) == 0:
        pagePath = pageData[0]
      else:
        pagePath = diracURL( "/%s/%s" % ( area, pageData[0] ) )
      jsTxt += "{ text : '%s', url : '%s' }," % ( page, pagePath )
  jsTxt += "]"
  return jsTxt
Exemplo n.º 6
0
def getSchemaContents(section=""):
    subContents = []
    for subSection in gWebConfig.getSchemaSections(section):
        subSectionPath = "%s/%s" % (section, subSection)
        subJSTxt = getSchemaContents(subSectionPath)
        if len(subJSTxt) > 0:
            subContents.append("{ text: '%s', menu : %s }" %
                               (subSection.capitalize(), subJSTxt))
    for page in gWebConfig.getSchemaPages(section):
        pageData = gWebConfig.getSchemaPageData("%s/%s" % (section, page))
        if len(pageData) < 3 or checkPropertiesWithUser(pageData[2:]):
            if pageData[0].find("http") == 0:
                pagePath = pageData[0]
            else:
                pagePath = diracURL("/%s" % (pageData[0]))
            subContents.append("{ text : '%s', url : '%s' }" %
                               (page, pagePath))
    return "[%s]" % ",".join(subContents)
Exemplo n.º 7
0
def schemaAreas():
  return gWebConfig.getSchemaSections( "" )
Exemplo n.º 8
0
def schemaAreas():
  return gWebConfig.getSchemaSections( "" )