Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
toc.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: toc.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: toc.php,v 1.3 2004/03/22 15:21:40 eric Exp $
20 // $Source: /home/cvsroot/anakeen/freedom/core/Action/Core/toc.php,v $
21 // ---------------------------------------------------------------
22 // $Log: toc.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:41 eric
27 // phpdoc
28 //
29 // Revision 1.1 2002/01/08 12:41:33 eric
30 // first
31 //
32 // Revision 1.2 2000/10/10 19:09:11 marc
33 // Mise au point
34 //
35 // Revision 1.1 2000/10/06 19:37:44 marc
36 // Creation
37 //
38 //
39 // ---------------------------------------------------------------
40 include_once ("Class.Action.php");
41 // -----------------------------------
42 function toc(&$action)
43 {
44  // -----------------------------------
45  global $_GET;
46  $app = $_GET["app"];
47  $act = $_GET["action"];
48 
49  echo "GET[app] = [" . $app . ", GET[action] = [" . $act . "]<br>";
50 
51  if ($app == "CORE") {
52  $query = new QueryDb($action->dbaccess, "Application");
53  $query->basic_elem->sup_where = array(
54  "available='Y'"
55  );
56  $query->Query(0, 0, "TABLE");
57  $itoc = 0;
58  if ($query->nb > 0) {
59  while (list($k, $v) = each($query->list)) {
60  if ($v["name"] != "CORE") {
61  $toc[$itoc]["base"] = $action->parent->GetParam("CORE_BASEURL");
62  $toc[$itoc]["app"] = $v["name"];
63  $toc[$itoc]["action"] = "";
64  $toc[$itoc]["style"] = "tocitem0off";
65  $toc[$itoc]["label"] = $v["description"];
66  $itoc++;
67  }
68  }
69  }
70  } else {
71  $appcalled = new Application();
72  $appcalled->Set($app, $action->parent);
73  $actcalled = new Action();
74  $actcalled->Set($act, $appcalled);
75 
76  $query = new QueryDb($action->dbaccess, "Action");
77  $query->order_by = "toc_order";
78  echo "id_application=" . $actcalled->id_application . "<br>";
79  if ($actcalled->father == 0) {
80  $selectview = array(
81  "toc='Y'",
82  "available='Y'",
83  "father=0",
84  "id_application=" . $actcalled->id_application
85  );
86  // $exclude = "id=".$actcalled->id;
87 
88  } else {
89  $selectview = "father=" . $actcalled->id;
90  $exclude = "id=" . $actcalled->id;
91  }
92  $query->basic_elem->sup_where = $selectview;
93  $query->Query(0, 0, "TABLE");
94  $itoc = 0;
95  if ($query->nb > 0) {
96  while (list($k, $v) = each($query->list)) {
97  $toc[$itoc]["base"] = $action->parent->GetParam("CORE_BASEURL");
98  $toc[$itoc]["app"] = $actcalled->parent->name;
99  $toc[$itoc]["action"] = $v["name"];
100  $toc[$itoc]["style"] = ($v["name"] == $actcalled->name ? "tocitem0on" : "tocitem0off");
101  $toc[$itoc]["label"] = $v["name"];
102  $itoc++;
103  }
104  }
105  }
106  if (isset($toc)) {
107  $action->lay->SetBlockCorresp("TOC_ENTRY", "TOC_ENTRYURLROOT", "base");
108  $action->lay->SetBlockCorresp("TOC_ENTRY", "TOC_ENTRYAPP", "app");
109  $action->lay->SetBlockCorresp("TOC_ENTRY", "TOC_ENTRYPAGE", "action");
110  $action->lay->SetBlockCorresp("TOC_ENTRY", "TOC_ENTRYSTYLE", "style");
111  $action->lay->SetBlockCorresp("TOC_ENTRY", "TOC_ENTRYLABEL", "label");
112  $action->lay->SetBlockData("TOC_ENTRY", $toc);
113  } else {
114  $action->lay->SetBlockData("TOC_ENTRY", NULL);
115  }
116 }
117 ?>
← centre documentaire © anakeen - published under CC License - Dynacase