1
|
<?php
|
2
|
/**
|
3
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
4
|
*
|
5
|
* This program is free software: you can redistribute it and/or modify
|
6
|
* it under the terms of the GNU General Public License as published by
|
7
|
* the Free Software Foundation, either version 3 of the License, or
|
8
|
* (at your option) any later version.
|
9
|
*
|
10
|
* This program is distributed in the hope that it will be useful,
|
11
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
* GNU General Public License for more details.
|
14
|
*
|
15
|
* You should have received a copy of the GNU General Public License
|
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
*/
|
18
|
|
19
|
/**
|
20
|
* update_keys.php
|
21
|
*
|
22
|
* @category Modules
|
23
|
* @package Modules_MultiLingual
|
24
|
* @author Werner v.d.Decken <wkl@isteam.de>
|
25
|
* @author Dietmar Wöllbrink <dietmar.woellbrink@websiteBaker.org>
|
26
|
* @copyright Werner v.d.Decken <wkl@isteam.de>
|
27
|
* @license http://www.gnu.org/licenses/gpl.html GPL License
|
28
|
* @version 1.6.8
|
29
|
* @revision $Revision: 2090 $
|
30
|
* @link $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/MultiLingual/update_keys.php $
|
31
|
* @lastmodified $Date: 2014-01-19 23:08:22 +0100 (Sun, 19 Jan 2014) $
|
32
|
* @since File available since 09.01.2013
|
33
|
* @description xyz
|
34
|
*/
|
35
|
|
36
|
// Create new admin object
|
37
|
if(!defined('WB_URL'))
|
38
|
{
|
39
|
$config_file = realpath('../../config.php');
|
40
|
if(file_exists($config_file) && !defined('WB_URL'))
|
41
|
{
|
42
|
require($config_file);
|
43
|
}
|
44
|
}
|
45
|
|
46
|
$mod_path = dirname(__FILE__);
|
47
|
//$mod_rel = str_replace($_SERVER['DOCUMENT_ROOT'],'',str_replace('\\', '/', $mod_path ));
|
48
|
$mod_name = basename($mod_path);
|
49
|
|
50
|
// Get page id
|
51
|
// Include WB admin wrapper script
|
52
|
// Tells script to update when this page was last updated
|
53
|
$update_when_modified = false;
|
54
|
require(WB_PATH.'/modules/admin.php');
|
55
|
$temp_page_id = intval( htmlentities($page_id ) );
|
56
|
|
57
|
$oTrans = Translate::getInstance();
|
58
|
$oTrans->enableAddon( 'modules/'.basename(dirname(__FILE__)) );
|
59
|
|
60
|
// check for page languages
|
61
|
$oPageLang = new m_MultiLingual_Lib();
|
62
|
$Result = $oPageLang->updateDefaultPagesCode();
|
63
|
if($database->is_error())
|
64
|
{
|
65
|
$admin->print_error($database->get_error(), ADMIN_URL.'/pages/settings.php?page_id='.$temp_page_id );
|
66
|
} else {
|
67
|
$admin->print_success($oTrans->MESSAGE_PAGES_UPDATE_SETTINGS, ADMIN_URL.'/pages/settings.php?page_id='.$temp_page_id );
|
68
|
}
|
69
|
/**
|
70
|
* Create repeated string
|
71
|
* @param integer $iRepeats number of repetitions
|
72
|
* @param string $sString string to use for one indent (default: \t)
|
73
|
* @return string created string with repetitions of $sString
|
74
|
* @description create a string depending on number of repeats and a string for each repeat<br />
|
75
|
* Gives a way to generate pretty formatted HTML code being outputted, by providing<br />
|
76
|
* a certain number of TABs or SPACEs, according to the indent level.
|
77
|
*/
|
78
|
function spacer($iRepeats = 1, $sString = "\t"){
|
79
|
return str_repeat($sString, max(0, intval($iRepeats)));
|
80
|
}
|