+ $primary_resource = $primary_resource_row['resource'];
+
+ $sql = "SELECT prt.type_id, rt.type
+ FROM ".TABLE_PREFIX."primary_resources pr, ".
+ TABLE_PREFIX."primary_resources_types prt, ".
+ TABLE_PREFIX."resource_types rt
+ WHERE pr.content_id = ".$cid."
+ AND pr.language_code = '".$_SESSION['lang']."'
+ AND pr.primary_resource_id='".$primary_resource_id."'
+ AND pr.primary_resource_id = prt.primary_resource_id
+ AND prt.type_id = rt.type_id";
+ // $primary_type_result = mysql_query($sql, $db);
+ $primary_types = $dao->execute($sql);
+
+ if (!$is_post_indicator_set)
+ {
+ echo ' <input type="hidden" name="use_post_for_alt" value="1" />'."\n";
+ $is_post_indicator_set = true;
+ }
+
+ // get secondary resources for the current primary resource
+ $sql = "SELECT pr.primary_resource_id, sr.secondary_resource, srt.type_id
+ FROM ".TABLE_PREFIX."primary_resources pr, ".
+ TABLE_PREFIX."secondary_resources sr, ".
+ TABLE_PREFIX."secondary_resources_types srt
+ WHERE pr.content_id = ".$cid."
+ AND pr.language_code = '".$_SESSION['lang']."'
+ AND pr.primary_resource_id='".$primary_resource_id."'
+ AND pr.primary_resource_id = sr.primary_resource_id
+ AND sr.secondary_resource_id = srt.secondary_resource_id";
+ // $secondary_result = mysql_query($sql, $db);
+ $secondary_resources = $dao->execute($sql);
+
+ echo ' <tr>'."\n";
+
+ // table cell "original resource"
+ echo ' <td headers="header1">'."\n";
+ echo ' <a href="'.$primary_resource.'" title="'._AT('new_window').'" target="_new">'.get_display_filename($primary_resource).'</a>'."\n";
+ echo ' </td>'."\n";
+
+ // table cell "original resource type"
+ echo ' <td headers="header2">'."\n";
+
+ // mysql_data_seek($resource_types_result, 0); // move the mysql result cursor back to the first row
+ // while ($resource_type = mysql_fetch_assoc($resource_types_result))
+ if (is_array($resource_types))
+ {
+ foreach ($resource_types as $resource_type) {
+ if ($resource_type['type'] == 'sign_language')
+ continue;
+ else