## -*- coding: utf_8 -*-
<%
from fcp import fcpdefs
from fcp import mlitem
from cStringIO import StringIO
import base64
%>
<%namespace name="toolbar" file="toolbars.html" import="create"/>
<%
myMLItem = fcp.MyMLItem
thisWebID = myMLItem.WebID()
nFiles = fcp.NFiles
if nFiles==None:
nFiles = 0
jsonStr = StringIO()
jsonStr.write('{"MYMLITEM":'+myMLItem.AsJSONArrayItem(mlitem.sendAll,(client.serverTZ,client.clientTZ))+',"NFILES":'+str(nFiles) + ',"MLDS":[')
toolbar.create(fcp)
context.write('
')
if subList!=None:
nItems = len(subList)
for i in range(nItems):
item = subList[i]
if item:
jsonStr.write(item.AsJSONArrayItem(mlitem.sendAll,(client.serverTZ,client.clientTZ)) + ',')
else:
i = 0
item = fcp.GetNthMLItem(i)
while item:
jsonStr.write(item.AsJSONArrayItem(mlitem.sendAll,(client.serverTZ,client.clientTZ)) + ',')
i = i + 1
item = fcp.GetNthMLItem(i)
strOut = jsonStr.getvalue()
jsonStr.close()
lenJSON = len(strOut)
if strOut[lenJSON-1]==',':
strOut = strOut[0:lenJSON-1]
strOut = strOut + ']}'
context.write('
')
context.write('
')
%>