$urlEtype = new CCombobox('urls[' . $i . '][elementtype]', $url['elementtype']); $urlEtype->addItems(sysmap_element_types()); $removeButton = new CSpan(_('Remove'), 'link_menu'); $removeButton->addAction('onclick', '$("urlEntry_' . $i . '").remove();'); $urlRow = new CRow(array($urlLabel, $urlLink, $urlEtype, $removeButton)); $urlRow->setAttribute('id', 'urlEntry_' . $i); $urlTable->addRow($urlRow); $i++; } // append empty template row to url table $templateUrlLabel = new CTextBox('urls[#{id}][name]', '', 32); $templateUrlLabel->setAttribute('disabled', 'disabled'); $templateUrlLink = new CTextBox('urls[#{id}][url]', '', 32); $templateUrlLink->setAttribute('disabled', 'disabled'); $templateUrlEtype = new CCombobox('urls[#{id}][elementtype]'); $templateUrlEtype->setAttribute('disabled', 'disabled'); $templateUrlEtype->addItems(sysmap_element_types()); $templateRemoveButton = new CSpan(_('Remove'), 'link_menu'); $templateRemoveButton->addAction('onclick', '$("entry_#{id}").remove();'); $templateUrlRow = new CRow(array($templateUrlLabel, $templateUrlLink, $templateUrlEtype, $templateRemoveButton)); $templateUrlRow->addStyle('display: none'); $templateUrlRow->setAttribute('id', 'urlEntryTpl'); $urlTable->addRow($templateUrlRow); // append "add" button to url table $addButton = new CSpan(_('Add'), 'link_menu'); $addButton->addAction('onclick', 'cloneRow("urlEntryTpl", ' . $i . ')'); $addButtonColumn = new CCol($addButton); $addButtonColumn->setColSpan(4); $urlTable->addRow($addButtonColumn); // append url table to form list $sysmapList->addRow(_('URLs'), new CDiv($urlTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
$urlEtype = new CCombobox('urls[' . $i . '][elementtype]', $url['elementtype']); $urlEtype->addItems(sysmap_element_types()); $removeButton = new CSpan(_('Remove'), 'link_menu'); $removeButton->addAction('onclick', '$("urlEntry_' . $i . '").remove();'); $urlRow = new CRow(array($urlLabel, $urlLink, $urlEtype, $removeButton)); $urlRow->setAttribute('id', 'urlEntry_' . $i); $urlTable->addRow($urlRow); $i++; } // append empty template row to url table $tplUrlLabel = new CTextBox('urls[#{id}][name]', '', 32); $tplUrlLabel->setAttribute('disabled', 'disabled'); $tplUrlLink = new CTextBox('urls[#{id}][url]', '', 32); $tplUrlLink->setAttribute('disabled', 'disabled'); $tplUrlEtype = new CCombobox('urls[#{id}][elementtype]'); $tplUrlEtype->setAttribute('disabled', 'disabled'); $tplUrlEtype->addItems(sysmap_element_types()); $tplRemoveButton = new CSpan(_('Remove'), 'link_menu'); $tplRemoveButton->addAction('onclick', '$("entry_#{id}").remove();'); $tplUrlRow = new CRow(array($tplUrlLabel, $tplUrlLink, $tplUrlEtype, $tplRemoveButton)); $tplUrlRow->addStyle('display: none'); $tplUrlRow->setAttribute('id', 'urlEntryTpl'); $urlTable->addRow($tplUrlRow); // append "add" button to url table $addButton = new CSpan(_('Add'), 'link_menu'); $addButton->addAction('onclick', 'cloneRow("urlEntryTpl", ' . $i . ')'); $addButtonColumn = new CCol($addButton); $addButtonColumn->setColSpan(4); $urlTable->addRow($addButtonColumn); // append url table to sysmap $sysmapList->addRow(_('URLs'), new CDiv($urlTable, 'objectgroup inlineblock border_dotted ui-corner-all'));