def buildTableSyncFileTypes(self, section): tableBody = u"" pathsConfig = WebData().getData(section) name = u"FileTypes" value = '|'.join(pathsConfig.getFileTypes()) configType, tag = WebHelper().prepareTable(value, None) tableBody += u""" <table align="left" id="settings_sync"> <form id="saveSetting" action="/function" method="get"> <input type="hidden" name="mode" value="options.saveconfig"></input> <input type="hidden" name="what" value="settings_sync"></input> <input type="hidden" name="section" value="filetypes"></input> <input type="hidden" name="type" value="%s"></input> <tr id="tr_entry"> <td width="100px">%s:</td> <td width="0px"><input id="name" name="name" type="hidden" size="50" value="%s"></input></td> <td width="100px">%s</td> <td width="70px"><input type="submit" value="save"></input></td> </tr> </form> </table> """ % (configType, name, name, tag) return tableBody
def buildTableSyncPath(self, section): tableBody = u"" pathsConfig = WebData().getData(section) tableBody += u"""<table align="left" id="settings_sync_sub">""" tableBody += u"""<tr> <td width="100px">Enabled</td> <td width="100px">Directory</td> <td width="50px">Type</td> <td width="50px">UseFolder</td> <td width="70px"></td> </tr>""" for path in pathsConfig.getPaths(): name = u"Directory" value = path["directory"] id = path["directory"] configType, tag = WebHelper().prepareTable(value, None) types = (path["type"], pathsConfig.getPathsChoices()["type"], ) tableBody += u""" <form id="saveSetting" action="/function" method="get"> <input type="hidden" name="mode" value="options.saveconfig"></input> <input type="hidden" name="what" value="settings_sync"></input> <input type="hidden" name="section" value="paths"></input> <input type="hidden" name="Id" value="%s"></input> <tr id="tr_entry"> <td width="50px">%s</td> <td width="200px">%s</td> <td width="50px">%s</td> <td width="50px">%s</td> <td width="70px"><input type="submit" value="save"></input></td> </tr> </form> """ % (id, WebHelper().prepareTable(path["enabled"], None, "enabled")[1], WebHelper().prepareTable(path["directory"], None, "directory")[1], WebHelper().prepareTable(types, None, "type")[1], WebHelper().prepareTable(path["usefolder"], None, "usefolder")[1]) tableBody += u"""</table>""" return tableBody