Class MED_CATEGORY_NODE

Description

media category tree node

Located in /media/MED_CATEGORY_NODE.phpclass (line 35)

OCSP_OBJ
   |
   --DBMS_TABLEOBJ
      |
      --DBMS_TREE_NODE
         |
         --MED_CATEGORY_NODE
Variable Summary
Method Summary
 MED_CATEGORY_NODE MED_CATEGORY_NODE ([int $aId = 0], [boolean $debug = FALSE], string $dDBIDX)
 MED_FILE addNewFile (string $file, [bool $asLink = FALSE], [bool $debug = FALSE])
 int addSubDirAsChild (string $dirName, [string $childName = ""], [boolean $debug = FALSE])
 MED_FILE addUploadFile (array $uplFArr, [boolean $debug = FALSE], [boolean $autoSave = FALSE])
 array checkDir ([bool $autoAdd = FALSE], [bool $debug = TRUE])
 int checkShowDate ([ $debug = FALSE])
 boolean curUserCanOpen ([boolean $debug = FALSE])
 boolean curUserCanUpload ([boolean $debug = FALSE])
 boolean curUserIsAdmin ([boolean $debug = FALSE])
 int dbInsert ([bool $debug = FALSE], string $gDBIDX)
 void getChildQueryString ([ $cols = "*"], [ $debug = FALSE])
 string getNewFileName (string $fileName, [bool $debug = FALSE])
 int getProjId ()
 string getRootDir ([bool $debug = FALSE])
 int getStateId ()
 void getTitle ()
 string getUploadDir ([bool $debug = FALSE])
 bool hasChildrenToShow ([boolean $checkState = TRUE], [boolean $checkDate = TRUE], [boolean $checkGroup = TRUE], [boolean $debug = FALSE])
 boolean isOffPath ()
 bool isToShow ([boolean $checkState = TRUE], [boolean $checkDate = TRUE], [boolean $checkGroup = TRUE], [boolean $debug = FALSE])
 boolean projId_IsSet ()
 void setAddDefaulProj_OnOff (boolean $onOff)
 void setChildClassVar ( &$child, &DBMS_TREE_NODE $child)
 void setOffPath (boolean $onOff)
 int setRootDir (string $absPath, [boolean $create = FALSE], [boolean $noCheck = FALSE], [boolean $debug = FALSE])
 void setTitle ( $aTitle, string $aTitle;)
 void set_projId (int $aProjId)
 boolean userCanAdd ([boolean $debug = FALSE])
 void writeTableRowChildren ([int $expandLevel = 0], [ $useCache = TRUE], [bool $debug = FALSE], bool $useChace)
 void writeTableRowThis (bool $debug)
Variables
boolean $addDefaultProj = FALSE (line 88)
  • var: show project and default project (PROJ_ID=0)
  • since: pk-06-03-05
double $hasChildrenToShowTS (line 70)
  • since: pk-06-11-13
string $myChildClass = "MED_CATEGORY_NODE" (line 64)

Redefinition of:
DBMS_TREE_NODE::$myChildClass
string $myGlobalTreeKey = "T_MED_CATEGORY" (line 39)
  • var: index in $GLOABLS['DBMS_TREE'][]
mixed $myIdFld = "MEC_ID" (line 49)
  • staticvar: string $myIdFld: id column = root

Redefinition of:
DBMS_TREE_NODE::$myIdFld
mixed $myParentFld = "MEC_PARENT" (line 54)
  • staticvar: string $myParentFld: name of the parent column

Redefinition of:
DBMS_TREE_NODE::$myParentFld
mixed $mySortFld = "MEC_NAME" (line 59)
  • staticvar: string $mySortFld: name of the sort field

Redefinition of:
DBMS_TREE_NODE::$mySortFld
mixed $myTable = "T_MED_CATEGORY" (line 44)
  • staticvar: string $myTable:

Redefinition of:
DBMS_TABLEOBJ::$myTable
NOT FINAL !!!!!
boolean $offPath = FALSE (line 76)
  • var: the category dir is not under $GLOBALS['MEDIA']['ROOTPATH']
  • since: pk-05-10-13
int $projId = -1 (line 82)
  • var: CMS_PROJECT (-1 == all)
  • since: pk-06-03-03

Inherited Variables

Inherited from DBMS_TREE_NODE

DBMS_TREE_NODE::$changesParent
DBMS_TREE_NODE::$level
DBMS_TREE_NODE::$myChildCacheTTL
DBMS_TREE_NODE::$myChildKeys
DBMS_TREE_NODE::$myChildren
DBMS_TREE_NODE::$myChildrenPopulateTS
DBMS_TREE_NODE::$myClassSrcFile
DBMS_TREE_NODE::$myFilterArr
DBMS_TREE_NODE::$myLink
DBMS_TREE_NODE::$myParent
DBMS_TREE_NODE::$myTree
DBMS_TREE_NODE::$myTreeClass
DBMS_TREE_NODE::$orderNr

Inherited from DBMS_TABLEOBJ

DBMS_TABLEOBJ::$autoIncFld
DBMS_TABLEOBJ::$dbTableDefinitions
DBMS_TABLEOBJ::$frmPostSubOjects
DBMS_TABLEOBJ::$hasObjVals
DBMS_TABLEOBJ::$initTS
DBMS_TABLEOBJ::$myCacheTS
DBMS_TABLEOBJ::$myFields
DBMS_TABLEOBJ::$myKeys
DBMS_TABLEOBJ::$myLinkedTableRows
DBMS_TABLEOBJ::$myMode
DBMS_TABLEOBJ::$myObjVals
DBMS_TABLEOBJ::$myObjValsPopulateTS
DBMS_TABLEOBJ::$objError
DBMS_TABLEOBJ::$objErrorMsg
DBMS_TABLEOBJ::$populateTS
DBMS_TABLEOBJ::$staticClassVars
DBMS_TABLEOBJ::$valChangeTS

Inherited from OCSP_OBJ

OCSP_OBJ::$global_currentUser
OCSP_OBJ::$global_defaultDBObj_read
OCSP_OBJ::$global_defaultDBObj_write
OCSP_OBJ::$myDBObj
Methods
Constructor MED_CATEGORY_NODE (line 102)

constructor

MED_CATEGORY_NODE MED_CATEGORY_NODE ([int $aId = 0], [boolean $debug = FALSE], string $dDBIDX)
  • int $aId: id of the node (if set the node is poplulated)
  • string $dDBIDX: index of the database connection in $GLOBALS
  • boolean $debug
addNewFile (line 759)

function adds a file to the category

  • todo: handle add if $file not already in media dir
MED_FILE addNewFile (string $file, [bool $asLink = FALSE], [bool $debug = FALSE])
  • string $file: path to the file
  • bool $asLink: link the file instead of copy it to the media directory
  • bool $debug
addSubDirAsChild (line 872)

adds a sub directory of $this->getRootDir() as child to the node all files in the direcotry are added to files

  • return: childId
  • since: pk-04-08-09
int addSubDirAsChild (string $dirName, [string $childName = ""], [boolean $debug = FALSE])
  • string $dirName
  • string $childName
  • boolean $debug
addUploadFile (line 822)

adds a file submitted with post

  • since: pk-05-09-09
MED_FILE addUploadFile (array $uplFArr, [boolean $debug = FALSE], [boolean $autoSave = FALSE])
  • array $uplFArr
  • boolean $debug
  • boolean $autoSave: if true the object is stored to the db
checkDir (line 904)

scans the category directory for files not in the database if $autoAdd the files are added to the database a array with ['NEW'] and ['BROKEN']

  • todo: only unique key in db prevents from inserting the same file twice
array checkDir ([bool $autoAdd = FALSE], [bool $debug = TRUE])
  • bool $autoAdd
  • bool $debug
checkShowDate (line 511)

checks if the menu is to show from date

return values are:

  • 1: yes
  • 0: showtill is outdate
  • -2: showfrom is not reached

  • since: pk-06-11-13
int checkShowDate ([ $debug = FALSE])
  • $debug
curUserCanOpen (line 337)

returns if the current user can open the category (is group member of MEC_DWNLGRP or has higher rights)

  • since: pk-06-11-13
boolean curUserCanOpen ([boolean $debug = FALSE])
  • boolean $debug
curUserCanUpload (line 360)

returns if the current user can upload a file to the category (is group member of MEC_UPLOADGRP or has higher rights)

  • since: pk-06-11-13
boolean curUserCanUpload ([boolean $debug = FALSE])
  • boolean $debug
curUserIsAdmin (line 383)

returns if the current user is admin of the category (is group member of MEC_ADMINGRP or has higher rights)

  • since: pk-06-11-13
boolean curUserIsAdmin ([boolean $debug = FALSE])
  • boolean $debug
dbInsert (line 218)

inserts a new category and creates the category directory

  • return: returns the autoIncFld ID if exists or 1 on success
  • version: pk-05-10-13
int dbInsert ([bool $debug = FALSE], string $gDBIDX)
  • string $gDBIDX: Index of $GLOBALS to the db object
  • bool $debug: show debug info

Redefinition of:
DBMS_TABLEOBJ::dbInsert()
inserts a new row to the table
getChildQueryString (line 286)

echos a tree intend called by write children

  • since: pk-06-03-05
void getChildQueryString ([ $cols = "*"], [ $debug = FALSE])
  • $cols
  • $debug

Redefinition of:
DBMS_TREE_NODE::getChildQueryString()
returns the select statement to get the children
getNewFileName (line 730)

returns a file name which is not used and save to use

string getNewFileName (string $fileName, [bool $debug = FALSE])
  • string $fileName
  • bool $debug
getProjId (line 977)
  • since: pk-06-11-13
int getProjId ()
getRootDir (line 547)

returns the root dir of this category

pk-07-02-23:

  • if none has been set till now (MEC_PATH is empty) and we have an id a new one is set
  • replace MEC_PATH absolute pathes with template values for
  • - $GLOBALS[OCSP_MED][ROOTPATH]
  • - $GLOBALS[PROJECT][PATH]
  • - $_SERVER[DOCUMENT_ROOT]
by calling setRootDir()

  • return: (NULL in case of an error)
  • version: pk-07-02-23
string getRootDir ([bool $debug = FALSE])
  • bool $debug
getStateId (line 425)

returns the state id of the node (MEC_STATE)

  • since: pk-06-11-13
int getStateId ()
getTitle (line 119)

returns the Title

void getTitle ()
getUploadDir (line 704)

returns the path where to place upload files

string getUploadDir ([bool $debug = FALSE])
  • bool $debug
hasChildrenToShow (line 477)

checks if the node has children which are on

  • version: pk-06-11-13
bool hasChildrenToShow ([boolean $checkState = TRUE], [boolean $checkDate = TRUE], [boolean $checkGroup = TRUE], [boolean $debug = FALSE])
  • boolean $checkState
  • boolean $checkDate
  • boolean $checkGroup
  • boolean $debug
isOffPath (line 148)
  • since: pk-05-10-13
boolean isOffPath ()
isToShow (line 442)

checks if the node is on

  • version: pk-06-11-13
bool isToShow ([boolean $checkState = TRUE], [boolean $checkDate = TRUE], [boolean $checkGroup = TRUE], [boolean $debug = FALSE])
  • boolean $checkState
  • boolean $checkDate
  • boolean $checkGroup
  • boolean $debug
projId_IsSet (line 170)

returns if we have set a projId

boolean projId_IsSet ()
setAddDefaulProj_OnOff (line 183)

sets $addDefaultProj

  • since: pk-06-03-05
void setAddDefaulProj_OnOff (boolean $onOff)
  • boolean $onOff: on TRUE off =FALSE
setChildClassVar (line 196)

sets child class vars

  • since: pk-06-03-05
void setChildClassVar ( &$child, &DBMS_TREE_NODE $child)
  • &DBMS_TREE_NODE $child
  • &$child

Redefinition of:
DBMS_TREE_NODE::setChildClassVar()
sets child class vars
setOffPath (line 140)

sets offPath

  • since: pk-05-10-13
void setOffPath (boolean $onOff)
  • boolean $onOff
setRootDir (line 655)

sets the root dir an returns if the directory exists

  • version: pk-07-02-24
  • since: pk-05-10-13
int setRootDir (string $absPath, [boolean $create = FALSE], [boolean $noCheck = FALSE], [boolean $debug = FALSE])
  • string $absPath: including Project Root
  • boolean $create: create the directory if not exists
  • boolean $noCheck
  • boolean $debug
setTitle (line 127)

sets the Title

void setTitle ( $aTitle, string $aTitle;)
  • string $aTitle;
  • $aTitle
set_projId (line 160)

sets the projectID

  • since: pk-06-03-03
void set_projId (int $aProjId)
  • int $aProjId
userCanAdd (line 403)

returns if current user can add subcategories or files (checks MEC_UPLOADGRP)

  • version: pk-06-03-05
  • since: pk-04-08-13
boolean userCanAdd ([boolean $debug = FALSE])
  • boolean $debug
writeTableRowChildren (line 952)

echos a tree intend called by write children

void writeTableRowChildren ([int $expandLevel = 0], [ $useCache = TRUE], [bool $debug = FALSE], bool $useChace)
  • int $expandLevel
  • bool $useChace
  • bool $debug
  • $useCache
writeTableRowThis (line 937)

echos a the row in a table OVERRIDE IN SUB CLASS to change layout

void writeTableRowThis (bool $debug)
  • bool $debug

Inherited Methods

Inherited From DBMS_TREE_NODE

 DBMS_TREE_NODE::DBMS_TREE_NODE()
 DBMS_TREE_NODE::addChildNode()
 DBMS_TREE_NODE::changeParent()
 DBMS_TREE_NODE::changesParent()
 DBMS_TREE_NODE::childListIsPopulated()
 DBMS_TREE_NODE::filterAdd()
 DBMS_TREE_NODE::filterClear()
 DBMS_TREE_NODE::filterRemoveKey()
 DBMS_TREE_NODE::getChild()
 DBMS_TREE_NODE::getChildQueryString()
 DBMS_TREE_NODE::getChildrenList()
 DBMS_TREE_NODE::getChildTblName()
 DBMS_TREE_NODE::getGlobalTreeKey()
 DBMS_TREE_NODE::getId()
 DBMS_TREE_NODE::getLevel()
 DBMS_TREE_NODE::getOrderNr()
 DBMS_TREE_NODE::getParentId()
 DBMS_TREE_NODE::getParentObj()
 DBMS_TREE_NODE::getRootPath()
 DBMS_TREE_NODE::getRootPathIdx()
 DBMS_TREE_NODE::getTree()
 DBMS_TREE_NODE::hasChildren()
 DBMS_TREE_NODE::matchFilter()
 DBMS_TREE_NODE::moveChildDown()
 DBMS_TREE_NODE::moveChildUp()
 DBMS_TREE_NODE::newChildObj()
 DBMS_TREE_NODE::newTreeObj()
 DBMS_TREE_NODE::numberOfChildren()
 DBMS_TREE_NODE::populateChildren()
 DBMS_TREE_NODE::populateTree()
 DBMS_TREE_NODE::resortChildren()
 DBMS_TREE_NODE::setChildClassVar()
 DBMS_TREE_NODE::setConfigurationArr()
 DBMS_TREE_NODE::setId()
 DBMS_TREE_NODE::setLevel()
 DBMS_TREE_NODE::setLink()
 DBMS_TREE_NODE::setOrderNr()
 DBMS_TREE_NODE::setParentId()
 DBMS_TREE_NODE::setParentObj()
 DBMS_TREE_NODE::setTreeObj()

Inherited From DBMS_TABLEOBJ

 DBMS_TABLEOBJ::DBMS_TABLEOBJ()
 DBMS_TABLEOBJ::cacheRestore()
 DBMS_TABLEOBJ::cacheWriteTo()
 DBMS_TABLEOBJ::clearErrors()
 DBMS_TABLEOBJ::dbDelete()
 DBMS_TABLEOBJ::dbGetDataArray()
 DBMS_TABLEOBJ::dbGetForm()
 DBMS_TABLEOBJ::dbInsert()
 DBMS_TABLEOBJ::dbPopulate()
 DBMS_TABLEOBJ::dbReplace()
 DBMS_TABLEOBJ::dbSave()
 DBMS_TABLEOBJ::db_SetKey()
 DBMS_TABLEOBJ::db_SetKeyArray()
 DBMS_TABLEOBJ::getClassInclude()
 DBMS_TABLEOBJ::getDbDesc()
 DBMS_TABLEOBJ::getDBField()
 DBMS_TABLEOBJ::getDBRow()
 DBMS_TABLEOBJ::getDBVal()
 DBMS_TABLEOBJ::getDefaults()
 DBMS_TABLEOBJ::getErrorMsg()
 DBMS_TABLEOBJ::getFieldDBDefault()
 DBMS_TABLEOBJ::getForm()
 DBMS_TABLEOBJ::getFormClassName()
 DBMS_TABLEOBJ::getFormName()
 DBMS_TABLEOBJ::getJSON()
 DBMS_TABLEOBJ::getKeyArr()
 DBMS_TABLEOBJ::getMyTable()
 DBMS_TABLEOBJ::getObjValArray()
 DBMS_TABLEOBJ::getObjValValue()
 DBMS_TABLEOBJ::getPopulateTs()
 DBMS_TABLEOBJ::getWhere()
 DBMS_TABLEOBJ::hasChanged()
 DBMS_TABLEOBJ::hasColumn()
 DBMS_TABLEOBJ::hasErrors()
 DBMS_TABLEOBJ::hasObjVals()
 DBMS_TABLEOBJ::init()
 DBMS_TABLEOBJ::isInit()
 DBMS_TABLEOBJ::isPopulated()
 DBMS_TABLEOBJ::keysAreSet()
 DBMS_TABLEOBJ::populateFromKeys()
 DBMS_TABLEOBJ::populateFromValues()
 DBMS_TABLEOBJ::populateObjVals()
 DBMS_TABLEOBJ::p_cacheIsExpired()
 DBMS_TABLEOBJ::saveLinkedRow()
 DBMS_TABLEOBJ::saveLinkedTableRows()
 DBMS_TABLEOBJ::saveObjVals()
 DBMS_TABLEOBJ::setChanged()
 DBMS_TABLEOBJ::setDBField()
 DBMS_TABLEOBJ::setDBFieldIfDiff()
 DBMS_TABLEOBJ::setDBFieldIfEmpty()
 DBMS_TABLEOBJ::setDBRow()
 DBMS_TABLEOBJ::setDBVal()
 DBMS_TABLEOBJ::setDefaults()
 DBMS_TABLEOBJ::setError()
 DBMS_TABLEOBJ::setLinkedTableRow()
 DBMS_TABLEOBJ::setMyTable()
 DBMS_TABLEOBJ::setObjValArray()
 DBMS_TABLEOBJ::setObjValValue()
 DBMS_TABLEOBJ::setObjVarIfEmpty()
 DBMS_TABLEOBJ::setUnChanged()
 DBMS_TABLEOBJ::userIsAllowed()
 DBMS_TABLEOBJ::writeDebugInfo()
 DBMS_TABLEOBJ::xmladdDOMElement()
 DBMS_TABLEOBJ::xmlExport()
 DBMS_TABLEOBJ::_getCacheFileName()
 DBMS_TABLEOBJ::_getDBFields()

Inherited From OCSP_OBJ

 OCSP_OBJ::castObj()
 OCSP_OBJ::cloneMe()
 OCSP_OBJ::currentUser()
 OCSP_OBJ::dbConnect()
 OCSP_OBJ::defaultDBObj()
 OCSP_OBJ::defaultReadDBObj()
 OCSP_OBJ::defaultWriteDBObj()
 OCSP_OBJ::getConf()
 OCSP_OBJ::getDBObj()
 OCSP_OBJ::get_myClassConstant()
 OCSP_OBJ::get_myObject_vars()
 OCSP_OBJ::get_mySourceFile()
 OCSP_OBJ::isConnected()
 OCSP_OBJ::isMultiByteStr()
 OCSP_OBJ::isUTF8()
 OCSP_OBJ::setConf()
 OCSP_OBJ::setDBObj()
 OCSP_OBJ::set_myObject_vars()
 OCSP_OBJ::set_myVarsFrom()
Class Constants

Inherited Constants

Inherited from DBMS_TABLEOBJ

DBMS_TABLEOBJ::CLASS_SRC_FILE

Inherited from OCSP_OBJ

OCSP_OBJ::CLASS_SRC_FILE

Documentation generated on Thu, 08 Jan 2009 17:44:47 +0100 by phpDocumentor 1.4.0a2