Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
app_edit.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: app_edit.php,v 1.6 2005/07/08 15:29:51 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.SubForm.php");
20 include_once ("Class.Application.php");
21 // -----------------------------------
22 function app_edit(&$action)
23 {
24  // -----------------------------------
25  // Get all the params
26  global $_POST;
27  $id = GetHttpVars("id");
28 
29  if ($id == "") {
30  $action->lay->Set("name", "");
31  $action->lay->Set("short_name", "");
32  $action->lay->Set("description", "");
33  $action->lay->Set("passwd", "");
34  $action->lay->Set("id", "");
35  $action->lay->Set("TITRE", $action->text("titlecreate"));
36  $action->lay->Set("BUTTONTYPE", $action->text("butcreate"));
37  if ($action->HasPermission("ADMIN")) {
38  $seldom = 1;
39  } else if ($action->HasPermission("DOMAIN_MASTER")) {
40  $seldom = $action->AppCour->iddomain;
41  } else {
42  $action->info("Not Allowed Access Attempt");
43  }
44  } else {
45  $AppCour = new Application($action->GetParam("CORE_DB") , $id);
46  $action->lay->Set("id", $id);
47  $action->lay->Set("name", $AppCour->name);
48  $action->lay->Set("short_name", $AppCour->short_name);
49  $action->lay->Set("description", $AppCour->description);
50  $action->lay->Set("passwd", "");
51  $action->lay->Set("TITRE", $action->text("titlemodify"));
52  $action->lay->Set("BUTTONTYPE", $action->text("butmodify"));
53  }
54 
55  $action->lay->Set("access_free", $AppCour->access_free);
56 
57  $tab = array();
58  if ($AppCour->ssl == 'Y') {
59  $tab[0]["selected"] = "selected";
60  $tab[1]["selected"] = "";
61  } else {
62  $tab[0]["selected"] = "";
63  $tab[1]["selected"] = "selected";
64  }
65  $tab[0]["ssl"] = "Y";
66  $tab[1]["ssl"] = "N";
67 
68  $action->lay->SetBlockData("SELECTSSL", $tab);
69 
70  unset($tab);
71  $tab = array();
72  if ($AppCour->available == 'Y') {
73  $tab[0]["selected"] = "selected";
74  $tab[1]["selected"] = "";
75  } else {
76  $tab[0]["selected"] = "";
77  $tab[1]["selected"] = "selected";
78  }
79  $tab[0]["available"] = "Y";
80  $tab[1]["available"] = "N";
81 
82  $action->lay->SetBlockData("SELECTAVAILABLE", $tab);
83 
84  unset($tab);
85  $tab = array();
86  if ($AppCour->displayable == 'Y') {
87  $tab[0]["selected"] = "selected";
88  $tab[1]["selected"] = "";
89  } else {
90  $tab[0]["selected"] = "";
91  $tab[1]["selected"] = "selected";
92  }
93  $tab[0]["displayable"] = "Y";
94  $tab[1]["displayable"] = "N";
95 
96  $action->lay->SetBlockData("SELECTDISPLAYABLE", $tab);
97 
98  $form = new SubForm("edit");
99  $form->SetParam("name");
100  $form->SetParam("short_name");
101  $form->SetParam("description");
102  $form->SetParam("available", "", "sel");
103  $form->SetParam("displayable", "", "sel");
104  $form->SetParam("access_free", "", "sel");
105  $form->SetParam("id");
106  $action->parent->AddJsCode($form->GetSubJs());
107  $control = $action->GetLayoutFile("app_control.js");
108  $lay = new Layout($control);
109  $action->parent->AddJsCode($lay->gen());
110 }
111 ?>
← centre documentaire © anakeen - published under CC License - Dynacase