Project

General

Profile

1 2 Manuela
<?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
 * @category        core
19
 * @package         test
20
 * @subpackage      test
21
 * @author          Dietmar Wöllbrink
22
 * @copyright       WebsiteBaker Org. e.V.
23
 * @link            http://websitebaker.org/
24
 * @license         http://www.gnu.org/licenses/gpl.html
25
 * @platform        WebsiteBaker 2.8.3
26
 * @requirements    PHP 5.4 and higher
27
 * @version         $Id$
28
 * @filesource      $HeadURL$
29
 * @lastmodified    $Date$
30
 *
31
 */
32
33
// Create new admin object and print admin header
34
if (!defined('WB_PATH')){require( (dirname(dirname(dirname(__DIR__)))).'/config.php' );}
35
if ( !class_exists('admin', false) ) { require(WB_PATH.'/framework/class.admin.php'); }
36
//$admin = new admin('##skip##', false, false);
37
$admin = new admin('Pages', 'pages_settings',false);
38
// initialize json_respond array  (will be sent back)
39
$aJsonRespond = array();
40
$aJsonRespond['message'] = 'Ajax operation failed';
41
$aJsonRespond['success'] = FALSE;
42
//if (!$admin->is_authenticated()){exit(json_encode($aJsonRespond));}
43
if (!$admin->is_authenticated() || !$admin->ami_group_member('1')){exit(json_encode($aJsonRespond));}
44
45
if (is_writable(WB_PATH.'/temp/cache')) {
46
    Translate::getInstance()->clearCache();
47
}
48
/*
49
unset($aJsonRespond['message']);
50
*/
51
$aJsonRespond['message'] = 'Translate Cache was cleared';
52
// If the script is still running, set success to true
53
$aJsonRespond['success'] = true;
54
// and echo the json_respond to the ajax function
55
exit(json_encode($aJsonRespond));