MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mcontextold.class
Ir para a documentação deste ficheiro.
1<?php
2// +-----------------------------------------------------------------+
3// | MIOLO - Miolo Development Team - UNIVATES Centro Universitário |
4// +-----------------------------------------------------------------+
5// | CopyLeft (L) 2001-2002 UNIVATES, Lajeado/RS - Brasil |
6// +-----------------------------------------------------------------+
7// | Licensed under GPL: see COPYING.TXT or FSF at www.fsf.org for |
8// | further details |
9// | |
10// | Site: http://miolo.codigolivre.org.br |
11// | E-mail: vgartner@univates.br |
12// | ts@interact2000.com.br |
13// +-----------------------------------------------------------------+
14// | Abstract: This file creates de handler url |
15// | |
16// | Created: 2001/08/14 Thomas Spriestersbach |
17// | Vilson Cristiano Gärtner, |
18// | |
19// | History: Initial Revision |
20// +-----------------------------------------------------------------+
21
29class MContextOld extends MService
30{
35
40
44 var $item;
45
50
55
60
71 {
72 parent::__construct();
73
74 if ($queryString == '')
75 {
76 $this->queryString = $_SERVER['QUERY_STRING'];
77
78 if ($this->manager->getConf('options.scramble'))
79 {
80 $context = $this->manager->UnScramble($this->manager->_REQUEST('MIOLO_URI'));
81 $context = str_replace('&amp;', '&', $context);
82 parse_str($context, $vars);
83 $_REQUEST = array_merge($_REQUEST, $vars);
84 }
85
86 $vars = $_REQUEST;
87 }
88 else
89 {
90 $this->queryString = $queryString;
91 $query = str_replace('&amp;', '&', $this->queryString);
92 parse_str($query, $vars);
93 }
94
95 $this->manager->Trace("Context->queryString: " . $this->queryString);
96 $this->Create($vars['module'], $vars['action'], $vars['item']);
97 }
98
111 {
112 $this->module = ($module == '') ? (($this->module == '') ? $this->manager->startup : $this->module) : $module;
113 $this->action = ($action == '') ? (($this->action == '') ? 'main' : $this->action) : $action;
114 $this->item = ($item == '') ? $this->item : $item;
115
116 $this->manager->Trace("Context::Create(module={$this->module},action={$this->action},item={$this->item})");
117
118 $this->actionTokens = explode(':', $this->action);
119 $this->currentToken = 0;
120 }
121
131 function GetAction($index = 0)
132 {
133 $action = ($index >= 0) && ($index < count($this->actionTokens)) ? $this->actionTokens[$index] : NULL;
134
135 return $action;
136 }
137
145 function ShiftAction()
146 {
147 $action = $this->currentToken < count($this->actionTokens) ? $this->actionTokens[$this->currentToken++] : NULL;
148
149 if (($action == 'main') && ($this->module == $this->manager->startup))
150 $action = $this->ShiftAction();
151
152 $this->manager->Trace("Context::ShiftAction() => $action");
153
154 return $action;
155 }
156
166 function PushAction($a)
167 {
168 if ($this->action)
169 $this->action .= ':';
170
171 $this->action .= $a;
172
173 $this->actionTokens = explode(':', $this->action);
174 $this->currentToken = 0;
175 }
176
184 function ComposeURL()
185 {
186 $amp = '&amp;';
187 return "?module=$this->module" . $amp . "action=$this->action" . $amp . "item=$this->item";
188 }
189}
190?>
GetAction($index=0)
__construct($queryString='')
Create($module, $action, $item)