Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
gate.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: gate.php,v 1.6 2006/06/01 12:54:33 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: gate.php,v 1.6 2006/06/01 12:54:33 eric Exp $
20 // $Source: /home/cvsroot/anakeen/freedom/core/Action/Core/gate.php,v $
21 // ---------------------------------------------------------------
22 // -----------------------------------
23 function gate(&$action)
24 {
25 
26  $geo = $action->GetParam("GATE_GEO");
27  $url = $action->GetParam("GATE_URL");
28 
29  $action->lay->set("bw", "30px");
30  $turl = explode(",", $url);
31  if (count($turl) != 6) {
32  for ($i = 0; $i < 6; $i++) $turl[$i] = "";
33  }
34  // geometry set
35  $tgeo = explode(",", $geo);
36  if (count($tgeo) != 6) {
37  $G1W = ($turl[0] == "") ? "0%" : "*";
38  $G2W = ($turl[2] == "") ? "0%" : "*";
39  $G3W = ($turl[4] == "") ? "0%" : "*";
40  $G1H = ($turl[1] == "") ? "0%" : "*";
41  $G2H = ($turl[3] == "") ? "0%" : "*";
42  $G3H = ($turl[5] == "") ? "0%" : "*";
43  } else {
44  list($G1W, $G1H) = explode("x", $tgeo[0]);
45  list($G2W, $G2H) = explode("x", $tgeo[2]);
46  list($G3W, $G3H) = explode("x", $tgeo[4]);
47  }
48  if (($turl[0] == "") && ($turl[1] == "")) $G1W = "0%";
49  if (($turl[2] == "") && ($turl[3] == "")) $G2W = "0%";
50  if (($turl[4] == "") && ($turl[5] == "")) $G3W = "0%";
51  if ($turl[0] == "") $G1H = "0%";
52  if ($turl[2] == "") $G2H = "0%";
53  if ($turl[4] == "") $G3H = "0%";
54 
55  if ($turl[0] != "") {
56  if ($G1H == "0%") $G1H = "10%";
57  if ($G1W == "0%") $G1W = "10%";
58  }
59  if ($turl[1] != "") {
60  //if ($G1H == "0%") $G1H="10%";
61  if ($G2W == "0%") $G2W = "10%";
62  }
63  if ($turl[2] != "") {
64  if ($G2H == "0%") $G2H = "10%";
65  if ($H2W == "0%") $G2W = "10%";
66  }
67  if ($turl[3] != "") {
68  //if ($G2H == "0%") $G2H="10%";
69  if ($G2W == "0%") $G2W = "10%";
70  }
71  if ($turl[4] != "") {
72  if ($G3H == "0%") $G3H = "10%";
73  if ($G3W == "0%") $G3W = "10%";
74  }
75  if ($turl[5] != "") {
76  //if ($G2H == "0%") $G2H="10%";
77  if ($G3W == "0%") $G3W = "10%";
78  }
79  $action->lay->set("G1W", $G1W);
80  $action->lay->set("G2W", $G2W);
81  $action->lay->set("G3W", $G3W);
82  $action->lay->set("G1H", $G1H);
83  $action->lay->set("G2H", $G2H);
84  $action->lay->set("G3H", $G3H);
85  // url set
86  while (list($k, $url) = each($turl)) {
87  $turl[$k] = urlWhatEncode($action, $url);
88  }
89 
90  $action->lay->set("urlG11", $turl[0]);
91  $action->lay->set("urlG12", $turl[1]);
92  $action->lay->set("urlG21", $turl[2]);
93  $action->lay->set("urlG22", $turl[3]);
94  $action->lay->set("urlG31", $turl[4]);
95  $action->lay->set("urlG32", $turl[5]);
96  if (($G1W == "0%") && ($G2W == "0%") && ($G3W == "0%")) $action->lay->set("bw", "*");
97  $action->session->Close(); // reinit session
98 
99 }
100 
101 function urlWhatEncode(&$action, $link)
102 {
103  // -----------------------------------
104  return str_replace(array(
105  "%S%",
106  "%B%",
107  "%U%",
108  "%L%"
109  ) , array(
110  $action->GetParam("CORE_STANDURL") ,
111  $action->GetParam("CORE_BASEURL") ,
112  $action->user->id,
113  $action->user->login
114  ) , $link);
115 }
116 ?>
← centre documentaire © anakeen - published under CC License - Dynacase