pimp.handlers
上传用户:xiao730204
上传日期:2007-01-04
资源大小:141k
文件大小:6k
- <?php
- $this->globals_needed = Array(
- 'browser_obj',
- 'PIMP_VERSION',
- 'current_application',
- 'c_application',
- 'default',
- 'form_mode',
- 'app_server',
- 'template_obj',
- 'user_obj',
- 'user_admin_privileges_obj',
- 'session',
- 'session_id',
- 'mail_action_message',
- 'title',
- 'page',
- 'select_message',
- 'selected_messages',
- 'mailbox_action',
- 'server_settings_db',
- 'current_server_settings',
- /* Mail Sending Variables */
- 'attatchme',
- 'attatchme_name',
- 'attatchme_size',
- 'attatched_files',
- 'attatched_files_sizes',
- 'to_addr',
- 'cc_addr',
- 'bcc_addr',
- 'subject',
- 'mail_mesg',
- 'mail_action_send',
- 'mail_action_spellcheck',
- 'mail_action_postpone',
- 'mail_action_reset',
- 'mail_attatch_file',
- 'mail_folder',
- 'folder'
- );
- /* MAILBOX */
- $t_array = Array();
- $t_array = Array(
- 'MAIL_CHECK_MAILBOX',
- 'MAIL_SORT_ASC_SUBJECT',
- 'MAIL_SORT_REV_SUBJECT',
- 'MAIL_SORT_ASC_FROM',
- 'MAIL_SORT_REV_FROM',
- 'MAIL_SORT_ASC_DATE',
- 'MAIL_SORT_REV_DATE',
- 'MAIL_SORT_ASC_SIZE',
- 'MAIL_SORT_REV_SIZE'
- );
- for( $i = 0; $i < count( $t_array ); $i++ ) {
- $this->AddHandler(
- $temp = new AppHandler(
- $t_array[ $i ],
- './pimp/templates/mailbox/main.inc', /* Include file */
- Array(
- ), /* Global Variables */
- 'PimpHandle', /* function */
- '', /* AutoLoad objects */
- '' /* AutoLoad Optimized */
- )
- );
- }
- /* The mailbox is the default handler for the system */
- $this->AddDefaultHandler(
- $temp = new AppHandler(
- 'MAIL_CHECK_MAILBOX',
- './pimp/templates/mailbox/main.inc',
- Array(),
- 'PimpHandle',
- '',
- ''
- )
- );
- /* Read Message */
- $this->AddHandler(
- $temp = new AppHandler(
- 'MAIL_READ_MESSAGE', /* Handler Tag */
- './pimp/templates/read/main.inc', /* Include File */
- Array( 'message_id', 'sort_by' ), /* Global Variables */
- 'PimpHandle', /* Function */
- '', /* AutoLoad objects */
- '' /* AutoLoad optimized */
- )
- );
- /* Read a attatchment */
- $this->AddHandler(
- $temp = new AppHandler(
- 'MAIL_READ_ATTATCHMENT',
- './pimp/templates/read/read_attatchment.inc', /* Include File */
- Array( 'message_id', 'message_part' ), /* Global Variables */
- 'PimpHandle', /* Function */
- '', /* AutoLoad objects */
- '' /* AutoLoad optimized */
- )
- );
- /* Compose a message */
- $t_array = Array();
- $t_array = Array(
- 'MAIL_FORWARD',
- 'MAIL_REPLY',
- 'MAIL_REPLY_QUOTED',
- 'MAIL_COMPOSE_ATTATCH',
- 'MAIL_COMPOSE_ATTATCH_REMOVE',
- 'MAIL_COMPOSE_MAIN',
- 'MAIL_COMPOSE'
- );
- for( $i = 0; $i < count( $t_array ); $i++ ) {
- $this->AddHandler(
- $temp = new AppHandler(
- $t_array[ $i ],
- './pimp/templates/compose/main.inc',
- /* Variables needed from the global scope */
- Array(),
- 'PimpHandle', /* Function */
- '', /* AutoLoad objects */
- '' /* AutoLoad optimized */
- )
- );
- if ( is_array( $attatched_files ) ) {
- $q = 0;
- reset( $attatched_files );
- while( list( $user_filename, $tmp_filename ) = each( $attatched_files ) ) {
- $q++;
- $handler_ref = $this->handlers[ $t_array[ $i ] ];
- $handler_ref->globals_needed[] =
- 'mail_remove_attatch_' . $i ;
- $this->handlers[ $t_array[ $i ] ] = $handler_ref;
- }
- }
- }
- /* Send a message */
- $this->AddHandler(
- $temp = new AppHandler(
- 'MAIL_COMPOSE_SEND',
- './pimp/templates/compose/send.inc',
- /* Variables needed from the global scope */
- Array(),
- 'PimpHandle', /* Function */
- '', /* AutoLoad objects */
- '' /* AutoLoad optimized */
- )
- );
- /* Mail Preferences */
- $t_array = Array();
- $t_array = Array(
- 'MAIL_PREFERENCES',
- 'MAIL_PREF_SERVER',
- 'MAIL_PREF_SIG'
- );
- for( $i = 0; $i < count( $t_array ); $i++ ) {
- $this->AddHandler(
- $temp = new AppHandler(
- $t_array[ $i ],
- './pimp/templates/preferences/main.inc',
- /* Variables needed from the global scope */
- Array(
- 'mail_server_name',
- 'mail_user_name',
- 'mail_user_password',
- 'mail_from_address',
- 'mail_from_name',
- 'server_type',
- 'mail_sig'
- ),
- 'PimpHandle', /* Function */
- '', /* AutoLoad objects */
- '' /* AutoLoad optimized */
- )
- );
- }
- $this->AddHandler(
- $temp = new AppHandler(
- 'MAIL_ADD_FOLDER_FRM',
- './pimp/templates/folders/add/form.inc',
- Array(),
- 'PimpHandle',
- '',
- ''
- )
- );
- $this->AddHandler(
- $temp = new AppHandler(
- 'MAIL_ADD_FOLDER',
- './pimp/templates/folders/add/process_form.inc',
- Array( 'new_folder' ),
- 'PimpHandle',
- '',
- ''
- )
- );
- $this->AddHandler(
- $temp = new AppHandler(
- 'MAIL_REMOVE_FOLDER_FRM',
- './pimp/templates/folders/remove/form.inc',
- Array(),
- 'PimpHandle',
- '',
- ''
- )
- );
- $this->AddHandler(
- $temp = new AppHandler(
- 'MAIL_REMOVE_FOLDER',
- './pimp/templates/folders/remove/process_form.inc',
- Array( 'folder_to_remove' ),
- 'PimpHandle',
- '',
- ''
- )
- );
- ?>