bugfix: dictionary attrs were broken
authorAlexey Andriyanov <alan@al-an.info>
Fri, 30 Oct 2015 07:24:39 +0000 (10:24 +0300)
committerAlexey Andriyanov <alan@al-an.info>
Fri, 30 Oct 2015 07:24:39 +0000 (10:24 +0300)
network-attrs.php

index 589f467..e14ff70 100644 (file)
@@ -180,12 +180,8 @@ function renderNetworkEditAttrs()
                                        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 ();
+                                       $opts = array ('0' => '(none)') + readChapter ($record['chapter_id'], 'o');
+                                       printSelect ($opts, array ('name' => "{$i}_value"), $record['key']);
                                        break;
                                case 'date':
                                        $date_value = $record['value'] ? date(getConfigVar('DATETIME_FORMAT'), $record['value']) : '';