Revision 893
Added by aldus almost 16 years ago
trunk/wb/admin/templates/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 = ""; |
trunk/wb/admin/modules/uninstall.php | ||
---|---|---|
53 | 53 |
/** |
54 | 54 |
* Check if the module is in use |
55 | 55 |
* |
56 |
* @version 0.1.1
|
|
57 |
* @build 2
|
|
58 |
* @date 2008-11-12
|
|
56 |
* @version 0.2.0
|
|
57 |
* @build 1
|
|
58 |
* @date 2008-12-29
|
|
59 | 59 |
* @author aldus |
60 |
* @package Websitebaker - Admin - modules
|
|
61 |
* @state @dev
|
|
60 |
* @package Website Baker: Admin - modules
|
|
61 |
* @state @beta
|
|
62 | 62 |
* |
63 | 63 |
*/ |
64 | 64 |
|
... | ... | |
76 | 76 |
/** |
77 | 77 |
* Modul is in use, so we have to warn the user |
78 | 78 |
*/ |
79 |
|
|
80 |
$add = $info->numRows() == 1 ? "this page" : "these pages"; |
|
81 |
$msg_template_str = "<br /><br />Modul <b>{{modul_name}}</b> could not be uninstalled because it is still in use on "; |
|
82 |
$msg_template_str .= $add.":<br /><i>click for editing.</i><br /><br />"; |
|
83 |
|
|
79 |
if (!array_key_exists("CANNOT_UNINSTALL_IN_USE_TMPL", $MESSAGE['GENERIC'])) { |
|
80 |
$add = $info->numRows() == 1 ? "this page" : "these pages"; |
|
81 |
$msg_template_str = "<br /><br />{{type}} <b>{{type_name}}</b> could not be uninstalled because it is still in use on {{pages}}"; |
|
82 |
$msg_template_str .= ":<br /><i>click for editing.</i><br /><br />"; |
|
83 |
} else { |
|
84 |
$msg_template_str = $MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE_TMPL']; |
|
85 |
$temp = explode(";",$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE_TMPL_PAGES']); |
|
86 |
$add = $info->numRows() == 1 ? $temp[0] : $temp[1]; |
|
87 |
} |
|
84 | 88 |
/** |
85 | 89 |
* The template-string for displaying the Page-Titles ... in this case as a link |
86 | 90 |
*/ |
87 | 91 |
$page_template_str = "- <b><a href='../pages/sections.php?page_id={{id}}'>{{title}}</a></b><br />"; |
88 | 92 |
|
89 |
$values = array ('modul_name' => $file);
|
|
93 |
$values = array ('type' => 'Modul', 'type_name' => $file, 'pages' => $add );
|
|
90 | 94 |
$msg = replace_all ( $msg_template_str, $values ); |
91 | 95 |
|
92 | 96 |
$page_names = ""; |
... | ... | |
94 | 98 |
while ($data = $info->fetchRow() ) { |
95 | 99 |
|
96 | 100 |
$temp = $database->query("SELECT page_title from ".TABLE_PREFIX."pages where page_id=".$data['page_id']); |
97 |
$temp_title = $temp->fetchRow(); |
|
101 |
$temp_title = $temp->fetchRow( DB_FETCHMODE_ASSOC );
|
|
98 | 102 |
|
99 | 103 |
$page_info = array( |
100 | 104 |
'id' => $data['page_id'], |
trunk/wb/languages/DE.php | ||
---|---|---|
548 | 548 |
$MESSAGE['GENERIC']['BAD_PERMISSIONS'] = 'Kann im Zielverzeichnis nicht schreiben'; |
549 | 549 |
$MESSAGE['GENERIC']['INVALID'] = 'Die übertragene Datei ist ungültig'; |
550 | 550 |
$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE'] = 'Deinstallation nicht möglich: Datei wird benutzt'; |
551 |
|
|
552 |
$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE_TMPL'] = "<br /><br />Das {{type}} <b>{{type_name}}</b> kann nicht deinstalliert werden, weil es auf {{pages}} benutzt wird:<br /><br />"; |
|
553 |
$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE_TMPL_PAGES'] = "folgender Seite;folgenden Seiten"; |
|
554 |
$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE'] = "Das Template <b>{{name}}</b> kann nicht deinstalliert werden, weil es das Standardtemplate ist!"; |
|
555 |
|
|
551 | 556 |
$MESSAGE['GENERIC']['WEBSITE_UNDER_CONSTRUCTION'] = 'Momentan in Bearbeitung'; |
552 | 557 |
$MESSAGE['GENERIC']['PLEASE_CHECK_BACK_SOON'] = 'Bitte versuchen Sie es später noch einmal ...'; |
553 | 558 |
$MESSAGE['GENERIC']['PLEASE_BE_PATIENT'] = 'Die Datenbanksicherung kann je nach Größe der Datenbank einige Zeit dauern.'; |
Also available in: Unified diff
added language-support for the error-messages
for the uninstall files for modules and templates.
update german languagefile with the new textes.