kaolak : documentation previous | next | table of contents 

2.5 API - Object model
class MySqlDb
Parent class: none
Location: /inc/mysqldb.php
Description: Database interface
MySqlDb(str $host=null,str $user='',str $passwd='',str $dbase=null,res $link=null,res $connection=null)
private string    $host
private string    $dbase
private string    $user
private string    $passwd
private ressource $link
private ressource $connection
public    ressource connect($hostOnly=null)
private   ressource isConnected($hostOnly=null)
public    void      disconnect()
public    bool      createDb(str $dbName=$this->dbase)
public    bool      dropDb(str $dbName=$this->dbase)
public    bool      createTable(str[] $tableDesc)
public    bool      alterTable(str $queryStr)
public    bool      dropTable(str $tableName)
public    bool      tableExists(str $tableName)
protected bool      query(str $queryStr)
public    str[][]   select(str $queryStr)
public    str       selectUniqueField(str $queryStr)
public    str[]     selectUniqueRow(str $queryStr)
public    int       insert(str $queryStr)
public    bool      update(str $queryStr)
public    bool      delete(str $queryStr)
class Kaolak
Parent class: MySqlDb
Location: /inc/kaolak.php
Description: utilities
public void  throwError(str $error)
public bool  addNodeType(str $typeName,bool $verbose=null)
public bool  addNodeDataType(str $dataTypeName,str $dataTypeDataTypeName,int $nodeTypeId=null)
public bool  addNodeDataTypeDataType(str $typeName,str $dataTypeSqlDataTypeName)
public int   getNodeTypeId(str $typeName)
public int   getNodeTypeName(int $typeId)
public int   getNodeDataTypeId(str $dataTypeName)
public int   getNodeDataType(int $dataTypeId)
public int   getNodeDataTypeDataType(int $dataTypeDataTypeId)
public int   getNodeId(str $dataTypeName,str $data,str $typeName=null)
public int   getBranchId(str $branchName)
public int   getLangId(str $langRef)
public int   getMimeTypeId(str $mtName)
public int   getSessionId(str $sessionStr)
public str[] getModules()
public bool  addModule(str $moduleName)
public str   getEncPass(str $password)
public str   getTimestamp()
class Node
Parent class: Kaolak
Location: /inc/node.php
Description: kaolak most important class - provides generic operations on nodes

Class and subclasses getters and setters taking $getFromDb or $updateDb work the following way :

getFoo() gets foo from object
getFoo(1) gets foo from db
setFoo(foo) sets foo in object
setFoo(foo,1) sets foo in db
setFoo(getFoo(1)) sets foo in object from db
setFoo(getFoo(),1) sets foo in db from object

Node(int $id=null)
private int $id
private int[] parents
private int[] children
private int type
private int branch
private int user_id
private int permission_read
private int permission_write
private int locked
protected int       getId()
protected int       add()
protected bool      remove()
private   bool      checkPermission(str $readOrWrite)
protected int       getPermission(str $readOrWrite,int $userId)
protected int[]     getPermissions(str $readOrWrite)
protected bool      setPermission(str $readOrWrite,int $userId,bool $suid = false)
private   str/str[] getDataFromDb(str $dataType,int $sortOrder=0,int $langId=0)
private   bool      setDataInDb(str $dataType,str/str[] $value,int $sortOrder=0,int $langId=0)
protected str/str[] getField(str $fieldName,bool $getFromDb=false,int $sortOrder=0,int $langId=0)
protected bool      setField(str $fieldName,str/str[] $value,bool $updateDb=false,int $sortOrder=0,int $langId=0)
protected int       isLocked()
protected bool      lock(int $userId)
protected bool      unLock()
protected bool      isGroup()
public    int[]     getParents(bool $getFromDb=false)
public    bool      setParents(int[] $parentIds, bool $updateDb=false)
public    bool      addParent(int $parentId, bool $updateDb=false)
public    bool      removeParent(int $parentId, bool $updateDb=false)
public    int[]     getChildren(bool $getFromDb=false)
public    bool      setChildren(int[] $childIds, bool $updateDb=false)
public    bool      addChild(int $childId, bool $updateDb=false)
public    bool      removeChild(int $childId, bool $updateDb=false)
public    bool      isParent(bool $getFromDb=false)
public    bool      isParentOf(int $childId,bool $getFromDb=false)
private   str[][]   getAllInfo(int $langId=0,bool $setFields=false)
protected str       getName(bool $getFromDb=false)
protected bool      setName(str $name,bool $updateDb=false)
protected int       getTypeId(bool $getFromDb=false)
protected bool      setTypeId(int $typeId,bool $updateDb=false)
protected int       getBranchId(bool $getFromDb=false)
protected bool      setBranchId(int $branchId,bool $updateDb=false)
protected bool      setAsGroup(bool $updateDb=false)
protected bool      unsetAsGroup(bool $updateDb=false)
public    int       getCreator(bool $getFromDb=false)
public    str       getCreationDate(bool $getFromDb=false)
public    int       getModificator(bool $getFromDb=false)
public    str       getModificationDate(bool $getFromDb=false)
class User
Parent class: Node
Location: /modules/user/user.php
Description: user operations
User(int $id=null)
private str $username
private str $passwd
public int   add()
public str   getUsername(bool $getFromDb=false)
public str   getName(bool $getFromDb=false)
public bool  setUsername(str $username,bool $updateDb=false)
public bool  setName(str $name,bool $updateDb=false)
public str   getPassword(bool $getFromDb=false)
public bool  setPassword(str $password,bool $updateDb=false)
public str[] getAccessPermissions(int $nodeTypeId)
public int   getAccessPermission(int $nodeTypeId)
public bool  setAccessPermissions(str[] $permissions)
public bool  setAccessPermission(int $nodeTypeId,int $permissionLevel)
public str   getEmail(bool $getFromDb=false)
public str   setEmail(str $email,bool $updateDb=false)
public int[] getGroups(bool $getFromDb=false)
public bool  setGroups(int[] $groupIds,bool $updateDb=false)
public bool  addToGroup(int $groupId,bool $updateDb=false)
public bool  removeFromGroup(int $groupId,bool $updateDb=false)
public bool  isInGroup(int $groupId,bool $getFromDb=false)
public bool  lockNode(int $nodeId)
public bool  unlockNode(int $nodeId)
public bool  releaseLocks(int $preserveLockId=null)
public bool  editNode(int $nodeId)
class Mime_type
Parent class: Node
Location: /modules/document/mime_type.php
Mime_type(int $id=null)
public int   add()
public str   getSuffixStr(bool $getFromDb = null)
public bool  setSuffixStr(str $suffix,bool $updateDb = null)
public int   getIdFromName(str $mimeType)
public bool  getIdFromSuffix(str $suffix)
class Document
Parent class: Node
Location: /modules/document/document.php
Document(int $id=null)
public int   add()
public int   getMimeTypeId(str $mimeType)
public str   getMimeType(bool $getFromDb = null)
public bool  setMimeType(str $mimeType,bool $updateDb = null)
public str   getDescription(bool $getFromDb = null,bool $getAsHtml = null)
public bool  setDescription(str $description,bool $updateDb = null)
public str   getDir()
public bool  upload(ressource $file,str $name = null)
public bool  remove()
class Session
Parent class: Node
Location: /modules/user/session.php
Description: session management
Session(int $id=null)
public int   add()
private str  makeSessionStr()
private str  getSessionStr(bool $getFromDb=false)
private bool setSessionStr(str $sessionStr, bool $updateDb=false)
public  int  getUser(bool $getFromDb=false)
private bool setUser(int $userId,bool $updateDb=false)
public  str  getLoginIp(bool $getFromDb=false)
private bool setLoginIp(str $IP,bool $updateDb=false)
public  str  getLoginTime(bool $getFromDb=false)
private bool setLoginTime(str $unixTimestamp,bool $updateDb=false)
private str  getLastCall(bool $getFromDb=false)
private bool setLastCall($str $unixTimestamp,bool $updateDb=false)
public  str  getLogoutTime(bool $getFromDb=false)
private bool setLogoutTime(str $unixTimestamp, bool $updateDb=false)
public  void begins()
public  void terminates()
public  void persists()
public  bool isClosed()
public  bool hasTimedOut()
private bool check()
class GUI
Parent class: none
Location: /gui/gui.php
Description: Graphical User Interface RUDI utilities.
init() sets constants $KAOLAK (Kaolak object), KAOLAK_USERID (currently logged user id), $KAOLAK_USER (currently logged User object), $BRANCH (currently logged to branch object)
Constructor: none
public void    init()
public Node    getNode(int $nodeId)
public mixed[] getNodeInfo(int $nodeId)
public str     getBranchHtml(str $nodeType,str $htmlY, bool $groupsOnly=false)
public str     getNodeHtml(str[][] $nodes,int $parentId,$int $startNode,int $level=1,str $pathStr='')
class SuperGUI
Parent class: GUI
Location: /gui/superadmin/supergui.php
Description: Superuser Graphical User Interface RUDI utilities.
init() sets constants $KAOLAK (Kaolak object), KAOLAK_USERID = 1, $KAOLAK_USER (superuser User object)
Constructor: none
public void    init()
 previous | next | table of contents