int sectionCount = sectionList.size();
for (int i = 0; i < sectionCount; i++) {
Section section = (Section) sectionList.get(i);
Map children = (Map) sections.get(section);
LocaleManager localeManager = LocaleManager.lookup();
String sectionTitle = StringUtil.replaceAll(localeManager.localize(section.getTitle()).toString(), "\\", "\\\\");
sectionTitle = StringUtil.replaceAll(sectionTitle, "'", "\\'");
result += "['" + sectionTitle + "', '" + section.getId() + "_" + section.getPosition() + "_" + (sectionCount - 1) + "'";
if (children != null && !children.isEmpty()) {
result += ", ";