Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
main.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  * Main page for WHAT
9  *
10  * @author Anakeen 2000
11  * @version $Id: main.php,v 1.12 2005/10/18 15:22:46 marc 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 include_once ('Class.Application.php');
20 include_once ('Class.Session.php');
21 
22 function main(&$action)
23 {
24  global $_GET;
25  $app = new Application();
26  $app->Set($_GET["app"], $action->parent);
27  $action->lay->set("APP_TITLE", $app->description);
28  $action->lay->set("SESSION", $action->session->id);
29 
30  $mainpdescr = $action->getParam("CORE_FRONTPAGE", "");
31 
32  $izone = 0;
33  $zonedef = array();
34  $isOk = array(
35  false,
36  false,
37  false
38  );
39  if ($mainpdescr != "" && $action->user->id != 1) {
40  $tzone = explode("|", $mainpdescr);
41  if (count($tzone) != 3) continue;
42  foreach ($tzone as $k => $v) {
43  $zargs = explode(":", $v);
44  if (count($zargs) != 3) continue;
45  if ($zargs[0] == "" || $zargs[1] == "" || $zargs[2] == "") continue;
46  $zonedef[$izone]["app"] = $zargs[0];
47  $zonedef[$izone]["action"] = $zargs[1];
48  $zonedef[$izone]["size"] = $zargs[2];
49  $isOk[$izone] = true;
50  $izone++;
51  }
52  }
53 
54  $headerSize = "52";
55  $headerApp = "CORE";
56  $headerAct = "HEAD";
57  $mainSize = "*";
58  $mainApp = "CORE";
59  $mainAct = "GATE";
60  $footerSize = "35";
61  $footerApp = "CORE";
62  $footerAct = "FOOTER";
63 
64  if ($action->parent->exists("FREEGATE") && ($action->getParam("GATE_USEOLD") != "yes")) {
65 
66  $mainApp = "FREEGATE";
67  $mainAct = "FREEGATE_VIEWGATE";
68  } else {
69 
70  if ($isOk[0] && $isOk[0] && $isOk[0]) {
71 
72  $headerSize = $zonedef[0]["size"];
73  $headerApp = $zonedef[0]["app"];
74  $headerAct = $zonedef[0]["action"];
75 
76  $mainSize = $zonedef[1]["size"];
77  $mainApp = $zonedef[1]["app"];
78  $mainAct = $zonedef[1]["action"];
79 
80  $footerSize = $zonedef[2]["size"];
81  $footerApp = $zonedef[2]["app"];
82  $footerAct = $zonedef[2]["action"];
83  }
84  }
85 
86  $action->lay->set("headerSize", $headerSize);
87  $action->lay->set("headerApp", $headerApp);
88  $action->lay->set("headerAct", $headerAct);
89  $action->lay->set("mainSize", $mainSize);
90  $action->lay->set("mainApp", $mainApp);
91  $action->lay->set("mainAct", $mainAct);
92  $action->lay->set("footerSize", $footerSize);
93  $action->lay->set("footerApp", $footerApp);
94  $action->lay->set("footerAct", $footerAct);
95  // reopen a new session
96  $action->parent->session->Set("");
97  $action->parent->SetSession($action->parent->session);
98 }
99 ?>
← centre documentaire © anakeen - published under CC License - Dynacase