Class ilGlossaryTerm. More...
Public Member Functions | |
| ilGlossaryTerm ($a_id=0) | |
| Constructor public. | |
| read () | |
| read glossary term data | |
| _getIdForImportId ($a_import_id) | |
| get current term id for import id (static) | |
| _exists ($a_id) | |
| checks wether a glossary term with specified id exists or not | |
| setId ($a_id) | |
| set glossary term id (= glossary item id) | |
| getId () | |
| get term id (= glossary item id) | |
| setGlossary (&$a_glossary) | |
| set glossary object | |
| setGlossaryId ($a_glo_id) | |
| set glossary id | |
| getGlossaryId () | |
| get glossary id | |
| setTerm ($a_term) | |
| set term | |
| getTerm () | |
| get term | |
| setLanguage ($a_language) | |
| set language | |
| getLanguage () | |
| get language | |
| setImportId ($a_import_id) | |
| set import id | |
| getImportId () | |
| get import id | |
| create () | |
| create new glossary term | |
| delete () | |
| delete glossary term (and all its definition objects) | |
| update () | |
| update glossary term | |
| _lookGlossaryID ($term_id) | |
| get glossary id form term id | |
| _lookGlossaryTerm ($term_id) | |
| get glossary term | |
| _lookLanguage ($term_id) | |
| lookup term language | |
| getTermList ($a_glo_id, $searchterm="") | |
| static | |
| exportXML (&$a_xml_writer, $a_inst) | |
| export xml | |
Data Fields | |
| $ilias | |
| $lng | |
| $tpl | |
| $id | |
| $glossary | |
| $term | |
| $language | |
| $glo_id | |
| $import_id | |
Class ilGlossaryTerm.
Definition at line 33 of file class.ilGlossaryTerm.php.
| ilGlossaryTerm::_exists | ( | $ | a_id | ) |
checks wether a glossary term with specified id exists or not
| int | $id id |
Definition at line 119 of file class.ilGlossaryTerm.php.
References ilInternalLink::_extractObjIdOfTarget().
{
global $ilDB;
include_once("./Services/COPage/classes/class.ilInternalLink.php");
if (is_int(strpos($a_id, "_")))
{
$a_id = ilInternalLink::_extractObjIdOfTarget($a_id);
}
$q = "SELECT * FROM glossary_term WHERE id = ".$ilDB->quote($a_id);
$obj_set = $ilDB->query($q);
if ($obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC))
{
return true;
}
else
{
return false;
}
}
Here is the call graph for this function:| ilGlossaryTerm::_getIdForImportId | ( | $ | a_import_id | ) |
get current term id for import id (static)
| int | $a_import_id import id |
Definition at line 91 of file class.ilGlossaryTerm.php.
References $glo_id, ilObject::_hasUntrashedReference(), and _lookGlossaryID().
{
global $ilDB;
$q = "SELECT * FROM glossary_term WHERE import_id = ".$ilDB->quote($a_import_id).
" ORDER BY create_date DESC LIMIT 1";
$term_set = $ilDB->query($q);
while ($term_rec = $term_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$glo_id = ilGlossaryTerm::_lookGlossaryID($term_rec["id"]);
if (ilObject::_hasUntrashedReference($glo_id))
{
return $term_rec["id"];
}
}
return 0;
}
Here is the call graph for this function:| ilGlossaryTerm::_lookGlossaryID | ( | $ | term_id | ) |
get glossary id form term id
Definition at line 314 of file class.ilGlossaryTerm.php.
Referenced by ilObjGlossaryAccess::_checkGoto(), _getIdForImportId(), ilGlossaryTermGUI::_goto(), ilGlossaryDefinition::createMetaData(), ilGlossaryDefinition::deleteMetaData(), ilGlossaryDefinition::exportXMLMetaData(), ilGlossaryPresentationGUI::getLinkXML(), ilObjMediaObject::getParentObjectIdForUsage(), ilGlossaryDefinition::MDUpdateListener(), and ilGlossaryDefinition::updateMetaData().
{
global $ilDB;
$query = "SELECT * FROM glossary_term WHERE id = ".$ilDB->quote($term_id);
$obj_set = $ilDB->query($query);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec["glo_id"];
}
Here is the caller graph for this function:| ilGlossaryTerm::_lookGlossaryTerm | ( | $ | term_id | ) |
get glossary term
Definition at line 328 of file class.ilGlossaryTerm.php.
Referenced by ilSearchResultPresentationGUI::__appendChildLinks(), ilObjGlossaryGUI::getTemplate(), SurveyQuestion::setMaterial(), and ilLMPresentationGUI::showPrintView().
{
global $ilDB;
$query = "SELECT * FROM glossary_term WHERE id = ".$ilDB->quote($term_id);
$obj_set = $ilDB->query($query);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec["term"];
}
Here is the caller graph for this function:| ilGlossaryTerm::_lookLanguage | ( | $ | term_id | ) |
lookup term language
Definition at line 342 of file class.ilGlossaryTerm.php.
Referenced by ilGlossaryDefinition::createMetaData().
{
global $ilDB;
$query = "SELECT * FROM glossary_term WHERE id = ".$ilDB->quote($term_id);
$obj_set = $ilDB->query($query);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec["language"];
}
Here is the caller graph for this function:| ilGlossaryTerm::create | ( | ) |
create new glossary term
Definition at line 261 of file class.ilGlossaryTerm.php.
References getGlossaryId(), getImportId(), and setId().
{
global $ilDB;
$q = "INSERT INTO glossary_term (glo_id, term, language, import_id, create_date, last_update)".
" VALUES (".$ilDB->quote($this->getGlossaryId()).", ".
$ilDB->quote($this->term).
", ".$ilDB->quote($this->language).",".$ilDB->quote($this->getImportId()).",now(), now())";
$this->ilias->db->query($q);
$this->setId($this->ilias->db->getLastInsertId());
}
Here is the call graph for this function:| ilGlossaryTerm::delete | ( | ) |
delete glossary term (and all its definition objects)
Definition at line 277 of file class.ilGlossaryTerm.php.
References ilGlossaryDefinition::getDefinitionList(), and getId().
{
global $ilDB;
require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
$defs = ilGlossaryDefinition::getDefinitionList($this->getId());
foreach($defs as $def)
{
$def_obj =& new ilGlossaryDefinition($def["id"]);
$def_obj->delete();
}
$q = "DELETE FROM glossary_term ".
" WHERE id = ".$ilDB->quote($this->getId());
$this->ilias->db->query($q);
}
Here is the call graph for this function:| ilGlossaryTerm::exportXML | ( | &$ | a_xml_writer, | |
| $ | a_inst | |||
| ) |
export xml
Definition at line 394 of file class.ilGlossaryTerm.php.
References ilGlossaryDefinition::getDefinitionList(), getId(), getLanguage(), and getTerm().
{
$attrs = array();
$attrs["Language"] = $this->getLanguage();
$attrs["Id"] = "il_".IL_INST_ID."_git_".$this->getId();
$a_xml_writer->xmlStartTag("GlossaryItem", $attrs);
$attrs = array();
$a_xml_writer->xmlElement("GlossaryTerm", $attrs, $this->getTerm());
$defs = ilGlossaryDefinition::getDefinitionList($this->getId());
foreach($defs as $def)
{
$definition = new ilGlossaryDefinition($def["id"]);
$definition->exportXML($a_xml_writer, $a_inst);
}
$a_xml_writer->xmlEndTag("GlossaryItem");
}
Here is the call graph for this function:| ilGlossaryTerm::getGlossaryId | ( | ) |
get glossary id
Definition at line 192 of file class.ilGlossaryTerm.php.
Referenced by create(), and update().
{
return $this->glo_id;
}
Here is the caller graph for this function:| ilGlossaryTerm::getId | ( | ) |
get term id (= glossary item id)
Definition at line 159 of file class.ilGlossaryTerm.php.
Referenced by delete(), exportXML(), and update().
{
return $this->id;
}
Here is the caller graph for this function:| ilGlossaryTerm::getImportId | ( | ) |
get import id
Definition at line 252 of file class.ilGlossaryTerm.php.
Referenced by create(), and update().
{
return $this->import_id;
}
Here is the caller graph for this function:| ilGlossaryTerm::getLanguage | ( | ) |
get language
Definition at line 234 of file class.ilGlossaryTerm.php.
Referenced by exportXML(), and update().
{
return $this->language;
}
Here is the caller graph for this function:| ilGlossaryTerm::getTerm | ( | ) |
get term
Definition at line 214 of file class.ilGlossaryTerm.php.
Referenced by exportXML(), and update().
{
return $this->term;
}
Here is the caller graph for this function:| ilGlossaryTerm::getTermList | ( | $ | a_glo_id, | |
| $ | searchterm = "" | |||
| ) |
static
public
| integer/array | $a_glo_id array of glossary ids for meta glossaries | |
| string | $searchterm searchstring |
Definition at line 360 of file class.ilGlossaryTerm.php.
{
global $ilDB;
$terms = array();
$searchterm = (!empty ($searchterm))
? " AND term like ".$ilDB->quote("%".$searchterm."%")." "
: "";
// meta glossary
if (is_array($a_glo_id))
{
$where = "IN(".implode(",",$a_glo_id).") ";
}
else
{
$where = "= ".$ilDB->quote($a_glo_id)." ";
}
$q = "SELECT * FROM glossary_term WHERE glo_id ".$where.$searchterm." ORDER BY language, term";
$term_set = $ilDB->query($q);
while ($term_rec = $term_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$terms[] = array("term" => $term_rec["term"],
"language" => $term_rec["language"], "id" => $term_rec["id"], "glo_id" => $term_rec["glo_id"]);
}
return $terms;
}
| ilGlossaryTerm::ilGlossaryTerm | ( | $ | a_id = 0 |
) |
Constructor public.
Definition at line 50 of file class.ilGlossaryTerm.php.
References $ilias, $lng, $tpl, and read().
{
global $lng, $ilias, $tpl;
$this->lng =& $lng;
$this->ilias =& $ilias;
$this->tpl =& $tpl;
$this->id = $a_id;
$this->type = "term";
if ($a_id != 0)
{
$this->read();
}
}
Here is the call graph for this function:| ilGlossaryTerm::read | ( | ) |
read glossary term data
Definition at line 69 of file class.ilGlossaryTerm.php.
References setGlossaryId(), setImportId(), setLanguage(), and setTerm().
Referenced by ilGlossaryTerm().
{
global $ilDB;
$q = "SELECT * FROM glossary_term WHERE id = ".$ilDB->quote($this->id);
$term_set = $this->ilias->db->query($q);
$term_rec = $term_set->fetchRow(DB_FETCHMODE_ASSOC);
$this->setTerm($term_rec["term"]);
$this->setImportId($term_rec["import_id"]);
$this->setLanguage($term_rec["language"]);
$this->setGlossaryId($term_rec["glo_id"]);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilGlossaryTerm::setGlossary | ( | &$ | a_glossary | ) |
set glossary object
| object | $a_glossary glossary object |
Definition at line 169 of file class.ilGlossaryTerm.php.
References setGlossaryId().
{
$this->glossary =& $a_glossary;
$this->setGlossaryId($a_glossary->getId());
}
Here is the call graph for this function:| ilGlossaryTerm::setGlossaryId | ( | $ | a_glo_id | ) |
set glossary id
| int | $a_glo_id glossary id |
Definition at line 181 of file class.ilGlossaryTerm.php.
Referenced by read(), and setGlossary().
{
$this->glo_id = $a_glo_id;
}
Here is the caller graph for this function:| ilGlossaryTerm::setId | ( | $ | a_id | ) |
set glossary term id (= glossary item id)
| int | $a_id glossary term id |
Definition at line 148 of file class.ilGlossaryTerm.php.
Referenced by create().
{
$this->id = $a_id;
}
Here is the caller graph for this function:| ilGlossaryTerm::setImportId | ( | $ | a_import_id | ) |
set import id
Definition at line 243 of file class.ilGlossaryTerm.php.
Referenced by read().
{
$this->import_id = $a_import_id;
}
Here is the caller graph for this function:| ilGlossaryTerm::setLanguage | ( | $ | a_language | ) |
set language
| string | $a_language two letter language code |
Definition at line 225 of file class.ilGlossaryTerm.php.
Referenced by read().
{
$this->language = $a_language;
}
Here is the caller graph for this function:| ilGlossaryTerm::setTerm | ( | $ | a_term | ) |
set term
| string | $a_term term |
Definition at line 203 of file class.ilGlossaryTerm.php.
Referenced by read().
{
$this->term = $a_term;
}
Here is the caller graph for this function:| ilGlossaryTerm::update | ( | ) |
update glossary term
Definition at line 297 of file class.ilGlossaryTerm.php.
References getGlossaryId(), getId(), getImportId(), getLanguage(), and getTerm().
{
global $ilDB;
$q = "UPDATE glossary_term SET ".
" glo_id = ".$ilDB->quote($this->getGlossaryId()).", ".
" term = ".$ilDB->quote($this->getTerm()).", ".
" import_id = ".$ilDB->quote($this->getImportId()).", ".
" language = ".$ilDB->quote($this->getLanguage()).", ".
" last_update = now() ".
" WHERE id = ".$ilDB->quote($this->getId());
$this->ilias->db->query($q);
}
Here is the call graph for this function:| ilGlossaryTerm::$glo_id |
Definition at line 43 of file class.ilGlossaryTerm.php.
Referenced by _getIdForImportId().
| ilGlossaryTerm::$glossary |
Definition at line 40 of file class.ilGlossaryTerm.php.
| ilGlossaryTerm::$id |
Definition at line 39 of file class.ilGlossaryTerm.php.
| ilGlossaryTerm::$ilias |
Definition at line 35 of file class.ilGlossaryTerm.php.
Referenced by ilGlossaryTerm().
| ilGlossaryTerm::$import_id |
Definition at line 44 of file class.ilGlossaryTerm.php.
| ilGlossaryTerm::$language |
Definition at line 42 of file class.ilGlossaryTerm.php.
| ilGlossaryTerm::$lng |
Definition at line 36 of file class.ilGlossaryTerm.php.
Referenced by ilGlossaryTerm().
| ilGlossaryTerm::$term |
Definition at line 41 of file class.ilGlossaryTerm.php.
| ilGlossaryTerm::$tpl |
Definition at line 37 of file class.ilGlossaryTerm.php.
Referenced by ilGlossaryTerm().
1.7.1