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
param_delete.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: param_delete.php,v 1.7 2006/06/22 16:19:07 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
// $Id: param_delete.php,v 1.7 2006/06/22 16:19:07 eric Exp $
20
// $Source: /home/cvsroot/anakeen/freedom/core/Action/Appmng/param_delete.php,v $
21
// ---------------------------------------------------------------
22
include_once (
"Class.Param.php"
);
23
// -----------------------------------
24
function
param_delete
(&
$action
)
25
{
26
// -----------------------------------
27
$name
=
GetHttpVars
(
"id"
);
28
$appid =
GetHttpVars
(
"appid"
);
29
$atype =
GetHttpVars
(
"atype"
,
PARAM_APP
);
30
31
$parametre =
new
Param
(
$action
->dbaccess, array(
32
$name
,
33
$atype,
34
$appid
35
));
36
if
($parametre->isAffected()) {
37
$action
->log->info(_(
"Remove parameter"
) . $parametre->name);
38
$parametre->Delete();
39
}
else
$action
->addLogMsg(sprintf(_(
"the '%s' parameter cannot be removed"
) ,
$name
));
40
// reopen a new session to update parameters cache
41
if
($atype[0] ==
PARAM_USER
) {
42
$action
->parent->session->close();
43
}
else
{
44
$action
->parent->session->closeAll();
45
}
46
47
redirect(
$action
,
"APPMNG"
,
$action
->Read(
"PARAM_ACT"
,
"PARAM_CULIST"
));
48
}
49
// -----------------------------------
50
function
param_udelete
(&
$action
)
51
{
52
// -----------------------------------
53
$atype =
GetHttpVars
(
"atype"
,
PARAM_APP
);
54
$appid =
GetHttpVars
(
"appid"
);
55
if
($atype[0] !=
PARAM_USER
)
$action
->exitError(_(
"only user parameters can be deleted with its action"
));
56
if
(substr($atype, 1) !=
$action
->user->id)
$action
->exitError(_(
"only current user parameters can be deleted with its action"
));
57
58
param_delete
(&
$action
);
59
}
60
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase