1: <?php
2: namespace Sphp\tools {
3: /**
4: * Description of Gate
5: *
6: * @author Sartaj Singh
7: */
8: class Gate extends SphpGate {
9: protected $auth = "GUEST";
10: protected $tblName = "";
11: protected $masterFile = "";
12: /** @var \Sphp\kit\Page $page */
13: public $page = "";
14: /** @var \Sphp\tools\FrontFile $frontform */
15: public $frontform;
16: /** @var \Sphp\tools\FrontFile $mainfrontform */
17: public $mainfrontform;
18: /** @var string $gate_dir_path Gate folder path */
19: public $gate_dir_path = "";
20: /** @var string $phppath res folder path */
21: public $phppath = "";
22: /** @var string $respath res browser url */
23: public $respath = "";
24: /** @var string $myrespath Gate browser url */
25: public $myrespath = "";
26: /** @var string $mypath Gate folder path */
27: public $mypath = "";
28: /** @var \Sphp\kit\JSServer $JSServer */
29: public $JSServer = null;
30: /** @var \Sphp\core\Request $Client */
31: public $Client = null;
32: /** @var \MySQL $dbEngine */
33: public $dbEngine = null;
34: /** @var \Sphp\core\DebugProfiler $debug */
35: public $debug = null;
36: /**
37: * Assign Default FrontFile to Gate for render
38: * @param \Sphp\tools\FrontFile $obj
39: */
40: public function setFrontFile($obj) {}
41: /**
42: * Get Current FrontFile assign to Gate for render
43: * @return \Sphp\tools\FrontFile
44: */
45: public function getFrontFile() {}
46: /**
47: * Rendering Permission to default assigned FrontFile
48: */
49: public function showFrontFile() {}
50: /**
51: * Disable Rendering Permission to default assigned FrontFile
52: */
53: public function showNotFrontFile() {}
54: /**
55: * Set default table of Database to Sphp\Page object and this Gate.
56: * This information is important for Components and other database users objects.
57: * @param string $dbtable
58: */
59: public function setTableName($dbtable) {}
60: /**
61: * get default database table assigned to Gate
62: * @return string
63: */
64: public function getTableName() {}
65: /**
66: * get Gate event name trigger by browser
67: * @return string
68: */
69: public function getEvent() {}
70: /**
71: * get Gate event parameter post by browser
72: * @return string
73: */
74: public function getEventParameter() {}
75: /**
76: * onstart=1
77: * Gate Life Cycle Event
78: * override this event handler in your Gate to handle it.
79: * trigger when Gate start
80: */
81: public function onstart() {}
82: /**
83: * onfrontinit=2
84: * Trigger After FrontFile Parse Phase, Component oninit and oncreate
85: * Events and before Components onaftercreate event. Trigger for
86: * each Front File use with BasicGate
87: * Only Trigger if Front File is used with Gate
88: * override this event handler in your Gate to handle it.
89: * @param \Sphp\tools\FrontFile $frontobj
90: */
91: public function onfrontinit($frontobj) {}
92: /**
93: * onfrontprocess=3
94: * Trigger after onaftercreate Event of Component and before BasicGate onready and onrun Events
95: * and also before ongateevent Event of Component
96: * Only Trigger if Front File is used with Gate
97: * override this event handler in your Gate to handle it.
98: * @param \Sphp\tools\FrontFile $frontobj
99: */
100: public function onfrontprocess($frontobj) {}
101: /**
102: * onready=4
103: * Gate Life Cycle Event
104: * override this event handler in your Gate to handle it.
105: * trigger after FrontFile Initialization and ready to Run Gate.
106: */
107: public function onready() {}
108: /**
109: * onrun=5
110: * Gate LifeCycle Event
111: * override this event handler in your Gate to handle it.
112: * trigger when Gate run after ready event and before trigger any PageEvent
113: */
114: public function onrun() {}
115: /**
116: * PageEvent Delete
117: * Trigger only when Browser access URL is matched with PageEvent
118: * Trigger only one PageEvent per request.
119: * Trigger after onrun Event and before on render.
120: * override this event handler in your Gate to handle it.
121: * trigger when browser get (url=index-delete.html)
122: * where index is Gate of Gate and Gate path is in reg.php file
123: */
124: public function page_delete() {}
125: /**
126: * PageEvent View
127: * Trigger only when Browser access URL is matched with PageEvent
128: * Trigger only one PageEvent per request.
129: * Trigger after onrun Event and before on render.
130: * override this event handler in your Gate to handle it.
131: * trigger when browser get (url=index-view-19.html)
132: * where index is Gate of Gate and Gate path is in reg.php file
133: * view = event name
134: * 19 = recid of database table or any other value.
135: */
136: public function page_view() {}
137: /**
138: * PageEvent Submit
139: * Trigger only when Browser access URL is matched with PageEvent
140: * Trigger only one PageEvent per request.
141: * Trigger after onrun Event and before on render.
142: * override this event handler in your Gate to handle it.
143: * trigger when browser post Filled Form Components (url=index.html)
144: * where index is Gate of Gate and Gate path is in reg.php file
145: */
146: public function page_submit() {}
147: /**
148: * PageEvent Insert
149: * Trigger only when Browser access URL is matched with PageEvent
150: * Trigger only one PageEvent per request.
151: * Trigger after onrun Event and before on render.
152: * override this event handler in your Gate to handle it.
153: * trigger when browser post Filled Empty Form Components (url=index.html)
154: * where index is Gate of Gate and Gate path is in reg.php file
155: */
156: public function page_insert() {}
157: /**
158: * PageEvent Update
159: * Trigger only when Browser access URL is matched with PageEvent
160: * Trigger only one PageEvent per request.
161: * Trigger after onrun Event and before on render.
162: * override this event handler in your Gate to handle it.
163: * trigger when browser post Edited Form Components Which Filled with
164: * \SphpBase::page()->viewData() (url=index.html)
165: * from database with view_data function
166: * where index is Gate of Gate and Gate path is in reg.php file
167: */
168: public function page_update() {}
169: /**
170: * PageEvent New
171: * Trigger only when Browser access URL is matched with PageEvent
172: * Trigger only one PageEvent per request.
173: * Trigger after onrun Event and before on render.
174: * override this event handler in your Gate to handle it.
175: * trigger when browser get URL (url=index.html) first time
176: * where index is Gate of Gate and Gate path is in reg.php file
177: */
178: public function page_new() {}
179: /**
180: * onrender=10
181: * Gate Life Cycle Event
182: * override this event handler in your Gate to handle it.
183: * trigger when Gate render after run FrontFile but before start master
184: * file process. You can't manage FrontFile output here but you can replace FrontFile
185: * output in SphpBase::$dynData or change master file or add front place for master filepath
186: */
187: public function onrender() {}
188: /**
189: * set path of master design file name
190: * @param string $masterFile
191: */
192: public function setMasterFile($masterFile) {}
193: /**
194: * Set which user can access this Gate. Default user is GUEST.
195: * You can set session variable in login Gate
196: * SphpBase::sphp_request()->session('logType','ADMIN');
197: * If user is not login with specific type then Gate exit and
198: * redirect according to the getWelcome function in comp.php
199: * @param string $authenticates <p>
200: * comma separated list of string. Example:- getAuthenticate("GUEST,ADMIN") or getAuthenticate("ADNIN")
201: * </p>
202: */
203: public function getAuthenticate($authenticates) {}
204: /**
205: * Check if user has session secure url. This Gate can't work with cross session.
206: * Every Gate has unique url and expired with end of session.
207: */
208: public function getSesSecurity() {}
209: /**
210: * Advance function for change the behavior of Gate
211: * @param \Sphp\tools\FrontFile $frontobj
212: */
213: /**
214: * Advance function for change the behavior of Gate
215: * @param \Sphp\tools\FrontFile $frontobj
216: */
217: /**
218: * Advance function for change the behavior of Gate
219: */
220: protected function _processEvent() {}
221: /**
222: * Advance function for change the behavior of Gate
223: */
224: /**
225: * Advance function for change the behavior of Gate
226: */
227: protected function _render() {}
228: }
229: }
230: