Commit 458c4d8c5fe143f6c2763689a7f25828682ca786
1 parent
3d88a0a1
Represents the entries in the help table - maps sections to filenames
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3475 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
62 additions
and
0 deletions
lib/help/helpentity.inc.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once(KT_LIB_DIR . "/ktentity.inc"); | ||
| 4 | +require_once(KT_LIB_DIR . "/help/helpreplacement.inc.php"); | ||
| 5 | + | ||
| 6 | +class KTHelpEntity extends KTEntity { | ||
| 7 | + /** primary key */ | ||
| 8 | + var $iId = -1; | ||
| 9 | + /** help file name */ | ||
| 10 | + var $sSection; | ||
| 11 | + /** replacement string */ | ||
| 12 | + var $sFilename; | ||
| 13 | + | ||
| 14 | + var $_aFieldToSelect = array( | ||
| 15 | + "iId" => "id", | ||
| 16 | + "sSection" => "fSection", | ||
| 17 | + "sFilename" => "help_info", | ||
| 18 | + ); | ||
| 19 | + | ||
| 20 | + var $_bUsePearError = true; | ||
| 21 | + | ||
| 22 | + function getID() { return $this->iId; } | ||
| 23 | + function getSection() { return $this->sSection; } | ||
| 24 | + function getFilename() { return $this->sFilename; } | ||
| 25 | + function setID($iId) { $this->iId = $iId; } | ||
| 26 | + function setSection($sSection) { $this->sSection = $sSection; } | ||
| 27 | + function setFilename($sFilename) { $this->sFilename = $sFilename; } | ||
| 28 | + | ||
| 29 | + function _table () { | ||
| 30 | + global $default; | ||
| 31 | + return $default->help_table; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + // STATIC | ||
| 35 | + function &get($iId) { | ||
| 36 | + return KTEntityUtil::get('KTHelpEntity', $iId); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + // STATIC | ||
| 40 | + function &createFromArray($aOptions) { | ||
| 41 | + return KTEntityUtil::createFromArray('KTHelpEntity', $aOptions); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + function &getList($sWhereClause = null) { | ||
| 45 | + global $default; | ||
| 46 | + return KTEntityUtil::getList($default->help_table, 'KTHelpEntity', $sWhereClause); | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + function checkReplacement() { | ||
| 50 | + $oHelpReplacement = KTHelpReplacement::getByName($this->sFilename); | ||
| 51 | + if (PEAR::isError($oHelpReplacement)) { | ||
| 52 | + return false; | ||
| 53 | + } | ||
| 54 | + return $oHelpReplacement; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + function &getByFilename($sFilename) { | ||
| 58 | + return KTEntityUtil::getBy('KTHelpEntity', 'help_info', $sFilename); | ||
| 59 | + } | ||
| 60 | +} | ||
| 61 | + | ||
| 62 | +?> |