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
freedom_chooseaction.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
* Choose action before create en exec document
9
*
10
* @author Anakeen 2005
11
* @version $Id: freedom_chooseaction.php,v 1.2 2008/08/14 09:59:14 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
include_once (
"FDL/Class.Dir.php"
);
20
/**
21
* To choose action before create en exec document
22
* @param Action &$action current action
23
* @global id Http var : document identificator folder
24
* @global saction Http var : action name to execute
25
* @global sapp Http var : app name to execute
26
*/
27
function
freedom_chooseaction
(&
$action
)
28
{
29
30
$docid
=
GetHttpVars
(
"id"
);
31
32
$dbaccess
=
$action
->GetParam(
"FREEDOM_DB"
);
33
$doc
=
new_Doc
(
$dbaccess
,
$docid
);
34
if
(
$doc
->isAlive()) {
35
$la
=
$doc
->GetActionAttributes();
36
if
(count(
$la
) == 0)
$action
- exitError(_(
"no action found for %s document"
) ,
$doc
->title);
37
$oa = current(
$la
);
38
foreach
(
$la
as $ka => $oa) {
39
$taction[$ka][
"label"
] = $oa->getLabel();
40
41
$ta
[
"exec_application"
] = $oa->wapplication;
42
$ta
[
"exec_idref"
] =
$doc
->id;
43
$ta
[
"exec_ref"
] =
$doc
->title .
" ("
. $oa->getLabel() .
")"
;
44
45
$p = explode(
'&'
, $oa->waction);
46
$ta
[
"exec_action"
] = current($p);
47
next($p);
48
if
($oa->getOption(
"batchfolder"
) ==
"yes"
) $tp = array(
49
"wshfldid"
=>
$doc
->id
50
);
51
else
$tp = array(
52
"id"
=>
$doc
->id
53
);
54
while
(list($k, $v) = each($p)) {
55
list($var,
$value
) = explode(
"="
, $v);
56
$tp[$var] =
$value
;
57
}
58
$ta
[
"exec_idvar"
] = implode(
"\n"
, array_keys($tp));
59
$ta
[
"exec_valuevar"
] = implode(
"\n"
, $tp);
60
61
$url =
""
;
62
foreach
(
$ta
as $k => $v) {
63
$url.=
"&$k="
. urlencode($v);
64
}
65
$taction[$ka][
"url"
] = sprintf(
"%s&app=GENERIC&action=GENERIC_EDIT&classid=EXEC%s"
,
$action
->GetParam(
"CORE_STANDURL"
) , $url);
66
}
67
$action
->lay->setBlockData(
"ACTIONS"
, $taction);
68
}
69
}
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase