1 | <?php |
---|
2 | /** |
---|
3 | * @file |
---|
4 | * Semantic theme wrapper. |
---|
5 | * |
---|
6 | * @ingroup views_templates |
---|
7 | */ |
---|
8 | |
---|
9 | $output = '<div id="semantic" class="clear-block">'; |
---|
10 | $output .= '<div id="semantic-fields" class="fields-reports">'; |
---|
11 | $output .= '<div class="semantic-report">'; |
---|
12 | foreach ($report['data'] as $nid => $values) { |
---|
13 | $id = key($values); |
---|
14 | $pk = $nid; |
---|
15 | if (user_access('admin planificador')){ |
---|
16 | $pk = 'node/' . $nid; |
---|
17 | } |
---|
18 | $datos = FALSE; |
---|
19 | if (is_array($values)) { |
---|
20 | if (trim($values[$id]['value']) != ''){ |
---|
21 | $datos = TRUE; |
---|
22 | } |
---|
23 | } |
---|
24 | if ($datos) { |
---|
25 | $output .= '<object pk="' . $pk . '" model="report-semantic-' . $nid . '">'; |
---|
26 | if (is_array($report['data'][$nid])) { |
---|
27 | if (trim($values[$id]['value']) != ''){ |
---|
28 | $output .= '<field type="TextField" name="campo-' . $options['data'] . '">' . check_plain($values[$id]['value']) . '</field>'; |
---|
29 | } |
---|
30 | } |
---|
31 | $output .= '</object>'; |
---|
32 | } |
---|
33 | $links = array(); |
---|
34 | $link = array("name" => t("Consultar"), "description" => t("Consultar Información"), "key" => $nid, "url" => "node/$nid", "type" => "consultar"); |
---|
35 | $links = views_semantic_links($links, $link); |
---|
36 | $acceso = user_access('view content semantic') ? 1 : 0; |
---|
37 | $options = array('options' =>$links); |
---|
38 | drupal_add_js($options, 'setting'); |
---|
39 | } |
---|
40 | foreach ($report['extra'] as $nid => $values) { |
---|
41 | $id = key($values); |
---|
42 | $pk = $nid; |
---|
43 | if (is_array($values)) { |
---|
44 | if (trim($report_extra[$id]['value']) != ''){ |
---|
45 | $output .= '<field type="TextField" name="campo-' . $options[$op] . '">' . check_plain($report_extra[$id]['value']) . '</field>'; |
---|
46 | } |
---|
47 | } |
---|
48 | $links = array(); |
---|
49 | $link = array("name" => t("Consultar"), "description" => t("Consultar Información"), "key" => $nid, "url" => "node/$nid", "type" => "consultar", "target" => "_blank"); |
---|
50 | $links = views_semantic_links($links, $link); |
---|
51 | $acceso = user_access('view content semantic') ? 1 : 0; |
---|
52 | $options = array('options' =>$links); |
---|
53 | drupal_add_js($options, 'setting'); |
---|
54 | } |
---|
55 | $output .= "</div>"; |
---|
56 | $output .= "</div>"; |
---|
57 | $output .= "</div>"; |
---|
58 | |
---|
59 | $output = views_semantic_curl($output, 'rep'); |
---|
60 | print $output; |
---|
61 | ?> |
---|
62 | |
---|