Project

General

Profile

« Previous | Next » 

Revision 893

Added by aldus almost 16 years ago

added language-support for the error-messages
for the uninstall files for modules and templates.
update german languagefile with the new textes.

View differences:

uninstall.php
23 23

  
24 24
*/
25 25

  
26
$debug = true;
27

  
28
if (true === $debug) {
29
	ini_set('display_errors', 1);
30
	error_reporting(E_ALL);
31
}
32

  
26 33
// Check if user selected template
27 34
if(!isset($_POST['file']) OR $_POST['file'] == "") {
28 35
	header("Location: index.php");
......
60 67
/**
61 68
*	Check if the template is the standard-template or still in use
62 69
*/
63
$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE'] = "Can't unistall this template <b>".$file."</b> because it's the standardtemplate!";
70
if (!array_key_exists('CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE', $MESSAGE['GENERIC'] ) )
71
	$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE'] = "Can't uninstall this template <b>{{name}}</b> because it's the standardtemplate!";
64 72

  
65 73
if ($file == DEFAULT_TEMPLATE) {
66
	$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE']); /** Text is missing! 2008-06-15 */
74
	$temp = array ('name' => $file );
75
	$msg = replace_all( $MESSAGE['GENERIC']['CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE'], $temp );
76
	$admin->print_error( $msg );
67 77

  
68 78
} else {
69 79
	
......
84 94
		/**
85 95
		*	Template is still in use, so we're collecting the page-titles
86 96
		*
87
		*	@version	0.2.1
88
		*	@build		6
97
		*	@version	0.2.0
98
		*	@build		5
89 99
		*	@since		0.1.1
90
		*	@lastchange 2008-11-12
100
		*	@lastchange 2008-10-23
91 101
		*
92
		*	0.2.1		Remove unused constants
93 102
		*	0.2.0		Codechanges for Websitebaker to use it without the Black-Hawk-Engine
94 103
		*
95 104
		*	0.1.1		add this page <if we found only one> / these pages
......
113 122
		*	0.1.2	this page/ these pages
114 123
		*
115 124
		*/
116
		$add = $info->numRows() == 1 ? "this page" : "these pages";
117
		$msg_template_str  = "<br /><br />Template <b>{{template_name}}</b> could not be uninstalled because it is still in use by ";
118
		$msg_template_str .= $add.":<br /><i>click for editing.</i><br /><br />";
119
		
125
		if (!array_key_exists("CANNOT_UNINSTALL_IN_USE_TMPL", $MESSAGE['GENERIC'])) {
126
			$add = $info->numRows() == 1 ? "this page" : "these pages";
127
			$msg_template_str  = "<br /><br />{{type}} <b>{{type_name}}</b> could not be uninstalled because it is still in use by {{pages}}";
128
			$msg_template_str .= ":<br /><i>click for editing.</i><br /><br />";
129
		} else {
130
			$msg_template_str = $MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE_TMPL'];
131
			$temp = explode(";",$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE_TMPL_PAGES']);
132
			$add = $info->numRows() == 1 ? $temp[0] : $temp[1];
133
		}
120 134
		/**
121 135
		*	The template-string for displaying the Page-Titles ... in this case as a link
122 136
		*/
123 137
		$page_template_str = "- <b><a href='../pages/settings.php?page_id={{id}}'>{{title}}</a></b><br />";
124 138
		
125
		$values = array ('template_name' => $file);
139
		$values = array ('type' => 'Template', 'type_name' => $file, 'pages' => $add);
126 140
		$msg = replace_all ( $msg_template_str,  $values );
127 141
		
128 142
		$page_names = "";

Also available in: Unified diff