Project

General

Profile

« Previous | Next » 

Revision 2098

Added by darkviper almost 11 years ago

! activate class Translate for all addons in admin/ (except pages/)
! class.admin >> add translation of the current theme to Translate

View differences:

uninstall.php
33 33
}
34 34
// After check print the header
35 35
$admin->print_header();
36
$oLang = Translate::getInstance();
37
$oLang->enableAddon('admin\\languages');
36 38

  
37 39
// Get language name
38 40
if(!isset($_POST['code']) OR $_POST['code'] == "") {
......
44 46
}
45 47
// fix secunia 2010-93-2
46 48
if (!preg_match('/^([A-Z]{2}.php)/', $file)) {
47
	$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']);
49
	$admin->print_error($oLang->MESSAGE_GENERIC_FORGOT_OPTIONS);
48 50
}
49 51

  
50 52
// Check if the template exists
51 53
if(!is_file(WB_PATH.'/languages/'.$file)) {
52
	$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']);
54
	$admin->print_error($oLang->MESSAGE_GENERIC_NOT_INSTALLED);
53 55
}
54 56

  
55 57
// Check if the template exists
56 58
if(!is_readable(WB_PATH.'/languages/'.$file)) {
57
	$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']);
59
	$admin->print_error($oLang->MESSAGE_ADMIN_INSUFFICIENT_PRIVELLIGES);
58 60
}
59 61

  
60 62
// Include the WB functions file
......
62 64

  
63 65
// Check if the language is in use
64 66
if($code == DEFAULT_LANGUAGE OR $code == LANGUAGE) {
65
	$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL_IN_USE']);
67
	$admin->print_error($oLang->MESSAGE_GENERIC_CANNOT_UNINSTALL_IN_USE);
66 68
} else {
67 69
	$sql  = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'users` ';
68 70
	$sql .= 'WHERE`language`=\''.$database->escapeString($code).'\'';
69 71
	if( $database->get_one($sql) ) {
70
		$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL_IN_USE']);
72
		$admin->print_error($oLang->MESSAGE_GENERIC_CANNOT_UNINSTALL_IN_USE);
71 73
	}
72 74
}
73 75

  
74 76
// Try to delete the language code
75 77
if(!unlink(WB_PATH.'/languages/'.$file)) {
76
	$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL']);
78
	$admin->print_error($oLang->MESSAGE_GENERIC_CANNOT_UNINSTALL);
77 79
} else {
78 80
	// Remove entry from DB
79 81
	$sql  = 'DELETE FROM `'.TABLE_PREFIX.'addons` ';
......
81 83
	$sql .=   'AND `type`=`type`=\'language\' ';
82 84
	if( $database->query($sql) ) {
83 85
        // Print success message
84
        $admin->print_success($MESSAGE['GENERIC_UNINSTALLED']);
86
        $admin->print_success($oLang->MESSAGE_GENERIC_UNINSTALLED);
85 87
    } else {
86
    	$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL'].'<br />'.$database->get_error());
88
    	$admin->print_error($oLang->MESSAGE_GENERIC_CANNOT_UNINSTALL.'<br />'.$database->get_error());
87 89
    }
88 90
}
89 91

  

Also available in: Unified diff