Support plain HTML code in details box
authorJoey Schulze <joey@infodrom.org>
Thu, 4 Mar 2010 23:01:14 +0000 (00:01 +0100)
committerJoey Schulze <joey@infodrom.org>
Thu, 4 Mar 2010 23:01:14 +0000 (00:01 +0100)
lib/mask.php

index f5e890c..beb7d5e 100644 (file)
@@ -152,11 +152,15 @@ function build_details($name, $details)
   $ret[] = sprintf('<h3>%s</h3>', $details['title']);
   if (array_key_exists('subtitle', $details))
     $ret[] = sprintf('<p class="subtitle">%s</p>', $details['subtitle']);
-  $ret[] = '<ul>';
-  foreach ($details['list'] as $name => $info) {
-    $ret[] = sprintf('<li>%s: <span id="detail_%s"></span></li>', $info['name'], $name);
+  if (array_key_exists('html',$details)) {
+    $ret[] = $details['html'];
+  } elseif (array_key_exists('list',$details)) {
+    $ret[] = '<ul>';
+    foreach ($details['list'] as $name => $info) {
+      $ret[] = sprintf('<li>%s: <span id="detail_%s"></span></li>', $info['name'], $name);
+    }
+    $ret[] = '</ul>';
   }
-  $ret[] = '</ul>';
   $ret[] = '</div>';
 
   return $ret;