Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
applist.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: $
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.QueryGen.php");
21 include_once ("Class.SubForm.php");
22 include_once ("Class.Param.php");
23 // -----------------------------------
24 function applist(&$action)
25 {
26  // -----------------------------------
27  // Set the globals elements
28  $baseurl = $action->GetParam("CORE_BASEURL");
29  $standurl = $action->GetParam("CORE_STANDURL");
30 
31  $err = $action->Read("USERS_ERROR");
32  if ($err != "") {
33  $action->lay->Set("ERR_MSG", $err);
34  $action->Unregister("USERS_ERROR");
35  } else {
36  $action->lay->Set("ERR_MSG", "");
37  }
38  // Set the form element
39  $form = new SubForm("edit", 350, 330, $standurl . "app=APPMNG&action=APP_MOD", $standurl . "app=APPMNG&action=APP_EDIT");
40  $form->SetParam("id", "-1");
41  $form->SetParam("name");
42  $form->SetParam("short_name");
43  $form->SetParam("description");
44  $form->SetParam("available");
45  $form->SetParam("displayable");
46  $form->SetParam("access_free");
47  $form->SetParam("ssl");
48  $form->SetParam("machine");
49 
50  $form->SetKey("id");
51 
52  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/subwindow.js");
53  $action->parent->AddJsCode($form->GetMainJs());
54  $action->lay->set("MAINFORM", $form->GetMainForm());
55 
56  if ($action->HasPermission("ADMIN")) {
57  $add_icon = new Layout($action->GetLayoutFile("add_icon.xml") , $action);
58  $add_icon->set("JSCALL", $form->GetEmptyJsMainCall());
59  $action->lay->set("ADD_ICON", $add_icon->gen());
60  } else {
61  $action->lay->set("ADD_ICON", "");
62  }
63  // Set the table element
64  $query = new QueryGen("", "Application", $action);
65  $query->addQuery("(objectclass != 'Y' ) OR ( objectclass isnull)");
66  $query->slice = 100;
67  $query->order_by = 'name';
68  $query->Query();
69  // Affect the modif icons
70  foreach ($query->table->array as $k => $v) {
71 
72  $id = $query->table->array[$k]["id"];
73  $p = new Param($action->dbaccess, array(
74  "VERSION",
75  PARAM_APP,
76  $id
77  ));
78  $version = (isset($p->val) ? $p->val : "");
79 
80  $query->table->array[$k]["update"] = "";
81  $query->table->array[$k]["edit"] = "";
82  $query->table->array[$k]["delete"] = "";
83  $query->table->array[$k]["version"] = $version;
84  $query->table->array[$k]["description"] = $action->text($query->table->array[$k]["description"]);
85  $query->table->array[$k]["appicon"] = $action->getImageUrl($query->table->array[$k]["icon"]);
86  }
87 
88  $query->table->fields = array(
89  "id",
90  "update",
91  "edit",
92  "delete",
93  "name",
94  "appicon",
95  "version",
96  "description",
97  "available",
98  "access_free",
99  "displayable"
100  );
101 
102  $action->lay->Set("TABLE", $query->table->Set());
103  $action->lay->Set("IMGHELP", $action->GetImageUrl("help.gif"));
104  $action->lay->Set("IMGPRINT", $action->GetImageUrl("print.gif"));
105  $action->lay->Set("IMGEDIT", $action->GetImageUrl("edit.gif"));
106  $action->lay->Set("IMGSEARCH", $action->GetImageUrl("search.gif"));
107  $action->lay->Set("APPLIST", _("Application list"));
108 }
109 ?>
← centre documentaire © anakeen - published under CC License - Dynacase