Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
freedom_util.php File Reference

Go to the source code of this file.

Namespaces

namespace  FDL
 

Functions

 GetSqlCond2 ($Table, $column)
 
 GetSqlCond ($Table, $column, $integer=false)
 
 first ($a)
 
 notEmpty ($a)
 
 toxhtmltag ($lt, $tag, $attr, $gt)
 
 HandleXmlError ($errno, $errstr, $errfile, $errline)
 
$gdocs

optimize for speed : memorize object for future use array $_GLOBALS["gdocs"]

 new_Doc ($dbaccess, $id= '', $latest=false)
 
 createDoc ($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
 
 createTmpDoc ($dbaccess, $fromid)
 
 getFromId ($dbaccess, $id)
 
 getFromName ($dbaccess, $id)
 
 getFamFromId ($dbaccess, $id)
 
 getTDoc ($dbaccess, $id, $sqlfilters=array(), $result=array())
 
 getv (&$t, $k, $d="")
 
 getvs (&$t)
 
 tordered ($a, $b)
 
 cmp_cvorder3 ($a, $b)
 
 controlTdoc ($tdoc, $aclname)
 
 getDocObject ($dbaccess, $v, $k=0)
 
 getNextDbObject ($dbaccess, $res)
 
 getNextDoc ($dbaccess, &$tres)
 
 countDocs (&$tres)
 
 getFamIdFromName ($dbaccess, $name)
 
 getIdFromTitle ($dbaccess, $title, $famid="", $only=false)
 
 getIdFromName ($dbaccess, $name, $famid="")
 
 getNameFromId ($dbaccess, $id)
 
 setFamidInLayout (&$action)
 
 getDocFromUserId ($dbaccess, $userid)
 
 getFamTitle (&$tdoc)
 
 isFixedDoc ($dbaccess, $id)
 
 ComputeVisibility ($vis, $fvis, $ffvis='')
 
 getLatestTDoc ($dbaccess, $initid, $sqlfilters=array(), $fromid=false)
 
 getLatestDocIds ($dbaccess, $ids)
 
 getLatestDocId ($dbaccess, $initid)
 
 getRevTDoc ($dbaccess, $initid, $rev)
 
 getLatestRevisionNumber ($dbaccess, $initid, $fromid=0)
 
 createAutoFolder (&$doc)
 
 getMyProfil ($dbaccess, $create=true)
 
 xt_innerXML (&$node)
 
 cleanhtml ($html)
 

Function Documentation

cleanhtml (   $html)

Definition at line 923 of file freedom_util.php.

cmp_cvorder3 (   $a,
  $b 
)

Definition at line 444 of file freedom_util.php.

ComputeVisibility (   $vis,
  $fvis,
  $ffvis = '' 
)

Definition at line 705 of file freedom_util.php.

controlTdoc (   $tdoc,
  $aclname 
)

control privilege for a document in the array form the array must provide from getTdoc the function is equivalent of Doc::Control

Parameters
array$tdocdocument
string$aclnameidentificator of the privilege to test
Returns
bool true if current user has privilege

Definition at line 459 of file freedom_util.php.

+ Here is the call graph for this function:

countDocs ( $tres)

count returned document in sql select ressources

Parameters
array$tresof ressources return Doc the next doc (false if the end)

Definition at line 537 of file freedom_util.php.

createAutoFolder ( $doc)

Create default folder for a family with default constraint

Parameters
Doc$Docthe family object document
Returns
int id of new folder (false if error)

Definition at line 868 of file freedom_util.php.

+ Here is the call graph for this function:

createDoc (   $dbaccess,
  $fromid,
  $control = true,
  $defaultvalues = true,
  $temporary = false 
)

create a new document object in type concordance

the document is set with default values and default profil of the family

Parameters
string$dbaccessdatabase specification
string$fromididentificator of the family document (the number or internal name)
bool$controlif false don't control the user hability to create this kind of document
bool$defaultvaluesif false not affect default values
Returns
Doc may be return false if no hability to create the document

Definition at line 207 of file freedom_util.php.

+ Here is the call graph for this function:

createTmpDoc (   $dbaccess,
  $fromid 
)

create a temporary document object in type concordance

the document is set with default values and has no profil the create privilege is not tested in this case

Parameters
string$dbaccessdatabase specification
string$fromididentificator of the family document (the number or internal name)
Returns
Doc may be return false if no hability to create the document

Definition at line 254 of file freedom_util.php.

+ Here is the call graph for this function:

first (   $a)

return first element of array

Parameters
array$a
Returns
string the first, false is empty

Definition at line 65 of file freedom_util.php.

getDocFromUserId (   $dbaccess,
  $userid 
)

return freedom user document in concordance with what user id

Parameters
string$dbaccessdatabase specification
int$useridwhat user identificator
Returns
Doc the user document

Definition at line 663 of file freedom_util.php.

+ Here is the call graph for this function:

getDocObject (   $dbaccess,
  $v,
  $k = 0 
)

get document object from array document values

Parameters
string$dbaccessdatabase specification
array$vvalues of document
Returns
Doc the document object

Definition at line 488 of file freedom_util.php.

+ Here is the call graph for this function:

getFamFromId (   $dbaccess,
  $id 
)

return from id for family document

Parameters
string$dbaccessdatabase specification
int$ididentificator of the object
Returns
int false if error occured

Definition at line 318 of file freedom_util.php.

+ Here is the call graph for this function:

getFamIdFromName (   $dbaccess,
  $name 
)

return the identificator of a family from internal name

Parameters
string$dbaccessdatabase specification
string$nameinternal family name
Returns
int 0 if not found

Definition at line 551 of file freedom_util.php.

getFamTitle ( $tdoc)

Definition at line 685 of file freedom_util.php.

getFromId (   $dbaccess,
  $id 
)

return from id for document (not for family (use

See Also
getFamFromId() instead)
Parameters
string$dbaccessdatabase specification
int$ididentificator of the object
Returns
int false if error occured (return -1 if family document )

Definition at line 271 of file freedom_util.php.

+ Here is the call graph for this function:

getFromName (   $dbaccess,
  $id 
)

return from name for document (not for family (use

See Also
getFamFromId() instead)
Parameters
string$dbaccessdatabase specification
int$ididentificator of the object
Returns
string false if error occured (return -1 if family document )

Definition at line 295 of file freedom_util.php.

+ Here is the call graph for this function:

getIdFromName (   $dbaccess,
  $name,
  $famid = "" 
)

return the identificator of a document from its logical name

Parameters
string$dbaccessdatabase specification
string$namelogical name
string$famidmust be set to increase speed search
Returns
int 0 if not found, return negative first id found if multiple (name must be unique)

Definition at line 596 of file freedom_util.php.

+ Here is the call graph for this function:

getIdFromTitle (   $dbaccess,
  $title,
  $famid = "",
  $only = false 
)

return the identificator of a document from a search with title

Parameters
string$dbaccessdatabase specification
string$namelogical name
string$famidmust be set to increase speed search
boolean$onlyset to true to not search in subfamilies
Returns
int 0 if not found, return negative first id found if multiple (name must be unique)

Definition at line 576 of file freedom_util.php.

+ Here is the call graph for this function:

getLatestDocId (   $dbaccess,
  $initid 
)

return latest id of document from its initid

Parameters
string$dbaccessdatabase specification
array$idsarray of document identificators
Returns
array identificator relative to latest revision. if one or several documents document not exists the identificator not appear in result so the array count of result can be lesser than parameter

Definition at line 795 of file freedom_util.php.

+ Here is the call graph for this function:

getLatestDocIds (   $dbaccess,
  $ids 
)

return identificators according to latest revision the order is not the same as parameters. The key of result containt initial id

Parameters
string$dbaccessdatabase specification
array$idsarray of document identificators
Returns
array identificator relative to latest revision. if one or several documents document not exists the identificator not appear in result so the array count of result can be lesser than parameter

Definition at line 771 of file freedom_util.php.

+ Here is the call graph for this function:

getLatestRevisionNumber (   $dbaccess,
  $initid,
  $fromid = 0 
)

return really latest revision number use only for debug mode

Parameters
string$dbaccessdatabase specification
int$initidinitial identificator of the document
int$fromidfamily identicator of document
Returns
int latest revision if found. False if initid not available

Definition at line 843 of file freedom_util.php.

+ Here is the call graph for this function:

getLatestTDoc (   $dbaccess,
  $initid,
  $sqlfilters = array(),
  $fromid = false 
)

return doc array of latest revision of initid

Parameters
string$dbaccessdatabase specification
string$initidinitial identificator of the document
array$sqlfiltersadd sql supply condition
Returns
array values array if found. False if initid not avalaible

Definition at line 732 of file freedom_util.php.

+ Here is the call graph for this function:

getMyProfil (   $dbaccess,
  $create = true 
)

get personal profil

return the profil named "PERSONAL-PROFIL-<$uid>" the document return is a folder profil that can be use also for "normal" documents

Returns
PDir may be return false if no hability to create the document

Definition at line 890 of file freedom_util.php.

+ Here is the call graph for this function:

getNameFromId (   $dbaccess,
  $id 
)

return the logical name of a document from its initial identificator

Parameters
string$dbaccessdatabase specification
string$idinitial identificator
Returns
string empty if not found

Definition at line 625 of file freedom_util.php.

+ Here is the call graph for this function:

getNextDbObject (   $dbaccess,
  $res 
)

return the next document in sql select ressources use with "ITEM" type searches direct in QueryDb return Doc the next doc (false if the end)

Definition at line 508 of file freedom_util.php.

+ Here is the call graph for this function:

getNextDoc (   $dbaccess,
$tres 
)

return the next document in sql select ressources use with "ITEM" type searches with getChildDoc return Doc the next doc (false if the end)

Definition at line 519 of file freedom_util.php.

+ Here is the call graph for this function:

getRevTDoc (   $dbaccess,
  $initid,
  $rev 
)

return doc array of specific revision of document initid

Parameters
string$dbaccessdatabase specification
string$initidinitial identificator of the document
int$revrevision number
Returns
array values array if found. False if initid not avalaible

Definition at line 814 of file freedom_util.php.

+ Here is the call graph for this function:

GetSqlCond (   $Table,
  $column,
  $integer = false 
)

Definition at line 40 of file freedom_util.php.

GetSqlCond2 (   $Table,
  $column 
)

Definition at line 24 of file freedom_util.php.

getTDoc (   $dbaccess,
  $id,
  $sqlfilters = array(),
  $result = array() 
)

return document table value

Parameters
string$dbaccessdatabase specification
int$ididentificator of the object
array$sqlfiltersadd sql supply condition
Returns
array false if error occured

Definition at line 342 of file freedom_util.php.

+ Here is the call graph for this function:

getv ( $t,
  $k,
  $d = "" 
)

return the value of an doc array item

Parameters
array&$tthe array where get value
string$kthe index of the value
string$ddefault value if not found or if it is empty
Returns
string

Definition at line 391 of file freedom_util.php.

getvs ( $t)

complete all values of an doc array item

Parameters
array&$tthe array where get value
Returns
void

Definition at line 416 of file freedom_util.php.

HandleXmlError (   $errno,
  $errstr,
  $errfile,
  $errline 
)

function use by Doc::getOOoValue() use to trap XML parsing error : raise exception

Parameters
int$errnoerror number
string$errstrerror message
string$errfile
string$errlineerror line
Returns
bool

Definition at line 105 of file freedom_util.php.

isFixedDoc (   $dbaccess,
  $id 
)

verify in database if document is fixed

Returns
bool

Definition at line 696 of file freedom_util.php.

+ Here is the call graph for this function:

new_Doc (   $dbaccess,
  $id = '',
  $latest = false 
)

return document object in type concordance

Parameters
string$dbaccessdatabase specification
int$ididentificator of the object
bool$latestif true set to latest revision of doc array optimize for speed
Returns
Doc object

Definition at line 125 of file freedom_util.php.

+ Here is the call graph for this function:

notEmpty (   $a)

Definition at line 72 of file freedom_util.php.

setFamidInLayout ( $action)

Definition at line 645 of file freedom_util.php.

+ Here is the call graph for this function:

tordered (   $a,
  $b 
)

use to usort attributes

Parameters
BasicAttribute$a
BasicAttribute$b

Definition at line 432 of file freedom_util.php.

toxhtmltag (   $lt,
  $tag,
  $attr,
  $gt 
)

function use by Doc::getOOoValue() use to convert html to xhtml

Parameters
string$ltthe < character
string$tagthe tag name
string$attrall attributes of tag
string$gtthe > tag
Returns
string the new tag

Definition at line 85 of file freedom_util.php.

xt_innerXML ( $node)

Definition at line 915 of file freedom_util.php.

← centre documentaire © anakeen - published under CC License - Dynacase