Platform
3.1
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
fdl_forumdelentry.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5
* @package FDL
6
*/
7
/**
8
* FDL Forum edition action
9
*
10
* @author Anakeen 2000
11
* @version $Id: fdl_forumdelentry.php,v 1.3 2008/02/19 14:08:53 eric Exp $
12
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13
* @package FDL
14
* @subpackage
15
*/
16
/**
17
*/
18
include_once (
"FDL/Class.Doc.php"
);
19
include_once (
"FDL/freedom_util.php"
);
20
21
function
fdl_forumdelentry
(&
$action
)
22
{
23
24
$docid
=
GetHttpVars
(
"docid"
,
""
);
25
$entrid =
GetHttpVars
(
"eid"
, -1);
26
$start
=
GetHttpVars
(
"start"
, -1);
27
28
$dbaccess
= GetParam(
"FREEDOM_DB"
);
29
30
if
(
$docid
==
""
)
$action
->exitError(_(
"no document reference"
));
31
$doc
=
new_Doc
(
$dbaccess
,
$docid
);
32
if
(!
$doc
->isAffected())
$action
->exitError(sprintf(_(
"cannot see unknow reference %s"
) ,
$docid
));
33
if
(
$doc
->locked == - 1) {
// it is revised document
34
$docid
=
$doc
->latestId();
35
if
(
$docid
!=
$doc
->id)
$doc
=
new_Doc
(
$dbaccess
,
$docid
);
36
}
37
if
(
$doc
->Control(
"edit"
) !=
""
&&
$doc
->Control(
"forum"
) !=
""
)
$action
->exitError(sprintf(_(
"you don't have privilege to edit forum for document %s"
) ,
$doc
->title));
38
39
$forid = abs(intval(
$doc
->forumid));
40
$forum =
new_Doc
(
$dbaccess
, $forid);
41
if
(!$forum->isAffected())
$action
->exitError(sprintf(_(
"cannot see unknow forum reference %s"
) , $forid));
42
43
$doc
->disableEditControl();
44
45
$forum->removeentry($entrid);
46
47
redirect(
$action
,
"FDL"
,
"IMPCARD&sole=Y&zone=FDL:FORUM_VIEW:S&id="
. $forum->id .
"&start="
.
$start
);
48
}
49
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase