Class CMS_PROJECT

Description

Implements interfaces:

Class file CMS_PROJECT.phpclass

  • author: Peter Krebs <pitlinz@users.sourceforge.net>
  • version: pk-05-07-11
  • version: pk-04-05-12
  • version: pk-06-08-03 changed parent class from DBMS_TABLEOBJ to CMS_TABLEOBJ
  • version: $Id: CMS_PROJECT.phpclass,v 1.27 2008/12/02 07:36:22 pitlinz Exp $
  • project: Open CSP-Management
  • license: GNU Public License

Located in /cms/CMS_PROJECT.phpclass (line 47)

OCSP_OBJ
   |
   --DBMS_TABLEOBJ
      |
      --CMS_TABLEOBJ
         |
         --CMS_PROJECT
Class Constant Summary
 CLASS_SRC_FILE = __FILE__
Variable Summary
 static mixed $loadedProjects
 string $colPrevix
 string $myIdColName
 string $myMenuTable
 string $myPageTable
 string $myTable
Method Summary
 static CMS_PROJECT factoryFromDBRow (array $dbRow, [boolean $debug = False])
 static CMS_PROJECT factoryFromEnv ([boolean $debug = False])
 static CMS_PROJECT factoryFromId (int $aId, [boolean $force = False], [boolean $debug = False])
 static CMS_PROJECT &getInstance (int $aId, [boolean $force = False], [boolean $debug = False])
 static boolean isInstanced (int $aId)
 static void setInstance ( &$aProject, [ $debug = False])
 CMS_PROJECT CMS_PROJECT ([int $aProjId = 0], [bool $debug = False], string $gDBIdx)
 void addCssToHTMLPage ( &$htmlPage, [boolean $debug = False], OCSP_CMS_HTMLPAGE $htmlPage)
 CMS_PROJECT CMS_PROJECT_FROM_GET ([boolean $setGlobals = True], [boolean $debug = False])
 boolean curUserCanDelete ([boolean $debug = False])
 boolean curUserCanEdit ([boolean $debug = False])
 boolean curUserCanOpen ([boolean $debug = False])
 boolean curUserIsAdmin ([boolean $debug = False])
 boolean curUserIsAuthor ([boolean $debug = False])
 boolean curUserIsEditor ([boolean $debug = False])
 boolean curUserIsProjGrpMember (int $projGrpId, [boolean $strict = False], [boolean $debug = False])
 void dbInsert ([bool $debug = False], return 1)
 boolean dbReplace ([boolean $debug = False], [boolean $ignorPopulated = False])
 string getCSS_definition ([string $media = ""], [boolean $projectOnly = False], [boolean $asTemplate = False], [boolean $debug = False])
 CMS_MENU_NODE &getCurrentMenuNode ([boolean $debug = False], [boolean $checkPage = True])
 CMS_PAGE &getCurrentPage ([boolean $debug = False])
 int getId ()
 string getImgRootPath ([boolean $debug = False])
 string getIndexPHP_inc ([boolean $debug = False])
 void getLangTxt ( $txt, [ $lang = "DE"])
 CMS_MENU &getMenuTree ([boolean $asPopulated = False], [boolean $debug = False])
 string getName ()
 int getPageTmplateId ([boolean $debug = False])
 int getProjGrpId (int $projGrpId, [boolean $debug = False])
 int getProjIdFromEnv ([boolean $debug = False], [boolean $checkSession = False])
 string getProjVar (string $varName, [boolean $debug = False])
 int getTemplateId ()
 string getTitle ()
 boolean isCurrent ()
 CMS_MENU_NODE &newMenuNode (mixed $values, boolean $debug)
 boolean populateFromCache ([boolean $debug = False])
 boolean populateFromEnv ([boolean $checkSession = False], [boolean $debug = False])
 void setAsCurrent ()
 void setId (int $aId)
 void setName (string $aName)
Variables
static mixed $loadedProjects = array() (line 71)

unit of work for projects

  • staticvar: array $loadedProjects:
  • access: protected
string $colPrevix = "PROJ_" (line 144)

fields in $this->myTable starts with

  • access: protected
string $myIdColName = "PROJ_ID" (line 137)
  • access: protected
string $myMenuTable = "T_CMS_MENU" (line 149)
  • access: protected
string $myPageTable = "T_CMS_PAGE" (line 154)
  • access: protected
string $myTable = "T_CMS_PROJECT" (line 132)
  • var: name of the db table
  • access: protected

Redefinition of:
DBMS_TABLEOBJ::$myTable
NOT FINAL !!!!!

Inherited Variables

Inherited from CMS_TABLEOBJ

CMS_TABLEOBJ::$cms_conf_data
CMS_TABLEOBJ::$cms_menu_types
CMS_TABLEOBJ::$cms_pageTmpl_types
CMS_TABLEOBJ::$cms_page_types
CMS_TABLEOBJ::$currentMenu
CMS_TABLEOBJ::$currentPage
CMS_TABLEOBJ::$currentProj
CMS_TABLEOBJ::$myCmsCache
CMS_TABLEOBJ::$myMenuIdCol
CMS_TABLEOBJ::$myMenuIdGetName
CMS_TABLEOBJ::$myMenuNode
CMS_TABLEOBJ::$myPageIdCol
CMS_TABLEOBJ::$myPageIdGetName
CMS_TABLEOBJ::$myPageObj
CMS_TABLEOBJ::$myProjIdCol
CMS_TABLEOBJ::$myProjIdGetName
CMS_TABLEOBJ::$myProjObj

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
static factoryFromDBRow (line 291)

faktories a menu object from a database row

  • since: pk-08-06-18
  • access: public
CMS_PROJECT factoryFromDBRow (array $dbRow, [boolean $debug = False])
  • array $dbRow
  • boolean $debug
static factoryFromEnv (line 169)

faktories a project object from the environment

  • access: public
CMS_PROJECT factoryFromEnv ([boolean $debug = False])
  • boolean $debug
static factoryFromId (line 251)

faktories a project from $aId

  • since: pk-08-06-18
  • access: public
CMS_PROJECT factoryFromId (int $aId, [boolean $force = False], [boolean $debug = False])
  • int $aId
  • boolean $force
  • boolean $debug
static getInstance (line 86)

returns an instance of CMS_PROJECT

uses self::$loadedProjects as unit of work

  • access: public
CMS_PROJECT &getInstance (int $aId, [boolean $force = False], [boolean $debug = False])
  • int $aId
  • boolean $force
  • boolean $debug
static isInstanced (line 114)

returns if the project with $aId is in $loadedProjects

  • access: public
boolean isInstanced (int $aId)
  • int $aId
static setInstance (line 97)
  • access: public
void setInstance ( &$aProject, [ $debug = False])
  • &$aProject
  • $debug
Constructor CMS_PROJECT (line 308)

init the object and populate if an id is submitted

  • version: pk-07-08-16
  • version: pk-08-06-18
CMS_PROJECT CMS_PROJECT ([int $aProjId = 0], [bool $debug = False], string $gDBIdx)
  • int $aProjId
  • string $gDBIdx
  • bool $debug
addCssToHTMLPage (line 1181)

returns the an array with css formatings

  • requires: __OCSP_CMS_PHPINCPATH__."css/CMS_CSSSTYLE.phpclass";
  • since: pk-07-06-08
  • access: public
void addCssToHTMLPage ( &$htmlPage, [boolean $debug = False], OCSP_CMS_HTMLPAGE $htmlPage)
CMS_PROJECT_FROM_GET (line 336)

generates a project object for the current environment settings also sets the following objects:

  • $this->curMenuTree
  • $this->curMenuNode
  • $this->curPageObj

  • deprecated: since pk-08-06-18
CMS_PROJECT CMS_PROJECT_FROM_GET ([boolean $setGlobals = True], [boolean $debug = False])
  • boolean $setGlobals: if true the global variables in $OCSP_OBJ for the generated objects are set
  • boolean $debug
curUserCanDelete (line 1472)

returns if the current user can delete the project

  • since: pk-08-11-30
  • access: public
boolean curUserCanDelete ([boolean $debug = False])
  • boolean $debug
curUserCanEdit (line 1458)
  • since: pk-05-09-01
boolean curUserCanEdit ([boolean $debug = False])
  • boolean $debug
curUserCanOpen (line 1437)

returns if the current user can open the project

  • version: pk-06-11-10 PROJ_ -> $this->colPrevix
  • since: pk-05-11-03
boolean curUserCanOpen ([boolean $debug = False])
  • boolean $debug
curUserIsAdmin (line 1354)

returns if the current user is an administrator of the project

  • since: pk-05-09-01
boolean curUserIsAdmin ([boolean $debug = False])
  • boolean $debug
curUserIsAuthor (line 1406)

returns if the current user is an author of the project

  • since: pk-05-12-14
boolean curUserIsAuthor ([boolean $debug = False])
  • boolean $debug
curUserIsEditor (line 1376)

returns if the current user is an editor of the project

  • since: pk-05-12-14
boolean curUserIsEditor ([boolean $debug = False])
  • boolean $debug
curUserIsProjGrpMember (line 1315)

returns if the current user is member of the project group

  1.      _OCSP_GROUP_PROJ_ADMINGRP_     = -80;
  2.      _OCSP_GROUP_PROJ_EDITOR_GRP_   = -81;
  3.      _OCSP_GROUP_PROJ_AUTHOR_GRP_   = -82;
  4.      _OCSP_GROUP_PROJ_USER_GRP_     = -83;

  • since: pk-06-11-10
boolean curUserIsProjGrpMember (int $projGrpId, [boolean $strict = False], [boolean $debug = False])
  • int $projGrpId
  • boolean $strict: only check the group do not check higher rights
  • boolean $debug
dbInsert (line 721)

gets the sortnumber from the database and calls the parent method

  • version: pk-07-06-07
  • since: pk-05-07-14
void dbInsert ([bool $debug = False], return 1)
  • bool $debug
  • return 1: int

Redefinition of:
DBMS_TABLEOBJ::dbInsert()
inserts a new row to the table
dbReplace (line 740)

replaces the db values and clears cache

boolean dbReplace ([boolean $debug = False], [boolean $ignorPopulated = False])
  • boolean $debug
  • boolean $ignorPopulated: (if false the table MUST have been populated)

Redefinition of:
DBMS_TABLEOBJ::dbReplace()
replaces a row in the table
getCSS_definition (line 1113)

returns the html code for the css style section in the header if $media is not empty the styles are filter by this media

the return value is treatend as template and parsed with $this->getDBVal() values

  • requires: __OCSP_CMS_PHPINCPATH__."css/CMS_CSSSTYLE.phpclass";
  • since: pk-06-07-19
  • access: public
string getCSS_definition ([string $media = ""], [boolean $projectOnly = False], [boolean $asTemplate = False], [boolean $debug = False])
  • string $media
  • boolean $projectOnly
  • boolean $asTemplate: if True the return value is not parsed
  • boolean $debug
getCurrentMenuNode (line 813)

returns the current menu

  • version: pk-06-07-26
  • version: pk-07-08-15
  • version: pk-07-10-03
  • version: pk-08-10-05 use CMS_TABLEOBJ::get_current*
  • since: pk-05-07-11
CMS_MENU_NODE &getCurrentMenuNode ([boolean $debug = False], [boolean $checkPage = True])
  • boolean $debug
  • boolean $checkPage: (a menu node with an online page for the user is returned)
getCurrentPage (line 962)

returns the current page

  • version: pk-07-08-15
  • version: pk-08-10-05
  • requires: CMS_PAGE.phpclass
CMS_PAGE &getCurrentPage ([boolean $debug = False])
  • boolean $debug
getId (line 350)

returns the id

int getId ()
getImgRootPath (line 450)

returns the image rootPath

  • since: pk-06-11-09
string getImgRootPath ([boolean $debug = False])
  • boolean $debug
getIndexPHP_inc (line 1059)

returns the include file for the page

  • version: pk-05-12-02
  • version: pk-06-11-23
  • version: pk-07-08-22
  • since: pk-05-07-12
string getIndexPHP_inc ([boolean $debug = False])
  • boolean $debug: since pk-06-11-23
getLangTxt (line 472)
void getLangTxt ( $txt, [ $lang = "DE"])
  • $txt
  • $lang
getMenuTree (line 777)

returns the menu tree from curMenuNode

  • version: pk-06-07-26
  • version: pk-07-06-15 (caching)
CMS_MENU &getMenuTree ([boolean $asPopulated = False], [boolean $debug = False])
  • boolean $asPopulated: (populates the keys)
  • boolean $debug
getName (line 388)

returns the project name

  • since: pk-08-08-12
  • access: public
string getName ()
getPageTmplateId (line 1020)

returns the page template Id for the subpages

  • since: pk-08-06-07
  • access: public
int getPageTmplateId ([boolean $debug = False])
  • boolean $debug
getProjGrpId (line 1279)

returns the real group id for:

  1.      _OCSP_GROUP_PROJ_ADMINGRP_     = -80;
  2.      _OCSP_GROUP_PROJ_EDITOR_GRP_   = -81;
  3.      _OCSP_GROUP_PROJ_AUTHOR_GRP_   = -82;
  4.      _OCSP_GROUP_PROJ_USER_GRP_     = -83;

  • since: pk-06-11-10
int getProjGrpId (int $projGrpId, [boolean $debug = False])
  • int $projGrpId
  • boolean $debug
getProjIdFromEnv (line 538)

tries to find out the project id from the environment

  • version: pk-06-01-05
  • deprecated: since pk-08-06-18
  • since: pk-05-08-09
int getProjIdFromEnv ([boolean $debug = False], [boolean $checkSession = False])
  • boolean $debug
  • boolean $checkSession
getProjVar (line 419)

despite the object vals the column PROJ_VARS holds variables only used in the current project in a text field each variable is in one line like name=value

returns the value of a project var or NULL if the variable is not set

  • since: pk-06-07-23
string getProjVar (string $varName, [boolean $debug = False])
  • string $varName: name of the variable
  • boolean $debug
getTemplateId (line 491)

returns the default template id

int getTemplateId ()
getTitle (line 372)

returns the title or the name if no title is set if $this->getId() == 0 Default is returned

  • version: pk-06-07-23
  • version: pk-06-10-25 E_ALL
  • since: pk-05-09-01
string getTitle ()
isCurrent (line 503)

returns if the project is the current project

NOTE only ID's are compared

  • access: public
boolean isCurrent ()
newMenuNode (line 911)

returns a new menu node overwrite this in child classes as needed

  • version: pk-07-08-15 param values type mixed
  • version: pk-05-12-12
  • todo: CMS_PROJECT::newMenuNode() setTitle() for 0 german of Root is set
  • requires: CMS_MENU_NODE.phpclass
  • since: pk-05-07-13
CMS_MENU_NODE &newMenuNode (mixed $values, boolean $debug)
  • mixed $values: (array) dbval or (int) menId
  • boolean $debug
populateFromCache (line 1493)

tries to load the project form the cache if failed $this->dbPopulate() is called

  • access: public
boolean populateFromCache ([boolean $debug = False])
  • boolean $debug
populateFromEnv (line 657)

tries to populate the project form the environment returns true if a page to show was found

  • version: pk-05-08-08
  • version: pk-07-06-07 session handling
  • version: pk-07-08-13
  • deprecated: since pk-08-06-18
  • since: pk-05-07-11
boolean populateFromEnv ([boolean $checkSession = False], [boolean $debug = False])
  • boolean $checkSession
  • boolean $debug
setAsCurrent (line 515)

sets the project as current project in CMS_TABLEOBJ

  • access: public
void setAsCurrent ()
setId (line 357)
void setId (int $aId)
  • int $aId
setName (line 400)

sets the project name

  • since: pk-08-10-16
  • access: public
void setName (string $aName)
  • string $aName

Inherited Methods

Inherited From CMS_TABLEOBJ

 CMS_TABLEOBJ::checkMenuNodeProject()
 CMS_TABLEOBJ::cmsCacheIsUsable()
 CMS_TABLEOBJ::factoryCurrentElements()
 CMS_TABLEOBJ::getCMSConf()
 CMS_TABLEOBJ::getCmsConfArr()
 CMS_TABLEOBJ::getLangId()
 CMS_TABLEOBJ::getMenId()
 CMS_TABLEOBJ::getMenLinkUrl()
 CMS_TABLEOBJ::getMenuIdColName()
 CMS_TABLEOBJ::getMenuIdGetName()
 CMS_TABLEOBJ::getMyMenuNode()
 CMS_TABLEOBJ::getMyPageObj()
 CMS_TABLEOBJ::getMyProject()
 CMS_TABLEOBJ::getNextMenuId()
 CMS_TABLEOBJ::getPageId()
 CMS_TABLEOBJ::getPageIdColName()
 CMS_TABLEOBJ::getPageIdGetName()
 CMS_TABLEOBJ::getPageSortColName()
 CMS_TABLEOBJ::getPageTable()
 CMS_TABLEOBJ::getPrevMenuId()
 CMS_TABLEOBJ::getProjId()
 CMS_TABLEOBJ::getProjIdColName()
 CMS_TABLEOBJ::getProjIdGetName()
 CMS_TABLEOBJ::get_currentMenu()
 CMS_TABLEOBJ::get_currentPage()
 CMS_TABLEOBJ::get_currentProj()
 CMS_TABLEOBJ::menuType_clearCache()
 CMS_TABLEOBJ::menuType_getClassSrc()
 CMS_TABLEOBJ::menuType_populate()
 CMS_TABLEOBJ::menuType_requireClass()
 CMS_TABLEOBJ::pageTmplType_getClassSrc()
 CMS_TABLEOBJ::pageTmplType_populate()
 CMS_TABLEOBJ::pageTmplType_requireClass()
 CMS_TABLEOBJ::pageType_getClassSrc()
 CMS_TABLEOBJ::pageType_getList()
 CMS_TABLEOBJ::pageType_getTmplClassName()
 CMS_TABLEOBJ::pageType_populate()
 CMS_TABLEOBJ::pageType_requireClass()
 CMS_TABLEOBJ::setCmsCacheArr()
 CMS_TABLEOBJ::setDBVal()
 CMS_TABLEOBJ::setLangId()
 CMS_TABLEOBJ::setMenId()
 CMS_TABLEOBJ::setMyMenuNode()
 CMS_TABLEOBJ::setMyPageObj()
 CMS_TABLEOBJ::setMyProject()
 CMS_TABLEOBJ::setPageId()
 CMS_TABLEOBJ::setProjId()
 CMS_TABLEOBJ::set_currentMenu()
 CMS_TABLEOBJ::set_currentPage()
 CMS_TABLEOBJ::set_currentProj()

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
CLASS_SRC_FILE = __FILE__ (line 58)
  • abstract:

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:39:59 +0100 by phpDocumentor 1.4.0a2