Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
set_param.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  * set applicative parameter value
9  *
10  * analyze sub-directories presents in STYLE directory
11  * @author Anakeen 2004
12  * @version $Id: set_param.php,v 1.3 2006/04/28 14:31:49 eric Exp $
13  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
14  * @package FDL
15  * @subpackage WSH
16  */
17 /**
18  */
19 include_once ("Class.QueryDb.php");
20 
21 $parname = GetHttpVars("param"); // parameter name
22 $parval = GetHttpVars("value"); // parameter value
23 $paruser = GetHttpVars("userid"); // parameter user id (option)
24 $parapp = GetHttpVars("appname"); // parameter app name (option)
25 if ($parapp != "") {
26  $appid = $core->GetIdFromName($parapp);
27 }
28 
29 $param = new QueryDb($dbaccess, "Param");
30 $param->AddQuery("name='$parname'");
31 if ($appid) $param->AddQuery("appid=$appid");
32 $list = $param->Query(0, 2);
33 if ($param->nb == 0) {
34  printf(_("Attribute %s not found\n") , $parname);
35 } elseif ($param->nb > 1) {
36  printf(_("Attribute %s found is not alone\nMust precise request with appname arguments\n") , $parname);
37 } else {
38  $p = $list[0];
39  $p->val = $parval;
40  $err = $p->modify();
41  if ($err != "") printf(_("Attribute %s not modified : %s\n") , $parname, $err);
42  else printf(_("Attribute %s modified to %s") , $parname, $parval);
43 }
44 ?>
← centre documentaire © anakeen - published under CC License - Dynacase