1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* Copyright 2005, STMicroelectronics |
4
|
|
|
* |
5
|
|
|
* Originally written by Manuel Vacelet |
6
|
|
|
* |
7
|
|
|
* This file is a part of Codendi. |
8
|
|
|
* |
9
|
|
|
* Codendi is free software; you can redistribute it and/or modify |
10
|
|
|
* it under the terms of the GNU General Public License as published by |
11
|
|
|
* the Free Software Foundation; either version 2 of the License, or |
12
|
|
|
* (at your option) any later version. |
13
|
|
|
* |
14
|
|
|
* Codendi is distributed in the hope that it will be useful, |
15
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
16
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17
|
|
|
* GNU General Public License for more details. |
18
|
|
|
* |
19
|
|
|
* You should have received a copy of the GNU General Public License |
20
|
|
|
* along with Codendi. If not, see <http://www.gnu.org/licenses/>. |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
require_once('common/mvc/Controler.class.php'); |
24
|
|
|
require_once(dirname(__FILE__).'/actions/WikiServiceAdminActions.class.php'); |
25
|
|
|
require_once(dirname(__FILE__).'/views/WikiServiceAdminViews.class.php'); |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* |
29
|
|
|
* @package WikiService |
30
|
|
|
* @subpackage WikiServiceAdmin |
31
|
|
|
* @copyright STMicroelectronics, 2005 |
32
|
|
|
* @author Manuel Vacelet <[email protected]> |
33
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL |
34
|
|
|
*/ |
35
|
|
|
class WikiServiceAdmin extends Controler { |
36
|
|
|
/* private Wiki*/ var $wiki; |
37
|
|
|
|
38
|
|
|
function WikiServiceAdmin($id) { |
39
|
|
|
global $LANG, $is_wiki_page; |
40
|
|
|
|
41
|
|
|
//used so the search box will add the necessary element to the pop-up box |
42
|
|
|
$is_wiki_page = 1; |
43
|
|
|
|
44
|
|
|
$this->gid = (int) $id; |
45
|
|
|
|
46
|
|
|
if(empty($this->gid)) |
47
|
|
|
exit_no_group(); |
48
|
|
|
|
49
|
|
|
if(!user_ismember($this->gid, 'W2')) |
50
|
|
|
exit_permission_denied(); |
51
|
|
|
|
52
|
|
|
$this->wiki = new Wiki($this->gid); |
53
|
|
|
|
54
|
|
|
// If Wiki for project doesn't exist, propose creation... |
55
|
|
|
if(!$this->wiki->exist()) { |
|
|
|
|
56
|
|
|
header('Location: /wiki/index.php?group_id='.$this->gid.'&view=install'); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
// Set language for phpWiki |
60
|
|
|
if ($this->wiki->getLanguage_id()) { |
61
|
|
|
define('DEFAULT_LANGUAGE', $this->wiki->getLanguage_id()); |
62
|
|
|
$LANG = $this->wiki->getLanguage_id(); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
function request() { |
68
|
|
|
// Default behaviour: display default view: |
69
|
|
|
$this->view = 'main'; |
70
|
|
|
|
71
|
|
|
if(!empty($_REQUEST['view'])) |
72
|
|
|
$this->view = $_REQUEST['view']; |
73
|
|
|
|
74
|
|
|
if(!empty($_REQUEST['action'])) { |
75
|
|
|
$this->action = $_REQUEST['action']; |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
?> |
If an expression can have both
false
, andnull
as possible values. It is generally a good practice to always use strict comparison to clearly distinguish between those two values.