function printTagsPicker($preselect = NULL) { global $taglist; if (!count($taglist)) { printf('(None exist yet, %s?)', mkA('configure', 'tagtree', NULL, 'edit')); return; } printTagsPickerInput(); printTagsPickerUl($preselect); enableTagsPicker(); }
function printTagsPicker($preselect = NULL) { printTagsPickerInput(); printTagsPickerUl($preselect); enableTagsPicker(); }
function renderNetworkEditAttrs() { global $pageno, $netobject_type_id; $network = spotEntity($pageno === 'ipv4net' ? 'ipv4net' : 'ipv6net', getBypassValue()); $values = getAttrValuesForNetwork($network); echo '<p>'; startPortlet("Attributes"); printOpFormIntro('updateAttrs'); // optional attributes echo '<table border=0 cellspacing=0 cellpadding=3 align=center>'; $suggest_records = array(); if (count($values) > 0) { $i = 0; foreach ($values as $record) { if (!permitted(NULL, NULL, NULL, array(array('tag' => '$attr_' . $record['id']), array('tag' => '$any_op')))) { continue; } echo "<input type=hidden name={$i}_attr_id value={$record['id']}>"; echo '<tr><td>'; if (strlen($record['value'])) { echo "<a href='" . makeHrefProcess(array('op' => 'clearSticker', 'id' => $network['id'], 'attr_id' => $record['id'])) . "'>"; printImageHREF('clear', 'Clear value'); echo '</a>'; } else { echo ' '; } echo '</td>'; echo "<th class=sticker>{$record['name']}:</th><td class=tdleft>"; switch ($record['type']) { case 'uint': case 'float': case 'string': echo "<input type=text name={$i}_value value='{$record['value']}'>"; break; case 'dict': $suggest_records = array(); $chapter = readChapter($record['chapter_id'], 'o'); foreach ($chapter as $id => $value) { $suggest_records[$id] = array("id" => $id, "tag" => $value); } printSuggestedInput($i . "_value", $suggest_records, array("id" => $record['key']), "macros"); enableTagsPicker(); break; case 'date': $date_value = $record['value'] ? date(getConfigVar('DATETIME_FORMAT'), $record['value']) : ''; echo "<input type=text name={$i}_value value='{$date_value}'>"; break; } $i++; echo '<input type=hidden name=num_attrs value=' . $i . ">\n"; } } echo '</table>'; printImageHREF('SAVE', 'Save changes', TRUE); echo '</form>'; finishPortlet(); }