forked from NorHei/multilingual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_keys.php
36 lines (29 loc) · 1.18 KB
/
update_keys.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// Get page id
if (isset($_GET['page_id'])) {
$temp_page_id = intval(htmlentities($_GET['page_id']));
}
include_once('../../config.php');
$mod_path = dirname(__FILE__);
$mod_rel = str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\', '/', $mod_path));
$mod_name = basename($mod_path);
// Include WB admin wrapper script
$update_when_modified = false; // Tells script to update when this page was last updated
require(WB_PATH.'/modules/admin.php');
include('lang.functions.php');
include(get_module_language_file($mod_name));
$lang_array = get_page_languages(); // check for page languages
if (count($lang_array)) {
$entries = array();
$entries = get_page_list(0);
// fill page_code with menu_title for default_language
foreach ($entries as $page_id => $val) {
db_update_field_entry((int)$page_id, 'pages', (int)$page_id);
}
}
// Check if there is a db error, otherwise say successful
if ($database->is_error()) {
$admin->print_error($database->get_error(), ADMIN_URL.'/pages/index.php');
} else {
$admin->print_success($MML['PAGES_UPDATE_SETTINGS'], ADMIN_URL.'/pages/settings.php?page_id='.$temp_page_id);
}