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

Public Member Functions

 __construct ($dbaccess= '', $id= '', $res= '', $dbid=0)
 
 set ($name, &$parent, $session="", $autoinit=false, $verifyAvailable=true)
 
 complete ()
 
 setSession (&$session)
 
 preInsert ()
 
 preUpdate ()
 
 exists ($app_name, $id_application=0)
 
 addRessourceRef ($type, $ref, $needparse, $packName)
 
 getCssLink ($ref, $needparse=null, $packName= '')
 
 getJsLink ($ref, $needparse=false, $packName= '')
 
 addCssRef ($ref, $needparse=null, $packName= '')
 
 getCssRef ()
 
 addJsRef ($ref, $needparse=false, $packName= '')
 
 getJsRef ()
 
 addJsCode ($code)
 
 getJsCode ()
 
 addCssCode ($code)
 
 getCssCode ()
 
 addLogMsg ($code, $cut=0)
 
 addWarningMsg ($code)
 
 getLogMsg ()
 
 clearLogMsg ()
 
 getWarningMsg ()
 
 clearWarningMsg ()
 
 setAdminMode ($enable=true)
 
 isInAdminMode ()
 
 hasPermission ($acl_name, $app_name="", $strict=false)
 
 initStyle ($init=true, $useStyle= '')
 
 setLayoutVars ($lay)
 
 getRootApp ()
 
 getImageFile ($img)
 
 getImageLink ($img, $detectstyle=true, $size=null)
 
 getImageUrl ($img, $detectstyle=true, $size=null)
 
 imageFilterColor ($image, $fcol, $newcol, $out=null)
 
 getFilteredImageUrl ($imgf)
 
 getLayoutFile ($layname)
 
 OldGetLayoutFile ($layname)
 
 setParam ($key, $val)
 
 setParamU ($key, $val)
 
 setParamDef ($key, $val)
 
 setVolatileParam ($key, $val)
 
 getParam ($key, $default="")
 
 initAllParam ($tparam, $update=false)
 
 getAllParam ()
 
 initApp ($name, $update=false)
 
 updateApp ()
 
 updateAllApp ()
 
 deleteApp ()
 
 updateUserAcl ($iduser)
 
 getIdFromName ($name)
 
 hasParent ()
 
- 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 text ($code)
 

Data Fields

 $fields
 
 $id
 
 $name
 
 $short_name
 
 $description
 
 $access_free
 
 $available
 
 $icon
 
 $displayable
 
 $with_frame
 
 $childof
 
 $objectclass
 
 $ssl
 
 $machine
 
 $iorder
 
 $tag
 
 $id_fields
 
 $rootdir = ''
 
 $fulltextfields
 
 $sqlcreate
 
 $dbtable = "application"
 
 $def
 
 $criterias
 
 $parent = null
 
 $session = null
 
 $user = null
 
 $style
 
 $param
 
 $permission = null
 
 $log = null
 
 $jsref = array()
 
 $jscode = array()
 
 $logmsg = array()
 
 $cssref = array()
 
 $csscode = array()
 
 $noimage = "CORE/Images/core-noimage.png"
 
- 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
 

Protected Attributes

 $adminMode = false
 

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

Application managing

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

Constructor & Destructor Documentation

__construct (   $dbaccess = '',
  $id = '',
  $res = '',
  $dbid = 0 
)

Application constructor.

Parameters
string$dbaccess
string|string[]$id
string | array$res
int$dbid

Definition at line 174 of file Class.Application.php.

Member Function Documentation

addCssCode (   $code)

Add a CSS code in an action Use this method to add a CSS in an action that use the zone [CSS:REF] and the template engine

Api:
Add a CSS code in an action
Parameters
string$codecode to add
Returns
void

Definition at line 680 of file Class.Application.php.

+ Here is the call graph for this function:

addCssRef (   $ref,
  $needparse = null,
  $packName = '' 
)

Add a CSS in an action

Use this method to add a CSS in an action that use the zone [CSS:REF] and the template engine

Api:
Add a CSS in an action
Parameters
string$refpath, or URL, or filename (if in the current application), or APP:filename
bool$needparseif true will be parsed by the template engine (false by default)
string$packNameuse it to pack all the ref with the same packName into a single file
Exceptions
Dcp\Style\Exception
Returns
string the path of the added ref or "" if the ref is not valid

Definition at line 565 of file Class.Application.php.

addJsCode (   $code)

Add a JS code in an action Use this method to add a JS in an action that use the zone [JS:REF] and the template engine (beware use protective ; because all the addJsCode are concatened)

Api:
Add a JS code in an action
Parameters
string$codecode to add
Returns
void

Definition at line 648 of file Class.Application.php.

+ Here is the call graph for this function:

addJsRef (   $ref,
  $needparse = false,
  $packName = '' 
)

Add a JS in an action

Use this method to add a JS in an action that use the zone [JS:REF] and the template engine

Api:
Add a JS in an action
Parameters
string$refpath to a js, or URL to a js, or js file name (if in the current application), or APP:jsfilename
bool$needparseif true will be parsed by the template engine (false by default)
string$packNameuse it to pack all the ref with the same packName into a single file
Returns
string the path of the added ref or "" if the ref is not valid

Definition at line 619 of file Class.Application.php.

addLogMsg (   $code,
  $cut = 0 
)

Add message to log (syslog) The message is also displayed in the console of the web interface

Parameters
string$codemessage to add to log
int$cuttruncate message longer than this length (set to <= 0 to not truncate the message)(default is 0).

Definition at line 709 of file Class.Application.php.

+ Here is the call graph for this function:

addRessourceRef (   $type,
  $ref,
  $needparse,
  $packName 
)

Add a resource (JS/CSS) to the page

Parameters
string$type'js' or 'css'
string$refthe resource reference
boolean$needparseshould the resource be parsed (default false)
string$packName
Returns
string resource location

Definition at line 408 of file Class.Application.php.

+ Here is the call graph for this function:

addWarningMsg (   $code)

send a message to the user interface

Parameters
string$codemessage
Returns
void

Definition at line 739 of file Class.Application.php.

+ Here is the call graph for this function:

clearLogMsg ( )

Definition at line 764 of file Class.Application.php.

clearWarningMsg ( )

Definition at line 779 of file Class.Application.php.

complete ( )

Definition at line 277 of file Class.Application.php.

deleteApp ( )

delete application database application reference are destroyed but application files are not removed from server

Returns
string

Definition at line 1424 of file Class.Application.php.

exists (   $app_name,
  $id_application = 0 
)

Verify an application name exists

Parameters
string$app_nameapplication reference name
int$id_applicationoptional numeric id to verify if not itself
Returns
bool

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

getAllParam ( )

get all parameters values indexed by name

Returns
array all paramters values

Definition at line 1230 of file Class.Application.php.

+ Here is the call graph for this function:

getCssCode ( )

Get the current CSS code of the current action

Returns
string[]

Definition at line 694 of file Class.Application.php.

+ Here is the call graph for this function:

getCssLink (   $ref,
  $needparse = null,
  $packName = '' 
)

Get dynacase CSS link

Api:
Get the src of a CSS with dynacase cache
Parameters
string$refpath, or URL, or filename (if in the current application), or APP:filename
bool$needparseif true will be parsed by the template engine (false by default)
string$packNameuse it to pack all the ref with the same packName into a single file
Returns
string the src of the CSS or "" if non existent ref

Definition at line 513 of file Class.Application.php.

+ Here is the call graph for this function:

getCssRef ( )

Get the current CSS ref of the current action

Returns
string[]

Definition at line 598 of file Class.Application.php.

+ Here is the call graph for this function:

getFilteredImageUrl (   $imgf)

Definition at line 1019 of file Class.Application.php.

+ Here is the call graph for this function:

getIdFromName (   $name)

return id from name for an application

Parameters
string$name
Returns
int (0 if not found)

Definition at line 1505 of file Class.Application.php.

getImageFile (   $img)

Definition at line 926 of file Class.Application.php.

+ Here is the call graph for this function:

getImageLink (   $img,
  $detectstyle = true,
  $size = null 
)

get image url of an application can also get another image by search in Images general directory

Api:
get image url of an application
Parameters
string$imgimage 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 942 of file Class.Application.php.

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

get image url of an application can also get another image by search in Images general directory

See Also
Application::getImageLink
Deprecated:
use Application::getImageLink instead
Parameters
string$imgimage 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 1001 of file Class.Application.php.

+ Here is the call graph for this function:

getJsCode ( )

Get the js code of the current action

Returns
string[]

Definition at line 662 of file Class.Application.php.

+ Here is the call graph for this function:

getJsLink (   $ref,
  $needparse = false,
  $packName = '' 
)

Get dynacase JS link

Api:
Get the src of a JS with dynacase cache
Parameters
string$refpath, or URL, or filename (if in the current application), or APP:filename
bool$needparseif true will be parsed by the template engine (false by default)
string$packNameuse it to pack all the ref with the same packName into a single file
Returns
string the src of the JS or "" if ref not exists

Definition at line 538 of file Class.Application.php.

+ Here is the call graph for this function:

getJsRef ( )

Get the js ref array of the current action

Returns
string[] array of location

Definition at line 629 of file Class.Application.php.

+ Here is the call graph for this function:

getLayoutFile (   $layname)

get file path layout from layout name

Parameters
string$layname
Returns
string file path

Definition at line 1057 of file Class.Application.php.

getLogMsg ( )

Get log text messages

Returns
array

Definition at line 759 of file Class.Application.php.

getParam (   $key,
  $default = "" 
)

get parameter value

Parameters
string$key
string$defaultvalue if not set
Returns
string

Definition at line 1191 of file Class.Application.php.

+ Here is the call graph for this function:

getRootApp ( )

Definition at line 917 of file Class.Application.php.

getWarningMsg ( )

Get warning texts

Returns
array

Definition at line 774 of file Class.Application.php.

hasParent ( )

verify if application object has parent application

Returns
bool

Definition at line 1517 of file Class.Application.php.

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

Test permission for current user in current application

Parameters
string$acl_nameacl name to test
string$app_nameapplication if test for other application
bool$strictto not use substitute account information
Returns
bool true if permission granted

Definition at line 816 of file Class.Application.php.

imageFilterColor (   $image,
  $fcol,
  $newcol,
  $out = null 
)

Definition at line 1007 of file Class.Application.php.

+ Here is the call graph for this function:

initAllParam (   $tparam,
  $update = false 
)

create/update application parameter definition

Parameters
array$tparamall parameter definition
bool$update

Definition at line 1208 of file Class.Application.php.

initApp (   $name,
  $update = false 
)

initialize application description from .app and _init.php configuration files

Parameters
string$nameapplication name reference
bool$updateset to true when update application
Returns
bool true if init is done, false if error

Definition at line 1247 of file Class.Application.php.

+ Here is the call graph for this function:

initStyle (   $init = true,
  $useStyle = '' 
)

create style parameters

Parameters
bool$init
string$useStyle

Definition at line 874 of file Class.Application.php.

+ Here is the call graph for this function:

isInAdminMode ( )
Returns
bool true if application is launched from admin context

Definition at line 801 of file Class.Application.php.

+ Here is the call graph for this function:

OldGetLayoutFile (   $layname)

Definition at line 1078 of file Class.Application.php.

preInsert ( )

Definition at line 295 of file Class.Application.php.

+ Here is the call graph for this function:

preUpdate ( )

Definition at line 308 of file Class.Application.php.

set (   $name,
$parent,
  $session = "",
  $autoinit = false,
  $verifyAvailable = true 
)

initialize Application object

Parameters
string$nameapplication name to set
Application | string$parentthe parent object (generally CORE app) : empty string if no parent
string$sessionparent session
bool$autoinitset to true to auto create app if not exists yet
bool$verifyAvailableset to true to not exit when unavailable action
Returns
string error message
Exceptions
\Dcp\Core\Exceptionif application not exists
\Dcp\Db\Exception
$CoreNull = "";
$core = new Application();
$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

Definition at line 202 of file Class.Application.php.

+ Here is the call graph for this function:

setAdminMode (   $enable = true)

mark the application as launched from admin context

Parameters
bool$enabletrue to enable admin mode, false to disable it

Definition at line 790 of file Class.Application.php.

+ Here is the call graph for this function:

setLayoutVars (   $lay)

Definition at line 910 of file Class.Application.php.

+ Here is the call graph for this function:

setParam (   $key,
  $val 
)

affect new value to an application parameter

See Also
ParameterManager to easily manage application parameters
Parameters
string$keyparameter id
string$valparameter value

Definition at line 1094 of file Class.Application.php.

setParamDef (   $key,
  $val 
)

declare new application parameter

Parameters
string$key
array$val

Definition at line 1121 of file Class.Application.php.

+ Here is the call graph for this function:

setParamU (   $key,
  $val 
)

set user parameter for current user

See Also
ParameterManager to easily manage application parameters
Parameters
string$keyparameter identifier
string$valvalue
Returns
string error message

Definition at line 1112 of file Class.Application.php.

setSession ( $session)

Definition at line 281 of file Class.Application.php.

setVolatileParam (   $key,
  $val 
)

Add temporary parameter to ths application Can be use to transmit global variable or to affect Layout

Parameters
string$key
string$val

Definition at line 1180 of file Class.Application.php.

+ Here is the call graph for this function:

static text (   $code)
static

translate text use gettext catalog

Parameters
string$codetext to translate
Returns
string

Definition at line 1466 of file Class.Application.php.

updateAllApp ( )

Update All available application

See Also
updateApp

Definition at line 1405 of file Class.Application.php.

updateApp ( )

update application description from .app and _init.php configuration files

Definition at line 1396 of file Class.Application.php.

updateUserAcl (   $iduser)

Write default ACL when new user is created not used - to remove

Parameters
int$iduser
Exceptions
\Dcp\Db\Exception

Definition at line 1477 of file Class.Application.php.

Field Documentation

$access_free
Deprecated:

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

$adminMode = false
protected

Definition at line 163 of file Class.Application.php.

$available

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

$childof

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

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

Definition at line 121 of file Class.Application.php.

$csscode = array()

Definition at line 166 of file Class.Application.php.

$cssref = array()

Definition at line 165 of file Class.Application.php.

$dbtable = "application"

Definition at line 114 of file Class.Application.php.

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

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

$description

Definition at line 55 of file Class.Application.php.

$displayable

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

$fields
Initial value:
= array(
"id",
"name",
"short_name",
"description",
"access_free",
"available",
"icon",
"displayable",
"with_frame",
"childof",
"objectclass",
"ssl",
"machine",
"iorder",
"tag"
)

Definition at line 32 of file Class.Application.php.

$fulltextfields
Initial value:
= array(
"name",
"short_name",
"description"
)

Definition at line 87 of file Class.Application.php.

$icon

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

$id

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

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

Definition at line 83 of file Class.Application.php.

$iorder

Definition at line 81 of file Class.Application.php.

$jscode = array()

Definition at line 157 of file Class.Application.php.

$jsref = array()

Definition at line 156 of file Class.Application.php.

$log = null

Definition at line 155 of file Class.Application.php.

$logmsg = array()

Definition at line 158 of file Class.Application.php.

$machine
Deprecated:

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

$name

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

$noimage = "CORE/Images/core-noimage.png"

Definition at line 932 of file Class.Application.php.

$objectclass
Deprecated:

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

$param

Definition at line 146 of file Class.Application.php.

$parent = null

Definition at line 130 of file Class.Application.php.

$permission = null

Definition at line 150 of file Class.Application.php.

$rootdir = ''

Definition at line 86 of file Class.Application.php.

$session = null

Definition at line 134 of file Class.Application.php.

$short_name

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

$sqlcreate
Initial value:
= '
create table application ( id int not null,
primary key (id),
name text not null,
short_name text,
description text ,
access_free char,
available char,
icon text,
displayable char,
with_frame char,
childof text,
objectclass char,
ssl char,
machine text,
iorder int,
tag text);
create index application_idx1 on application(id);
create index application_idx2 on application(name);
create sequence SEQ_ID_APPLICATION start 10;
'

Definition at line 92 of file Class.Application.php.

$ssl
Deprecated:

Definition at line 75 of file Class.Application.php.

$style

Definition at line 142 of file Class.Application.php.

$tag

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

$user = null

Definition at line 138 of file Class.Application.php.

$with_frame

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


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