Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
change_action.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Change an attribute of an WHAT Action
8  *
9  *
10  * @param string $appname internal name of the application
11  * @param string $actname internal name of the action
12  * @param string $attribute internal name of the field of the action
13  * @param string $value new value for the attribute
14  * @author Anakeen
15  * @version $Id: change_action.php,v 1.2 2003/08/18 15:46:41 eric Exp $
16  * @package FDL
17  * @subpackage WSH
18  */
19 /**
20  */
21 // ---------------------------------------------------------------
22 // $Id: change_action.php,v 1.2 2003/08/18 15:46:41 eric Exp $
23 // $Source: /home/cvsroot/anakeen/freedom/core/Api/change_action.php,v $
24 // ---------------------------------------------------------------
25 include_once ("Class.Application.php");
26 
27 $usage = new ApiUsage();
28 $usage->setDefinitionText("Change an attribute of an WHAT Action");
29 $appname = $usage->addRequiredParameter("appname", "application name");
30 $actionname = $usage->addRequiredParameter("actname", "action name");
31 $attribute = $usage->addRequiredParameter("attribute", "attribute name");
32 $value = $usage->addOptionalParameter("value", "value to set", null, "");
33 $usage->verify();
34 
35 $app = new Application();
36 $null = "";
37 $app->Set($appname, $null);
38 if ($app->id > 0) {
39  $action = new Action($app->dbaccess);
40  $action->Set($actionname, $app);
41  if ($action->id > 0) {
42  reset($action->fields);
43  foreach ($action->fields as $k => $v) {
44  if ($v == $attribute) {
45  $action->$attribute = $value;
46  $action->Modify();
47  return true;
48  }
49  }
50  }
51 }
52 return false;
53 ?>
$appname
global $action
$attribute
$app
$actionname
$null
$usage
$value
Verify arguments for wsh programs.
← centre documentaire © anakeen