mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-10 11:02:41 +00:00
- renamed class KeywordCategories to LetoDMS_KeywordCategories
This commit is contained in:
parent
0e30ce6eb3
commit
f14f5f3bf5
|
@ -17,6 +17,40 @@
|
||||||
// along with this program; if not, write to the Free Software
|
// along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
function getKeywordCategory($id) {
|
||||||
|
return LetoDMS_KeywordCategory::getKeywordCategory($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getKeywordCategoryByName($name, $owner) {
|
||||||
|
return LetoDMS_KeywordCategory::getKeywordCategoryByName($name, $owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAllKeywordCategories($userID = -1) {
|
||||||
|
return LetoDMS_KeywordCategory::getAllKeywordCategories($userID = -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAllUserKeywordCategories($userID) {
|
||||||
|
return LetoDMS_KeywordCategory::getAllUserKeywordCategories($userID);
|
||||||
|
}
|
||||||
|
|
||||||
|
function addKeywordCategory($owner, $name) {
|
||||||
|
return LetoDMS_KeywordCategory::addKeywordCategory($owner, $name);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------
|
||||||
|
class LetoDMS_KeywordCategory
|
||||||
|
{
|
||||||
|
var $_id;
|
||||||
|
var $_ownerID;
|
||||||
|
var $_name;
|
||||||
|
|
||||||
|
function LetoDMS_KeywordCategory($id, $ownerID, $name)
|
||||||
|
{
|
||||||
|
$this->_id = $id;
|
||||||
|
$this->_name = $name;
|
||||||
|
$this->_ownerID = $ownerID;
|
||||||
|
}
|
||||||
|
|
||||||
function getKeywordCategory($id) {
|
function getKeywordCategory($id) {
|
||||||
GLOBAL $db;
|
GLOBAL $db;
|
||||||
|
|
||||||
|
@ -29,7 +63,7 @@ function getKeywordCategory($id) {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$resArr = $resArr[0];
|
$resArr = $resArr[0];
|
||||||
return new Keywordcategory($resArr["id"], $resArr["owner"], $resArr["name"]);
|
return new LetoDMS_Keywordcategory($resArr["id"], $resArr["owner"], $resArr["name"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getKeywordCategoryByName($name, $owner) {
|
function getKeywordCategoryByName($name, $owner) {
|
||||||
|
@ -41,7 +75,7 @@ function getKeywordCategoryByName($name, $owner) {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$resArr = $resArr[0];
|
$resArr = $resArr[0];
|
||||||
return new Keywordcategory($resArr["id"], $resArr["owner"], $resArr["name"]);
|
return new LetoDMS_Keywordcategory($resArr["id"], $resArr["owner"], $resArr["name"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAllKeywordCategories($userID = -1) {
|
function getAllKeywordCategories($userID = -1) {
|
||||||
|
@ -57,7 +91,7 @@ function getAllKeywordCategories($userID = -1) {
|
||||||
|
|
||||||
$categories = array();
|
$categories = array();
|
||||||
foreach ($resArr as $row)
|
foreach ($resArr as $row)
|
||||||
array_push($categories, new KeywordCategory($row["id"], $row["owner"], $row["name"]));
|
array_push($categories, new LetoDMS_KeywordCategory($row["id"], $row["owner"], $row["name"]));
|
||||||
|
|
||||||
return $categories;
|
return $categories;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +109,7 @@ function getAllUserKeywordCategories($userID) {
|
||||||
|
|
||||||
$categories = array();
|
$categories = array();
|
||||||
foreach ($resArr as $row)
|
foreach ($resArr as $row)
|
||||||
array_push($categories, new KeywordCategory($row["id"], $row["owner"], $row["name"]));
|
array_push($categories, new LetoDMS_KeywordCategory($row["id"], $row["owner"], $row["name"]));
|
||||||
|
|
||||||
return $categories;
|
return $categories;
|
||||||
}
|
}
|
||||||
|
@ -83,28 +117,14 @@ function getAllUserKeywordCategories($userID) {
|
||||||
function addKeywordCategory($owner, $name) {
|
function addKeywordCategory($owner, $name) {
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
if (is_object(getKeywordCategoryByName($name, owner))) {
|
if (is_object(self::getKeywordCategoryByName($name, owner))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$queryStr = "INSERT INTO tblKeywordCategories (owner, name) VALUES ($owner, '$name')";
|
$queryStr = "INSERT INTO tblKeywordCategories (owner, name) VALUES ($owner, '$name')";
|
||||||
if (!$db->getResult($queryStr))
|
if (!$db->getResult($queryStr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return getKeywordCategory($db->getInsertID());
|
return self::getKeywordCategory($db->getInsertID());
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------
|
|
||||||
class KeywordCategory
|
|
||||||
{
|
|
||||||
var $_id;
|
|
||||||
var $_ownerID;
|
|
||||||
var $_name;
|
|
||||||
|
|
||||||
function KeywordCategory($id, $ownerID, $name)
|
|
||||||
{
|
|
||||||
$this->_id = $id;
|
|
||||||
$this->_name = $name;
|
|
||||||
$this->_ownerID = $ownerID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getID() { return $this->_id; }
|
function getID() { return $this->_id; }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user