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
viewacl.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
* Generated Header (not documented yet)
9
*
10
* @author Anakeen 2000
11
* @version $Id: viewacl.php,v 1.5 2007/03/12 17:38:41 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
// ---------------------------------------------------------------
19
// $Id: viewacl.php,v 1.5 2007/03/12 17:38:41 eric Exp $
20
// $Source: /home/cvsroot/anakeen/freedom/freedom/Zone/Fdl/viewacl.php,v $
21
// ---------------------------------------------------------------
22
// ---------------------------------------------------------------
23
include_once (
"FDL/Class.Doc.php"
);
24
// -----------------------------------
25
function
viewacl
(&
$action
)
26
{
27
// ------------------------
28
$docid
= intval(
GetHttpVars
(
"docid"
));
29
$userid = intval(
GetHttpVars
(
"userid"
));
30
31
$action
->lay->Set(
"docid"
,
$docid
);
32
$action
->lay->Set(
"userid"
, $userid);
33
34
$action
->parent->AddJsRef(
$action
->GetParam(
"CORE_PUBURL"
) .
"/FDL/Layout/viewacl.js"
);
35
36
$dbaccess
=
$action
->GetParam(
"FREEDOM_DB"
);
37
38
$doc
=
new_Doc
(
$dbaccess
,
$docid
);
39
//-------------------
40
$perm
=
new
DocPerm
(
$dbaccess
, array(
41
$docid
,
42
$userid
43
));
44
45
$acls =
$doc
->acls;
46
$acls[] =
"viewacl"
;
47
$acls[] =
"modifyacl"
;
//add this acl global for every document
48
$tableacl = array();
49
50
reset($acls);
51
while
(list($k, $v) = each($acls)) {
52
$tableacl[$k][
"aclname"
] = _($v);
53
$tableacl[$k][
"acldesc"
] =
" ("
. _(
$doc
->dacls[$v][
"description"
]) .
")"
;
54
55
$pos =
$doc
->dacls[$v][
"pos"
];
56
57
$tableacl[$k][
"aclid"
] = $pos;
58
$tableacl[$k][
"iacl"
] = $k;
// index for table in xml
59
if
(
$perm
->ControlU($pos)) {
60
$tableacl[$k][
"selected"
] =
"checked"
;
61
}
else
{
62
$tableacl[$k][
"selected"
] =
""
;
63
}
64
if
(
$perm
->ControlUn($pos)) {
65
$tableacl[$k][
"selectedun"
] =
"checked"
;
66
}
else
{
67
$tableacl[$k][
"selectedun"
] =
""
;
68
}
69
if
(
$perm
->ControlUp($pos)) {
70
$tableacl[$k][
"selectedup"
] =
"checked"
;
71
}
else
{
72
$tableacl[$k][
"selectedup"
] =
""
;
73
}
74
if
(
$perm
->ControlG($pos)) {
75
$tableacl[$k][
"selectedg"
] =
"checked"
;
76
}
else
{
77
$tableacl[$k][
"selectedg"
] =
""
;
78
}
79
}
80
81
$action
->lay->SetBlockData(
"SELECTACL"
, $tableacl);
82
}
83
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase