Commit 1a4ff27da3a8a57e87faaadb8b30eff162ae6194
1 parent
79d83dff
Syntax correction
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@380 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
101 additions
and
1 deletions
lib/web/WebDocument.inc
| @@ -125,5 +125,32 @@ class WebDocument { | @@ -125,5 +125,32 @@ class WebDocument { | ||
| 125 | return false; | 125 | return false; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | + /** | ||
| 129 | + * Static function | ||
| 130 | + * Get a list of web documents | ||
| 131 | + * | ||
| 132 | + * @param String Where clause (not required) | ||
| 133 | + * | ||
| 134 | + * @return Array array of WebDocument objects, false otherwise and set $_SESSION["errorMessage"] | ||
| 135 | + */ | ||
| 136 | + function getList($sWhereClause = null) { | ||
| 137 | + global $default, $lang_err_database; | ||
| 138 | + $aWebDocumentArray; | ||
| 139 | + settype($aWebDocumentArray, "array"); | ||
| 140 | + $sql = new Owl_DB(); | ||
| 141 | + $result = $sql->query("SELECT * FROM " . $default->owl_web_documents_table . (isset($sWhereClause) ? " " . $sWhereClause : "")); | ||
| 142 | + if ($result) { | ||
| 143 | + $iCount = 0; | ||
| 144 | + while ($sql->next_record()) { | ||
| 145 | + $oWebDocument = & WebDocument::get($sql->f("id")); | ||
| 146 | + $aWebDocumentArray[$iCount] = $oWebDocument; | ||
| 147 | + $iCount++; | ||
| 148 | + } | ||
| 149 | + return $aWebDocumentArray; | ||
| 150 | + } | ||
| 151 | + $_SESSION["errorMessage"] = $lang_err_database; | ||
| 152 | + return false; | ||
| 153 | + } | ||
| 154 | + | ||
| 128 | } | 155 | } |
| 129 | ?> | 156 | ?> |
lib/web/WebSite.inc
| @@ -7,7 +7,9 @@ | @@ -7,7 +7,9 @@ | ||
| 7 | * Represents a web site as per the web_sites database table | 7 | * Represents a web site as per the web_sites database table |
| 8 | * | 8 | * |
| 9 | * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | 9 | * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa |
| 10 | -* @date 20 January 2003 | 10 | +* @date 20 January 2003 |
| 11 | +* | ||
| 12 | +* @todo - add regex parsing to ensure URL is valid | ||
| 11 | */ | 13 | */ |
| 12 | 14 | ||
| 13 | class WebSite { | 15 | class WebSite { |
| @@ -38,6 +40,77 @@ class WebSite { | @@ -38,6 +40,77 @@ class WebSite { | ||
| 38 | } | 40 | } |
| 39 | 41 | ||
| 40 | /** | 42 | /** |
| 43 | + * Get the primary key for this object | ||
| 44 | + * | ||
| 45 | + * @return int primary key for this object | ||
| 46 | + * | ||
| 47 | + */ | ||
| 48 | + function getID() { | ||
| 49 | + return $this->iId; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * Get the web site name | ||
| 54 | + * | ||
| 55 | + * @return String web site name | ||
| 56 | + * | ||
| 57 | + */ | ||
| 58 | + function getWebSiteName() { | ||
| 59 | + return $this->sWebSiteName; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * Set the web site name | ||
| 64 | + * | ||
| 65 | + * @param String Web site name | ||
| 66 | + * | ||
| 67 | + */ | ||
| 68 | + function setWebSiteName($sNewValue) { | ||
| 69 | + $this->sWebSiteName = $sNewValue; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * Get the web site URL | ||
| 74 | + * | ||
| 75 | + * @return String web site URL | ||
| 76 | + * | ||
| 77 | + */ | ||
| 78 | + function getWebSiteURL() { | ||
| 79 | + return $this->sWebSiteURL; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * Set the web site URL | ||
| 84 | + * | ||
| 85 | + * @param String Web site URL | ||
| 86 | + * | ||
| 87 | + */ | ||
| 88 | + function setWebSiteURL($sNewValue) { | ||
| 89 | + $this->sWebSiteURL = $sNewValue; | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + /** | ||
| 93 | + * Get the primary key of the user that is the web master | ||
| 94 | + * | ||
| 95 | + * @return int primary key of user that is the web master | ||
| 96 | + * | ||
| 97 | + */ | ||
| 98 | + function getWebMasterID() { | ||
| 99 | + return $this->iWebMasterID; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + /** | ||
| 103 | + * Set the web master id | ||
| 104 | + * | ||
| 105 | + * @param int Primary key of user that is web master | ||
| 106 | + * | ||
| 107 | + */ | ||
| 108 | + function setWebMasterID() { | ||
| 109 | + $this->iWebMasterID = $iNewValue; | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + | ||
| 113 | + /** | ||
| 41 | * Create the current object in the database | 114 | * Create the current object in the database |
| 42 | * | 115 | * |
| 43 | * @return boolean on successful store, false otherwise and set $_SESSION["errorMessage"] | 116 | * @return boolean on successful store, false otherwise and set $_SESSION["errorMessage"] |