Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
actionlist.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  * Display actions paramters
9  *
10  * @author Anakeen 2000
11  * @version $Id: actionlist.php,v 1.5 2003/08/18 15:46:41 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage APPMNG
15  */
16 /**
17  */
18 
19 include_once ("Class.TableLayout.php");
20 include_once ("Class.QueryDb.php");
21 include_once ("Class.QueryGen.php");
22 include_once ("Class.Action.php");
23 include_once ("Class.SubForm.php");
24 // -----------------------------------
25 function actionlist(&$action)
26 {
27  // -----------------------------------
28  // Set the globals elements
29  $baseurl = $action->GetParam("CORE_BASEURL");
30  $standurl = $action->GetParam("CORE_STANDURL");
31 
32  $action->lay->set("ACTION_CHG", "ACTION_APPL_CHG");
33  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/subwindow.js");
34 
35  $err = $action->Read("err_add_parameter");
36  if ($err != "") {
37  $action->lay->Set("ERR_MSG", $err);
38  $action->Unregister("err_add_parameter");
39  } else {
40  $action->lay->Set("ERR_MSG", "");
41  }
42  // select the first user if not set
43  $appl_id = $action->Read("action_appl_id");
44  $action->log->debug("appl_id : $appl_id");
45  if ($appl_id == "") $appl_id = 0;
46  // affect the select form elements
47  $query = new QueryDb("", "Application");
48  $query->AddQuery("(objectclass != 'Y' ) OR ( objectclass isnull)");
49  $query->order_by = "name";
50  $applist = $query->Query();
51  unset($query);
52  $tab = array();
53  $appl_sel = "";
54  $i = 0;
55  reset($applist);
56  while (list($k, $v) = each($applist)) {
57 
58  if ($appl_id == 0) {
59  $appl_id = $v->id;
60  $action->Register("action_appl_id", $appl_id);
61  }
62  $tab[$i]["text"] = $v->name;
63  $tab[$i]["id"] = $v->id;
64  if ($appl_id == $v->id) {
65  $appl_sel = $v;
66  $tab[$i]["selected"] = "selected";
67  } else {
68  $tab[$i]["selected"] = "";
69  }
70  $i++;
71  }
72 
73  $action->lay->SetBlockData("SELAPPLI", $tab);
74  $action->parent->AddJsRef("change_acl.js");
75  // Set the table element
76  $query = new QueryGen("", "Action", $action);
77 
78  $query->AddQuery("id_application=$appl_id");
79  $query->slice = pow(2, 31);
80  $query->order_by = "name";
81 
82  $query->table->headsortfields = array(
83  "name" => "name"
84  );
85  $query->table->headcontent = array(
86  "name" => $action->text("name")
87  );
88  $query->Query();
89 
90  $query->table->fields = array(
91  "id",
92  "name",
93  "openaccess",
94  "short_name",
95  "script",
96  "layout",
97  "available",
98  "acl",
99  "root",
100  "toc",
101  "toc_order"
102  );
103 
104  $action->lay->Set("TABLE", $query->table->Set());
105 }
106 ?>
← centre documentaire © anakeen - published under CC License - Dynacase