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