Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Action Class Reference
+ Inheritance diagram for Action:
+ Collaboration diagram for Action:

Public Member Functions

 Set ($name, &$parent)
 
 completeSet (&$parent)
 
 complete ()
 
 Read ($k, $d="")
 
 Register ($k, $v)
 
 Unregister ($k)
 
 actRead ($k, $d="")
 
 actRegister ($k, $v)
 
 actUnregister ($k)
 
 PreInsert ()
 
 PreUpdate ()
 
 getParam ($name, $def="")
 
 setParamU ($name, $val)
 
 getImageUrl ($name, $detectstyle=true, $size=null)
 
 getFilteredImageUrl ($name)
 
 getImageFile ($name)
 
 addLogMsg ($msg, $cut=0)
 
 addWarningMsg ($msg)
 
 addActionDone ($actdone, $arg="")
 
 clearActionDone ()
 
 getActionDone (&$actdone, &$arg)
 
 getIcon ($name, $text, $width="", $height="")
 
 getLayoutFile ($layname)
 
 exists ($name, $idapp, $id_func=0)
 
 hasPermission ($acl_name="", $app_name="", $strict=false)
 
 canExecute ($actname, $appid="")
 
 getAcl ($actname, $appid="")
 
 execute ()
 
 exitError ($texterr, $exit=true, $code="")
 
 exitForbidden ($texterr)
 
 clearError ()
 
 Init ($app, $action_desc, $update=false)
 
 debug ($msg)
 
 info ($msg)
 
 warning ($msg)
 
 error ($msg)
 
 fatal ($msg)
 
 appInstalled ($appname)
 
 getAvailableApplication ()
 
- Public Member Functions inherited from DbObj
 __construct ($dbaccess= '', $id= '', $res= '', $dbid=0)
 
 Select ($id)
 
 getValues ()
 
 affectColumn ($fields, $reset=true)
 
 affect ($array, $more=false, $reset=true)
 
 isAffected ()
 
 Complete ()
 
 preInsert ()
 
 postInsert ()
 
 preUpdate ()
 
 postUpdate ()
 
 preDelete ()
 
 postDelete ()
 
 preSelect ($id)
 
 postSelect ($id)
 
 Add ($nopost=false, $nopre=false)
 
 modify ($nopost=false, $sfields="", $nopre=false)
 
 delete ($nopost=false)
 
 Adds (&$tcopy, $nopost=false)
 
 lw ($prop)
 
 CloseConnect ()
 
 Create ($nopost=false)
 
 postInit ()
 
 init_dbid ()
 
 exec_query ($sql, $lvl=0, $prepare=false)
 
 numrows ()
 
 fetch_array ($c, $type=PGSQL_ASSOC)
 
 update ()
 
 setError ($moreerr= '')
 
 autoUpdate ()
 
 savePoint ($point)
 
 lockPoint ($exclusiveLock, $exclusiveLockPrefix= '')
 
 setMasterLock ($useLock)
 
 rollbackPoint ($point)
 
 commitPoint ($point)
 

Static Public Member Functions

static getArgument ($k, $def= '')
 
static text ($code)
 

Data Fields

const ACCESS_FREE = ""
 
 $fields
 
 $id
 
 $id_application
 
 $name
 
 $short_name
 
 $long_name
 
 $script
 
 $function
 
 $layout
 
 $available
 
 $acl
 
 $grant_level = 0
 
 $openaccess
 
 $root
 
 $icon
 
 $toc
 
 $father
 
 $toc_order
 
 $id_fields
 
 $idx
 
 $dbtable = "action"
 
 $sqlcreate
 
 $parent
 
 $def
 
 $criterias
 
 $user
 
 $session
 
 $url
 
 $auth
 
 $level
 
 $lay
 
- Data Fields inherited from DbObj
 $dbid = - 1
 
 $dbaccess = ''
 
 $fields
 
 $dbtable = ''
 
 $id_fields
 
 $criterias = array()
 
 $sup_fields = array()
 
 $sup_where = array()
 
 $sup_tables = array()
 
 $fulltextfields = array()
 
 $order_by = ""
 
 $isset = false
 
 $msg_err = ''
 
 $err_code = ''
 
 $res = ''
 
 $debug = false
 
 $sqlcreate
 
 $sqlinit
 
 $log
 

Additional Inherited Members

- Static Public Attributes inherited from DbObj
static $savepoint = array()
 
static $lockpoint = array()
 
static $sqlStrict = null
 
- Protected Member Functions inherited from DbObj
 tryCreate ()
 

Detailed Description

manage Action Action is part of Application

See Also
Application

Definition at line 24 of file Class.Action.php.

Member Function Documentation

actRead (   $k,
  $d = "" 
)

Definition at line 269 of file Class.Action.php.

+ Here is the call graph for this function:

actRegister (   $k,
  $v 
)

Definition at line 274 of file Class.Action.php.

+ Here is the call graph for this function:

actUnregister (   $k)

Definition at line 279 of file Class.Action.php.

+ Here is the call graph for this function:

addActionDone (   $actdone,
  $arg = "" 
)

store action done to be use in refreshing main window interface

Parameters
string$actdonethe code of action
string$argthe argument of action

Definition at line 385 of file Class.Action.php.

addLogMsg (   $msg,
  $cut = 0 
)

Definition at line 365 of file Class.Action.php.

addWarningMsg (   $msg)

Definition at line 372 of file Class.Action.php.

appInstalled (   $appname)

verify if an application is really installed in localhost

Parameters
string$appnameapplication reference name
Returns
bool true if application is installed

Definition at line 848 of file Class.Action.php.

canExecute (   $actname,
  $appid = "" 
)

Check if the current user can execute the specified action.

Api:
verify if an action can be executed
Parameters
string$actnameaction name
string$appidapplication name or application id (default is the current application)
Returns
string with error message if the user cannot execute the given action, or an empty string if the user can execute the action

Definition at line 485 of file Class.Action.php.

+ Here is the call graph for this function:

clearActionDone ( )

clear action done to be use in refreshing main window interface

Definition at line 399 of file Class.Action.php.

clearError ( )

unregister FT error

Definition at line 674 of file Class.Action.php.

+ Here is the call graph for this function:

complete ( )

Definition at line 224 of file Class.Action.php.

completeSet ( $parent)

add Application parent

Parameters
Application$parent
Returns
string

Definition at line 203 of file Class.Action.php.

debug (   $msg)

log with debug level

See Also
Log
Parameters
string$msgmessage text

Definition at line 799 of file Class.Action.php.

error (   $msg)

log with error level

See Also
Log
Parameters
string$msgmessage text

Definition at line 829 of file Class.Action.php.

execute ( )

execute the action test if current user can execute it

Exceptions
Dcp\Core\Exception
Dcp\Exception
Returns
string the composed associated layout

Definition at line 531 of file Class.Action.php.

+ Here is the call graph for this function:

exists (   $name,
  $idapp,
  $id_func = 0 
)

Verify if action exists

Parameters
string$nameaction name
int$idappapplication numeric identifier
int$id_funcaction identifier - when test itself @ internal purpose
Returns
bool true if exists

Definition at line 449 of file Class.Action.php.

exitError (   $texterr,
  $exit = true,
  $code = "" 
)

display error to user and stop execution

Parameters
string$texterrthe error message
bool$exitif false , no exit are performed
string$codeerror code (ref to error log)
Exceptions
\Dcp\Core\Exception
Api:
abort action execution

Definition at line 615 of file Class.Action.php.

+ Here is the call graph for this function:

exitForbidden (   $texterr)

Definition at line 660 of file Class.Action.php.

+ Here is the call graph for this function:

fatal (   $msg)

log with fatal level

See Also
Log
Parameters
string$msgmessage text

Definition at line 839 of file Class.Action.php.

getAcl (   $actname,
  $appid = "" 
)

return acl name for an action

Parameters
string$actnameaction name
string$appidapplication id (default itself)
Returns
string (false if not found)

Definition at line 511 of file Class.Action.php.

getActionDone ( $actdone,
$arg 
)

get action code and argument for action code done to be use in refreshing main window interface

Parameters
string&$actdonethe code of action
string&$argthe argument of action

Definition at line 410 of file Class.Action.php.

static getArgument (   $k,
  $def = '' 
)
static

retrieve the value of an argument fot the action in web mode the value comes from http variable and in shell mode comes from args variable

Parameters
string$kthe argument name
mixed$defdefault value if no argument is not set
Returns
mixed|string

Definition at line 775 of file Class.Action.php.

+ Here is the call graph for this function:

getAvailableApplication ( )

return available Applications for current user

Returns
array

Definition at line 859 of file Class.Action.php.

+ Here is the call graph for this function:

getFilteredImageUrl (   $name)

Definition at line 349 of file Class.Action.php.

getIcon (   $name,
  $text,
  $width = "",
  $height = "" 
)

get image HTML fragment

Parameters
string$nameicon filename
string$textalternative text
string$widthicon width
string$heighticon Height
Returns
string HTML fragment image tag

Definition at line 423 of file Class.Action.php.

+ Here is the call graph for this function:

getImageFile (   $name)

Definition at line 357 of file Class.Action.php.

getImageUrl (   $name,
  $detectstyle = true,
  $size = null 
)

get image url of an application shorcut to Application::getImageUrl

See Also
Application::getImageLink
Deprecated:
use Application::getImageLink instead
Parameters
string$nameimage filename
bool$detectstyleto use theme image instead of original
int$sizeto use image with another width (in pixel) - null is original size
Returns
string url to download image

Definition at line 340 of file Class.Action.php.

+ Here is the call graph for this function:

getLayoutFile (   $layname)

get file path layout from layout name

See Also
Application::getLayoutFile
Parameters
$layname
Returns
string

Definition at line 437 of file Class.Action.php.

getParam (   $name,
  $def = "" 
)

get parameter value of action'sapplication shorcut to Application::getParam

Parameters
string$name
string$defdefault value if not set
Returns
string

Definition at line 306 of file Class.Action.php.

hasPermission (   $acl_name = "",
  $app_name = "",
  $strict = false 
)

Verify acl grant for current user

Parameters
string$acl_nameacl name
string$app_nameapp name to specify another appname (else current app name)
bool$strictto not use substitute account information
Returns
bool true if current user has acl privilege

Definition at line 472 of file Class.Action.php.

info (   $msg)

log with info level

See Also
Log
Parameters
string$msgmessage text

Definition at line 809 of file Class.Action.php.

Init (   $app,
  $action_desc,
  $update = false 
)

record/update action

Parameters
Application$appapplication
array$action_descaction description
bool$updateset to true if update only
Returns
string none

PhpUnusedLocalVariableInspection

Definition at line 686 of file Class.Action.php.

PreInsert ( )

Definition at line 284 of file Class.Action.php.

+ Here is the call graph for this function:

PreUpdate ( )

Definition at line 292 of file Class.Action.php.

Read (   $k,
  $d = "" 
)

read a session variable

Parameters
string$kkey variable
string$ddefault value
Returns
string

Definition at line 234 of file Class.Action.php.

Register (   $k,
  $v 
)

record a session variable

Parameters
string$kkey variable
string$vvalue to set
Returns
bool return true if ok

Definition at line 248 of file Class.Action.php.

Set (   $name,
$parent 
)

initialize Action object need set action to execute it

$core->Set("CORE", $CoreNull); // init core application from nothing
$core->session = new Session();
$core->session->set();
$one = new Application();
$one->set("ONEFAM", $core, $core->session);// init ONEFAM application from core
$myAct=new Action();
$myAct->set("ONEFAM_LIST", $one);
print $myAct->execute();
Parameters
string$nameaction name reference
Application$parentapplication object where action depends
Exceptions
Dcp\Core\Exceptionif action not exists

Definition at line 168 of file Class.Action.php.

setParamU (   $name,
  $val 
)

set a new value for a user parameter

See Also
ParameterManager::setUserApplicationParameter
Parameters
string$nameparameter key
string$valnew value for the parameter
Returns
string error message if not succeed else empty string

Definition at line 320 of file Class.Action.php.

static text (   $code)
static

translate text use gettext catalog

Parameters
string$codetext to translate
Returns
string

Definition at line 788 of file Class.Action.php.

Unregister (   $k)

remove variable from current session

Parameters
string$kkey variable
Returns
bool return true if ok

Definition at line 261 of file Class.Action.php.

warning (   $msg)

log with warning level

See Also
Log
Parameters
string$msgmessage text

Definition at line 819 of file Class.Action.php.

Field Documentation

$acl

Definition at line 61 of file Class.Action.php.

$auth

Definition at line 139 of file Class.Action.php.

$available

Definition at line 60 of file Class.Action.php.

$criterias
Initial value:
= array(
"name" => array(
"libelle" => "Nom",
"type" => "TXT"
)
)

Definition at line 116 of file Class.Action.php.

$dbtable = "action"

Definition at line 80 of file Class.Action.php.

$def
Initial value:
= array(
"criteria" => "",
"order_by" => "name"
)

Definition at line 111 of file Class.Action.php.

$father

Definition at line 67 of file Class.Action.php.

$fields
Initial value:
= array(
"id",
"id_application",
"name",
"short_name",
"long_name",
"script",
"function",
"layout",
"available",
"acl",
"grant_level",
"openaccess",
"root",
"icon",
"toc",
"father",
"toc_order"
)

Definition at line 30 of file Class.Action.php.

$function

Definition at line 58 of file Class.Action.php.

$grant_level = 0

Definition at line 62 of file Class.Action.php.

$icon

Definition at line 65 of file Class.Action.php.

$id

Definition at line 49 of file Class.Action.php.

$id_application

Definition at line 50 of file Class.Action.php.

$id_fields
Initial value:
= array(
"id"
)

Definition at line 70 of file Class.Action.php.

$idx
Initial value:
= array(
"id",
"id_application",
"name"
)

Definition at line 74 of file Class.Action.php.

$lay

Definition at line 147 of file Class.Action.php.

$layout

Definition at line 59 of file Class.Action.php.

$level

Definition at line 143 of file Class.Action.php.

$long_name

Definition at line 53 of file Class.Action.php.

$name

Definition at line 51 of file Class.Action.php.

$openaccess

Definition at line 63 of file Class.Action.php.

$parent

Definition at line 109 of file Class.Action.php.

$root

Definition at line 64 of file Class.Action.php.

$script

Definition at line 54 of file Class.Action.php.

Definition at line 131 of file Class.Action.php.

$short_name

Definition at line 52 of file Class.Action.php.

$sqlcreate
Initial value:
= '
create table action (id int not null,
primary key (id),
id_application int not null,
name text not null,
short_name text ,
long_name text,
script text,
function text,
layout text ,
available char,
acl text,
grant_level int,
openaccess char,
root char,
icon text,
toc char,
father int ,
toc_order int);
create index action_idx1 on action(id);
create index action_idx2 on action(id_application);
create index action_idx3 on action(name);
create sequence SEQ_ID_ACTION;
'

Definition at line 82 of file Class.Action.php.

$toc

Definition at line 66 of file Class.Action.php.

$toc_order

Definition at line 68 of file Class.Action.php.

$url

Definition at line 135 of file Class.Action.php.

$user

Definition at line 126 of file Class.Action.php.

const ACCESS_FREE = ""

fake ACL to allow an action to be access free without its application being access_free

Definition at line 29 of file Class.Action.php.


The documentation for this class was generated from the following file:
← centre documentaire © anakeen