|
From: Jon O. <jon...@us...> - 2006-08-01 20:56:59
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20319/modules/mx_pafiledb/pafiledb/admin Modified Files: admin_file_manage.php Log Message: before removing Index: admin_file_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/admin/admin_file_manage.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin_file_manage.php 8 Jul 2006 16:28:46 -0000 1.2 --- admin_file_manage.php 1 Aug 2006 20:56:56 -0000 1.3 *************** *** 18,22 **** function main( $action ) { ! global $db, $images, $template, $pafiledb_template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // --- 18,23 ---- function main( $action ) { ! global $db, $images, $template, $pafiledb_template, $lang, $phpEx, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; ! global $pafiledb_functions, $pafiledb_cache, $pafiledb_config; // *************** *** 24,28 **** // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); - include_once( $module_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); // --- 25,28 ---- *************** *** 120,189 **** // $s_hidden_fields = '<input type="hidden" name="mode" value="add">'; break; - case 'add': - $template_file = 'admin/pa_admin_file_edit.tpl'; - $l_title = $lang['Afiletitle']; - $l_explain = $lang['Fileexplain']; - $s_hidden_fields = '<input type="hidden" name="mode" value="do_add">'; - break; - case 'edit': - case 'do_add': - $template_file = 'admin/pa_admin_file_edit.tpl'; - $l_title = $lang['Efiletitle']; - $l_explain = $lang['Fileexplain']; - $s_hidden_fields = '<input type="hidden" name="mode" value="do_add">'; - $s_hidden_fields .= '<input type="hidden" name="file_id" value="' . $file_id . '">'; - break; - case 'maintenance': - $template_file = 'admin/pa_admin_file_checker.tpl'; - $l_title = $lang['File_checker']; - $l_explain = $lang['File_checker_explain']; - $s_hidden_fields = '<input type="hidden" name="mode" value="do_maintenace">'; - break; - case 'mirrors': - $template_file = 'admin/pa_admin_file_mirrors.tpl'; - $l_title = $lang['Mirrors']; - $l_explain = $lang['Mirrors_explain']; - $s_hidden_fields = '<input type="hidden" name="mode" value="mirrors">'; - $s_hidden_fields .= '<input type="hidden" name="file_id" value="' . $file_id . '">'; - break; } ! if ( $mode == 'do_add' && !$file_id ) { ! $file_id = $this->update_add_file(); ! $custom_field->file_update_data( $file_id ); ! $this->_pafiledb(); ! $mode = 'edit'; ! ! if ( !$mirrors ) { // // Notification // ! $this->update_add_file_notify($file_id, 'add'); ! ! $message = $lang['Fileadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=file_manage" ) . '">', '</a>' ); ! mx_message_die( GENERAL_MESSAGE, $message ); } ! } ! elseif ( $mode == 'do_add' && $file_id ) ! { ! $file_id = $this->update_add_file( $file_id ); ! $custom_field->file_update_data( $file_id ); ! $this->_pafiledb(); ! $mode = 'edit'; ! ! if ( !$mirrors ) { // // Notification // ! $this->update_add_file_notify($file_id, 'edit'); ! ! $message = $lang['Fileedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=file_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); ! mx_message_die( GENERAL_MESSAGE, $message ); } } ! elseif ( $mode == 'delete' ) { if ( is_array( $file_ids ) && !empty( $file_ids ) ) --- 120,149 ---- // $s_hidden_fields = '<input type="hidden" name="mode" value="add">'; break; } ! if ( $mode == 'do_approve' || $mode == 'do_unapprove' ) { ! if ( is_array( $file_ids ) && !empty( $file_ids ) ) { + foreach( $file_ids as $temp_file_id ) + { + $this->approve_item( $mode, $temp_file_id ); + } // // Notification // ! $this->update_add_item_notify($file_ids, $mode); } ! else { + $this->approve_item( $mode, $file_id ); // // Notification // ! $this->update_add_item_notify($file_id, $mode); } + $this->_pafiledb(); } ! else if ( $mode == 'delete' ) { if ( is_array( $file_ids ) && !empty( $file_ids ) ) *************** *** 204,208 **** // Notification // ! $this->update_add_file_notify($temp_file_id, 'delete'); // --- 164,168 ---- // Notification // ! $this->update_add_item_notify($temp_file_id, 'delete'); // *************** *** 214,218 **** { $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " ! WHERE file_id = '" . $file_id . "'"; if ( !( $db->sql_query( $sql ) ) ) --- 174,178 ---- { $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " ! WHERE file_id = '" . $temp_file_id . "'"; if ( !( $db->sql_query( $sql ) ) ) *************** *** 233,237 **** } ! $this->delete_files( $temp_file_id ); } } --- 193,197 ---- } ! $this->delete_items( $temp_file_id ); } } *************** *** 250,254 **** // Notification // ! $this->update_add_file_notify($file_id, 'delete'); // --- 210,214 ---- // Notification // ! $this->update_add_item_notify($file_id, 'delete'); // *************** *** 279,314 **** } ! $this->delete_files( $file_id ); } $this->_pafiledb(); } - elseif ( $mode == 'do_maintenace' ) - { - $this->file_mainenance(); - } - elseif ( $mode == 'do_approve' || $mode == 'do_unapprove' ) - { - if ( is_array( $file_ids ) && !empty( $file_ids ) ) - { - foreach( $file_ids as $temp_file_id ) - { - $this->file_approve( $mode, $temp_file_id ); - } - // - // Notification - // - $this->update_add_file_notify($file_ids, $mode); - } - else - { - $this->file_approve( $mode, $file_id ); - // - // Notification - // - $this->update_add_file_notify($file_id, $mode); - } - $this->_pafiledb(); - } $pafiledb_template->set_filenames( array( 'admin' => $template_file ) ); --- 239,247 ---- } ! $this->delete_items( $file_id ); } $this->_pafiledb(); } $pafiledb_template->set_filenames( array( 'admin' => $template_file ) ); |