ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

gallery_view.js
Go to the documentation of this file.
1
6 if( !ultimix )
7 {
8 ultimix = {};
9 }
10
16 if( !ultimix.gallery )
17 {
18 ultimix.gallery = {};
19 }
20
28 ultimix.gallery.add_item_to_gallery = function( ServerData )
29 {
30 eval( "var ServerDataObject=" + ServerData );
31
32 var ItemTemplate = jQuery( '.gallery>.gallery_template' ).html();
33 ItemTemplate = ultimix.string_utilities.print_record( ItemTemplate , ServerDataObject );
34
35 jQuery( '.gallery>.gallery_items' ).append( ItemTemplate );
36 }
37
49 ultimix_gallery_after_image_upload_processor = function( File , ServerData , ReceivedResponse )
50 {
51 try
52 {
53 var Progress = new FileProgress( File , this.customSettings.progressTarget );
54
55 Progress.setComplete();
56 Progress.setStatus( ultimix.get_string( 'complete' ) );
57 Progress.toggleCancel( false );
58
59 ultimix.gallery.add_item_to_gallery( ServerData );
60 }
61 catch( ex )
62 {
63 this.debug( ex );
64 }
65 }
66
76 ultimix.gallery.detach_file_success = function( GalleryId , FileId )
77 {
78 var LoadingId = ultimix.std_dialogs.MessageBox(
79 ultimix.get_string( 'wait_please' ) , ultimix.get_string( 'Info' ) ,
80 ultimix.std_dialogs.MB_ICONLOADING | ultimix.std_dialogs.MB_MODAL
81 );
82
83 ultimix.DirectController(
84 {
85 'package_name' : 'gallery::gallery_controller' , 'meta' : 'meta_gallery_detach_file' ,
86 'gallery_id' : GalleryId , 'file_id' : FileId
87 } ,
88 function()
89 {
90 ultimix.std_dialogs.close_message_box( LoadingId );
91 jQuery( '#gallery_file_' + FileId ).remove();
92 }
93 );
94 }
95
105 ultimix.gallery.detach_file = function( GalleryId , FileId )
106 {
107 ultimix.std_dialogs.MessageBox(
108 ultimix.get_string( 'shure_to_delete_file' ) , ultimix.get_string( 'Question' ) ,
109 ultimix.std_dialogs.MB_YESNO | ultimix.std_dialogs.MB_ICONQUESTION | ultimix.std_dialogs.MB_MODAL ,
110 function()
111 {
112 ultimix.gallery.detach_file_success( GalleryId , FileId );
113 }
114 );
115 }
116
126 ultimix.gallery.set_default_options = function( ViewOptions )
127 {
128 if( !ViewOptions )
129 {
130 ViewOptions = {};
131 }
132
133 ViewOptions.meta = ViewOptions.meta ? ViewOptions.meta : 'meta_gallery_list';
134 ViewOptions.package_name = ViewOptions.package_name ? ViewOptions.package_name : 'gallery::gallery_view';
135 ViewOptions.paging_require_form = ViewOptions.paging_require_form ? ViewOptions.paging_require_form : '0';
136 ViewOptions.add_hidden_fields = ViewOptions.add_hidden_fields ? ViewOptions.add_hidden_fields : '0';
137
138 return( ViewOptions );
139 }
140
150 ultimix.gallery.get_list_form = function( Fuctions , ViewOptions )
151 {
152 if( !Fuctions )
153 {
154 Fuctions = {};
155 }
156
157 ViewOptions = ultimix.gallery.set_default_options( ViewOptions );
158
159 ultimix.ajax_gate.direct_view( ViewOptions , Fuctions );
160 }
161
177 ultimix.gallery.get_custom_list_form = function( Fuctions , Header , Item , Footer , ViewOptions )
178 {
179 ultimix.auto.get_custom_list_form( Fuctions , Header , Item , Footer , false , ViewOptions , 'ad_banner' );
180 }
181
191 ultimix.gallery.delete = function( Id , DataSelector )
192 {
193 ultimix.auto.delete(
194 Id , DataSelector ,
195 {
196 'package_name' : 'gallery::gallery_controller' ,
197 'gallery_context_action' : 'delete_record' ,
198 'gallery_action' : 'delete_record' , 'gallery_record_id' : Id ,
199 'meta' : 'meta_delete_gallery'
200 }
201 );
202 }
203
215 ultimix.gallery.record_view_form = function( Id , DataSelector )
216 {
217 ultimix.auto.record_view_form(
218 Id , DataSelector ,
219 {
220 'package_name' : 'gallery::gallery_view' , 'gallery_context_action' : 'record_view_form' ,
221 'gallery_action' : 'record_view_form' , 'gallery_record_id' : Id ,
222 'meta' : 'meta_record_view_gallery_form'
223 }
224 );
225 }