/[eiffelstudio]/trunk/Documentation/tools/web/trunk/drupal/sites/all/modules/isedoc/isedoc.uuid_query.inc
ViewVC logotype

Contents of /trunk/Documentation/tools/web/trunk/drupal/sites/all/modules/isedoc/isedoc.uuid_query.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 74722 - (show annotations)
Thu Sep 18 10:41:37 2008 UTC (11 years, 4 months ago) by jfiat
File size: 1302 byte(s)
fixed uuid query
1 <?php
2
3 require_once ("isedoc.lib.inc");
4
5 function isedoc_uuid_query($uuid) {
6 $output = t("Query Documentation page for <strong>UUID=%uuid</strong>.", array('%uuid'=>$uuid));
7 $output .= '<br/>';
8
9 $nids = isedoc_node_ids_by_uuid($uuid);
10 if ($nids) {
11 $output .= "<ul>";
12 if (count($nids) == 1) {
13 end(&$nids);
14 $nid = key(&$nids);
15 $node =& node_load(array('nid' => $nid));
16 if ($node) {
17 drupal_set_message(t("Accessed by the UUID=%uuid.",array('%uuid' => $uuid)), 'status');
18 drupal_goto($node->path);
19 $output .= '<li>' . isedoc_uuid_page_display(&$node) . '</li>';
20 } else {
21 // Should not occur ...
22 $output .= t("Unable to find page referenced by UUID:%uuid", array('%uuid' => $uuid));
23 }
24 } else {
25 // Should not occur ...
26 foreach($nids as $nid => $vid) {
27 $node =& node_load(array('nid' => $nid));
28 if ($node) {
29 $output .= '<li>' . isedoc_uuid_page_display(&$node) . '</li>';
30 }
31 }
32 }
33 $output .= "</ul>";
34 } else {
35 $output .= t("Unable to find page referenced by UUID:%uuid", array('%uuid' => $uuid));
36 }
37
38 return $output."<br/><br/>";
39 }
40
41 function isedoc_uuid_page_display(&$node) {
42 $output = t("Page %tit", array('%tit' => $node->title));
43 $output .= " (" . l(t("view"), $node->path) .")";
44 return $output;
45 }
46
47 ?>

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.23