ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

page_manager.php
Go to the documentation of this file.
1 <?php
2
3 /*
4 * This source code is a part of the Ultimix Project.
5 * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6 * it's own license wich could be found from the corresponding files or sources.
7 * This source code is provided "as is" without any warranties or garanties.
8 *
9 * Have a nice day!
10 *
11 * @url http://ultimix.sorceforge.net
12 *
13 * @author Alexey "gdever" Dodonov
14 */
15
26 class page_manager_1_0_0{
27
38 var $Output;
39
50 var $CachedMultyFS = false;
51 var $Security = false;
52 var $String = false;
53
64 function __construct()
65 {
66 try
67 {
68 $this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
69 $this->Security = get_package( 'security' , 'last' , __FILE__ );
70 $this->String = get_package( 'string' , 'last' , __FILE__ );
71 }
72 catch( Exception $e )
73 {
74 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
75 }
76 }
77
96 function update_packages( $Options )
97 {
98 try
99 {
100 $Security = get_package( 'security' , 'last' , __FILE__ );
101 $PageName = $Security->get_p( 'page_record_id' , 'command' );
102
103 $PageAccess = get_package( 'page::page_access' , 'last' , __FILE__ );
104 $PageAccess->set_package_appliance( $PageName , $Security->get_p( 'page_packages' , 'unsafe_string' ) );
105 }
106 catch( Exception $e )
107 {
108 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
109 }
110 }
111
130 function update_permitions( $Options )
131 {
132 try
133 {
134 $Security = get_package( 'security' , 'last' , __FILE__ );
135 $PageName = $Security->get_p( 'page_record_id' , 'command' );
136
137 $PermitAccess = get_package( 'permit::permit_access' , 'last' , __FILE__ );
138 $Permitions = $Security->get_p( 'page_permitions' , 'unsafe_string' );
139 $PermitAccess->set_permits_for_page( $PageName , $Permitions );
140 }
141 catch( Exception $e )
142 {
143 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
144 }
145 }
146
165 function controller( $Options )
166 {
167 try
168 {
169 $ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
170
171 $ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcxs_update_packages' );
172
173 $ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcxs_update_permitions' );
174
175 $ContextSet->execute( $Options , $this , __FILE__ );
176 }
177 catch( Exception $e )
178 {
179 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
180 }
181 }
182
201 function update_permitions_form( $Options )
202 {
203 try
204 {
205 $this->Output = $this->CachedMultyFS->get_template( __FILE__ , 'permitions_form.tpl' );
206
207 $PermitAccess = get_package( 'permit::permit_access' , 'last' , __FILE__ );
208 $PageAlias = $this->Security->get_p( 'page_record_id' , 'command' );
209 $Permitions = $PermitAccess->get_permits_for_page( $PageAlias );
210 $Permitions = implode( ',' , $Permitions );
211
212 $this->Output = str_replace( '{prefix}' , 'page' , $this->Output );
213 $this->Output = str_replace( '{page_permitions}' , $Permitions , $this->Output );
214 $this->Output = str_replace( '{page_alias}' , $PageAlias , $this->Output );
215 }
216 catch( Exception $e )
217 {
218 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
219 }
220 }
221
244 function view( $Options )
245 {
246 try
247 {
248 $ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
249
250 $ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcxs_packages_form' );
251
252 $ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcxs_permitions_form' );
253
254 $ContextSet->execute( $Options , $this , __FILE__ );
255
256 return( $this->Output );
257 }
258 catch( Exception $e )
259 {
260 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
261 }
262 }
263 }
264
265 ?>