ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

dialogs.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 dialogs_1_0_0{
27
38 var $CachedMultyFS = false;
39 var $ContextSetConfigs = false;
40 var $String = false;
41
56 function __construct()
57 {
58 try
59 {
60 $this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
61 $this->ContextSetConfigs = get_package( 'gui::context_set::context_set_configs' , 'last' , __FILE__ );
62 $this->String = get_package( 'string' , 'last' , __FILE__ );
63 }
64 catch( Exception $e )
65 {
66 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
67 }
68 }
69
92 private function get_package_data( &$Settings )
93 {
94 try
95 {
96 /* TODO: AJAX request for record creation */
97 $PackageName = $Settings->get_setting( 'package_name' );
98 $PackageVersion = $Settings->get_setting( 'package_version' , 'last' );
99 $Prefix = $this->ContextSetConfigs->get_context_set_prefix( $PackageName , $PackageVersion );
100 $Permits = $this->ContextSetConfigs->get_context_permits(
101 'create' , $PackageName , $PackageVersion
102 );
103
104 return( array( $Prefix , $Permits ) );
105 }
106 catch( Exception $e )
107 {
108 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
109 }
110 }
111
134 function compile_create_record( &$Settings )
135 {
136 try
137 {
138 $Settings->set_setting( 'id' , md5( microtime( true ) ) );
139
140 list( $Prefix , $Permits ) = $this->get_package_data( $Settings );
141 $Settings->set_setting( 'prefix' , $Prefix );
142 $Settings->set_setting( 'permits' , $Permits );
143
144 $Code = $this->CachedMultyFS->get_template( __FILE__ , 'create_record.tpl' );
145 $Code = $this->String->print_record( $Code , $Settings->get_raw_settings() );
146
147 return( $Code );
148 }
149 catch( Exception $e )
150 {
151 $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
152 }
153 }
154 }
155
156 ?>