Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
path.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: path.php,v 1.3 2004/03/22 15:21:40 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage CORE
15  */
16 /**
17  */
18 // ---------------------------------------------------------------
19 // $Id: path.php,v 1.3 2004/03/22 15:21:40 eric Exp $
20 // $Source: /home/cvsroot/anakeen/freedom/core/Zone/Core/path.php,v $
21 // ---------------------------------------------------------------
22 // $Log: path.php,v $
23 // Revision 1.3 2004/03/22 15:21:40 eric
24 // change HTTP variable name to put register_globals = Off
25 //
26 // Revision 1.2 2003/08/18 15:46:42 eric
27 // phpdoc
28 //
29 // Revision 1.1 2002/01/08 12:41:34 eric
30 // first
31 //
32 // Revision 1.5 2000/10/22 14:22:51 marc
33 // Gestion des langues
34 //
35 // Revision 1.4 2000/10/11 16:31:33 yannick
36 // Nouvelle gestion de l'init
37 //
38 // Revision 1.3 2000/10/10 19:08:37 marc
39 // Mise au point
40 //
41 // Revision 1.2 2000/10/06 19:38:34 marc
42 // Mise en oeuvre
43 //
44 //
45 // ---------------------------------------------------------------
46 include_once ("Class.Action.php");
47 
48 function path(&$action)
49 {
50  global $_GET;
51  $app = $_GET["app"];
52  $act = $_GET["action"];
53 
54  if ($app != "CORE") {
55 
56  $appcalled = new Application();
57  $appcalled->Set($app, $action->parent);
58 
59  $c = new Action();
60  $c->Set($act, $appcalled);
61  $ito = 0;
62  do {
63  $continue = 0;
64  // Add current action
65  $toc[$ito]["base"] = $c->parent->Getparam("CORE_BASEURL");
66  $toc[$ito]["appl"] = $c->parent->name;
67  $toc[$ito]["name"] = $c->name;
68  $toc[$ito]["style"] = "tocitem0on";
69  if (substr($c->short_name, 0, 1) == '&') {
70  $sn = substr($c->short_name, 1, strlen($c->short_name));
71  $toc[$ito]["descr"] = $c->text($sn);
72  } else {
73  $toc[$ito]["descr"] = $c->short_name;
74  }
75  $ito++;
76  $action->log->debug("Current node : {$c->name}, father id {$c->father}");
77  if ($c->father > 0) {
78  $query = new QueryDb($action->dbaccess, "Action");
79  $query->basic_elem->sup_where = array(
80  "id='" . $c->father . "'"
81  );
82  $query->Query(0, 0, "TABLE");
83  if ($query->nb > 0) {
84  $c = new Action();
85  $c->Set($query->list[0]->name, $appcalled);
86  $continue = 1;
87  }
88  }
89  } while ($continue);
90  // Add application
91  $toc[$ito]["base"] = $appcalled->Getparam("CORE_BASEURL");
92  $toc[$ito]["appl"] = $appcalled->name;
93  $toc[$ito]["name"] = "";
94  $toc[$ito]["style"] = "tocitem0on";
95  $toc[$ito]["descr"] = $appcalled->name;
96  $ito++;
97  }
98 
99  if (isset($toc)) {
100  $toc2 = array_reverse($toc);
101  $action->lay->SetBlockCorresp("PATH", "BASE", "base");
102  $action->lay->SetBlockCorresp("PATH", "APPL", "appl");
103  $action->lay->SetBlockCorresp("PATH", "NAME", "name");
104  $action->lay->SetBlockCorresp("PATH", "STYLE", "style");
105  $action->lay->SetBlockCorresp("PATH", "DESCR", "descr");
106  $action->lay->SetBlockData("PATH", $toc2);
107  $action->lay->SetBlockData("PATHEMPTY", NULL);
108  } else {
109  $action->lay->SetBlockData("PATH", NULL);
110  $action->lay->SetBlockCorresp("PATHEMPTY", "NOPCAR", "nopcar");
111  $action->lay->SetBlockData("PATHEMPTY", array(
112  array(
113  "nopcar" => " "
114  )
115  ));
116  }
117 }
118 ?>
← centre documentaire © anakeen - published under CC License - Dynacase