ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilGlossaryDefinition Class Reference

Class ilGlossaryDefinition. More...

+ Collaboration diagram for ilGlossaryDefinition:

Public Member Functions

 ilGlossaryDefinition ($a_id=0)
 Constructor public.
 read ()
 read data of content object
 setId ($a_id)
 getId ()
 getType ()
 setTermId ($a_term_id)
 getTermId ()
 setShortText ($a_text)
 getShortText ()
 setNr ($a_nr)
 getNr ()
 assignPageObject (&$a_page_object)
getPageObject ()
 getTitle ()
 get title of content object
 setTitle ($a_title)
 set title of content object
 getDescription ()
 Get description.
 setDescription ($a_description)
 Set description.
 setShortTextDirty ($a_val)
 Set short text dirty.
 getShortTextDirty ()
 Get short text dirty.
 create ($a_upload=false)
 Create definition.
 delete ()
 moveUp ()
 moveDown ()
 update ()
 shortenShortText ($text)
 Shorten short text.
 updateShortText ()
 getDefinitionList ($a_term_id)
 static
 exportXML (&$a_xml_writer, $a_inst)
 export xml
 exportXMLMetaData (&$a_xml_writer)
 export content objects meta data to xml (see ilias_co.dtd)
 modifyExportIdentifier ($a_tag, $a_param, $a_value)
 exportXMLDefinition (&$a_xml_writer, $a_inst=0)
 export page objects meta data to xml (see ilias_co.dtd)
 createMetaData ()
 create meta data entry
 updateMetaData ()
 update meta data entry
 deleteMetaData ()
 delete meta data entry
 MDUpdateListener ($a_element)
 Meta data update listener.
 _lookupTermId ($a_def_id)
 Looks up term id for a definition id.

Static Public Member Functions

static setShortTextsDirty ($a_glo_id)
 Set short texts dirty.

Data Fields

 $ilias
 $lng
 $tpl
 $id
 $term_id
 $glo_id
 $page_object
 $short_text
 $nr
 $short_text_dirty = false

Detailed Description

Class ilGlossaryDefinition.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilGlossaryDefinition.php 26340 2010-11-08 06:41:49Z akill

Definition at line 14 of file class.ilGlossaryDefinition.php.

Member Function Documentation

ilGlossaryDefinition::_lookupTermId (   $a_def_id)

Looks up term id for a definition id.

Parameters
int$a_def_iddefinition id

Definition at line 641 of file class.ilGlossaryDefinition.php.

References $ilDB.

Referenced by ilWebAccessChecker\checkAccessGlossaryTerm(), ilTermUsagesTableGUI\fillRow(), ilMediaPoolPageUsagesTableGUI\fillRow(), ilMediaObjectUsagesTableGUI\fillRow(), ilObjMediaObject\getParentObjectIdForUsage(), and ilLMContentSearch\performSearch().

{
global $ilDB;
$q = "SELECT * FROM glossary_definition WHERE id = ".
$ilDB->quote($a_def_id, "integer");
$def_set = $ilDB->query($q);
$def_rec = $ilDB->fetchAssoc($def_set);
return $def_rec["term_id"];
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::assignPageObject ( $a_page_object)

Definition at line 112 of file class.ilGlossaryDefinition.php.

{
$this->page_object =& $a_page_object;
}
ilGlossaryDefinition::create (   $a_upload = false)

Create definition.

Parameters
booleanupload true/false

Definition at line 184 of file class.ilGlossaryDefinition.php.

References $ilDB, createMetaData(), getId(), getShortTextDirty(), getTermId(), ilDB\LOCK_WRITE, setId(), and setNr().

{
global $ilDB;
$term =& new ilGlossaryTerm($this->getTermId());
$this->setId($ilDB->nextId("glossary_definition"));
// lock glossary_definition table
$ilDB->lockTables(
array(
0 => array('name' => 'glossary_definition', 'type' => ilDB::LOCK_WRITE)));
// get maximum definition number
$q = "SELECT max(nr) AS max_nr FROM glossary_definition WHERE term_id = ".
$ilDB->quote($this->getTermId(), "integer");
$max_set = $ilDB->query($q);
$max_rec = $ilDB->fetchAssoc($max_set);
$max = (int) $max_rec["max_nr"];
// insert new definition record
$ilDB->manipulate("INSERT INTO glossary_definition (id, term_id, short_text, nr, short_text_dirty)".
" VALUES (".
$ilDB->quote($this->getId(), "integer").",".
$ilDB->quote($this->getTermId(), "integer").",".
$ilDB->quote($this->getShortText(), "text").", ".
$ilDB->quote(($max + 1), "integer").", ".
$ilDB->quote($this->getShortTextDirty(), "integer").
")");
// unlock glossary definition table
$ilDB->unlockTables();
// get number
$q = "SELECT nr FROM glossary_definition WHERE id = ".
$ilDB->quote($this->id, "integer");
$def_set = $ilDB->query($q);
$def_rec = $ilDB->fetchAssoc($def_set);
$this->setNr($def_rec["nr"]);
// meta data will be created by
// import parser
if (!$a_upload)
{
$this->createMetaData();
}
$this->page_object =& new ilPageObject("gdf");
$this->page_object->setId($this->getId());
$this->page_object->setParentId($term->getGlossaryId());
$this->page_object->create();
}

+ Here is the call graph for this function:

ilGlossaryDefinition::createMetaData ( )

create meta data entry

Definition at line 533 of file class.ilGlossaryDefinition.php.

References $glo_id, $lang, ilGlossaryTerm\_lookGlossaryID(), ilGlossaryTerm\_lookLanguage(), getDescription(), getId(), getTermId(), getTitle(), and getType().

Referenced by create().

{
include_once 'Services/MetaData/classes/class.ilMDCreator.php';
global $ilUser;
$md_creator = new ilMDCreator($glo_id,$this->getId(),$this->getType());
$md_creator->setTitle($this->getTitle());
$md_creator->setTitleLanguage($lang);
$md_creator->setDescription($this->getDescription());
$md_creator->setDescriptionLanguage($lang);
$md_creator->setKeywordLanguage($lang);
$md_creator->setLanguage($lang);
//echo "-".$this->getTitle()."-"; exit;
$md_creator->create();
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGlossaryDefinition::delete ( )

Definition at line 237 of file class.ilGlossaryDefinition.php.

References $ilDB, deleteMetaData(), ilDB\LOCK_WRITE, and setNr().

{
global $ilDB;
// lock glossary_definition table
#ilDB::_lockTables(array('glossary_definition' => 'WRITE'));
$ilDB->lockTables(
array(
0 => array('name' => 'glossary_definition', 'type' => ilDB::LOCK_WRITE)));
// be sure to get the right number
$q = "SELECT * FROM glossary_definition WHERE id = ".
$ilDB->quote($this->id, "integer");
$def_set = $ilDB->query($q);
$def_rec = $ilDB->fetchAssoc($def_set);
$this->setNr($def_rec["nr"]);
// update numbers of other definitions
$ilDB->manipulate("UPDATE glossary_definition SET ".
" nr = nr - 1 ".
" WHERE term_id = ".$ilDB->quote($this->getTermId(), "integer")." ".
" AND nr > ".$ilDB->quote($this->getNr(), "integer"));
// delete current definition
$ilDB->manipulate("DELETE FROM glossary_definition ".
" WHERE id = ".$ilDB->quote($this->getId(), "integer"));
// unlock glossary_definition table
$ilDB->unlockTables();
// delete page and meta data
$this->page_object->delete();
// delete meta data
$this->deleteMetaData();
/*
$nested = new ilNestedSetXML();
$nested->init($this->getId(), $this->getType());
$nested->deleteAllDBData();
*/
}

+ Here is the call graph for this function:

ilGlossaryDefinition::deleteMetaData ( )

delete meta data entry

Definition at line 582 of file class.ilGlossaryDefinition.php.

References $glo_id, ilGlossaryTerm\_lookGlossaryID(), getId(), getTermId(), and getType().

Referenced by delete().

{
// Delete meta data
include_once('Services/MetaData/classes/class.ilMD.php');
$md = new ilMD($glo_id, $this->getId(), $this->getType());
$md->deleteAll();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGlossaryDefinition::exportXML ( $a_xml_writer,
  $a_inst 
)

export xml

Definition at line 468 of file class.ilGlossaryDefinition.php.

References exportXMLDefinition(), and exportXMLMetaData().

{
$attrs = array();
$a_xml_writer->xmlStartTag("Definition", $attrs);
$this->exportXMLMetaData($a_xml_writer);
$this->exportXMLDefinition($a_xml_writer, $a_inst);
$a_xml_writer->xmlEndTag("Definition");
}

+ Here is the call graph for this function:

ilGlossaryDefinition::exportXMLDefinition ( $a_xml_writer,
  $a_inst = 0 
)

export page objects meta data to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 516 of file class.ilGlossaryDefinition.php.

Referenced by exportXML().

{
$this->page_object->buildDom();
$this->page_object->insertInstIntoIDs($a_inst);
$this->mobs_contained = $this->page_object->collectMediaObjects(false);
$this->files_contained = $this->page_object->collectFileItems();
$xml = $this->page_object->getXMLFromDom(false, false, false, "", true);
$xml = str_replace("&","&", $xml);
$a_xml_writer->appendXML($xml);
$this->page_object->freeDom();
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::exportXMLMetaData ( $a_xml_writer)

export content objects meta data to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 486 of file class.ilGlossaryDefinition.php.

References $glo_id, ilGlossaryTerm\_lookGlossaryID(), getId(), getTermId(), and getType().

Referenced by exportXML().

{
include_once("Services/MetaData/classes/class.ilMD2XML.php");
$md2xml = new ilMD2XML($glo_id, $this->getId(), $this->getType());
$md2xml->setExportMode(true);
$md2xml->startExport();
$a_xml_writer->appendXML($md2xml->getXML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGlossaryDefinition::getDefinitionList (   $a_term_id)

static

Definition at line 445 of file class.ilGlossaryDefinition.php.

References $ilDB.

Referenced by ilGlossaryTerm\_copyTerm(), ilSoapGLOStructureReader\_parseStructure(), ilGlossaryTerm\delete(), ilObjGlossary\exportHTMLGlossaryTerms(), ilObjContentObject\exportHTMLGlossaryTerms(), ilSCORM2004Asset\exportHTMLPageObjects(), ilGlossaryTerm\exportXML(), ilObjGlossary\exportXML(), ilTermListTableGUI\fillRow(), ilPresentationListTableGUI\fillRow(), ilGlossaryTermGUI\getInternalLinks(), ilGlossaryTermGUI\listDefinitions(), ilGlossaryPresentationGUI\listDefinitions(), ilGlossaryPresentationGUI\listTermByGiven(), ilGlossaryTermGUI\output(), ilObjGlossaryGUI\quickList(), and ilLMPresentationGUI\showPrintView().

{
global $ilDB;
$defs = array();
$q = "SELECT * FROM glossary_definition WHERE term_id = ".
$ilDB->quote($a_term_id, "integer").
" ORDER BY nr";
$def_set = $ilDB->query($q);
while ($def_rec = $ilDB->fetchAssoc($def_set))
{
$defs[] = array("term_id" => $def_rec["term_id"],
"page_id" => $def_rec["page_id"], "id" => $def_rec["id"],
"short_text" => strip_tags($def_rec["short_text"], "<br>"),
"nr" => $def_rec["nr"],
"short_text_dirty" => $def_rec["short_text_dirty"]);
}
return $defs;
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::getDescription ( )

Get description.

Returns
string description

Definition at line 145 of file class.ilGlossaryDefinition.php.

Referenced by createMetaData(), and updateMetaData().

{
return $this->description;
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::getId ( )

Definition at line 72 of file class.ilGlossaryDefinition.php.

References $id.

Referenced by create(), createMetaData(), deleteMetaData(), exportXMLMetaData(), MDUpdateListener(), modifyExportIdentifier(), and updateMetaData().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::getNr ( )

Definition at line 107 of file class.ilGlossaryDefinition.php.

References $nr.

Referenced by moveDown(), and moveUp().

{
return $this->nr;
}

+ Here is the caller graph for this function:

& ilGlossaryDefinition::getPageObject ( )

Definition at line 117 of file class.ilGlossaryDefinition.php.

References $page_object.

{
}
ilGlossaryDefinition::getShortText ( )

Definition at line 97 of file class.ilGlossaryDefinition.php.

References $short_text.

{
}
ilGlossaryDefinition::getShortTextDirty ( )

Get short text dirty.

Returns
boolean short text dirty

Definition at line 175 of file class.ilGlossaryDefinition.php.

References $short_text_dirty.

Referenced by create().

+ Here is the caller graph for this function:

ilGlossaryDefinition::getTermId ( )

Definition at line 87 of file class.ilGlossaryDefinition.php.

References $term_id.

Referenced by create(), createMetaData(), deleteMetaData(), exportXMLMetaData(), MDUpdateListener(), moveDown(), shortenShortText(), and updateMetaData().

{
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::getTitle ( )

get title of content object

Returns
string title

Definition at line 127 of file class.ilGlossaryDefinition.php.

References $title.

Referenced by createMetaData(), and updateMetaData().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::getType ( )

Definition at line 77 of file class.ilGlossaryDefinition.php.

Referenced by createMetaData(), deleteMetaData(), exportXMLMetaData(), MDUpdateListener(), and updateMetaData().

{
return "gdf";
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::ilGlossaryDefinition (   $a_id = 0)

Constructor public.

Definition at line 32 of file class.ilGlossaryDefinition.php.

References $ilias, $lng, $tpl, and read().

{
global $lng, $ilias, $tpl;
$this->lng =& $lng;
$this->ilias =& $ilias;
$this->tpl =& $tpl;
$this->id = $a_id;
if ($a_id != 0)
{
$this->read();
}
}

+ Here is the call graph for this function:

ilGlossaryDefinition::MDUpdateListener (   $a_element)

Meta data update listener.

Important note: Do never call create() or update() method of ilObject here. It would result in an endless loop: update object -> update meta -> update object -> ... Use static _writeTitle() ... methods instead.

Even if this is not stored to db, it should be stored to the object e.g. for during import parsing

Parameters
string$a_element

Definition at line 605 of file class.ilGlossaryDefinition.php.

References $glo_id, $id, ilGlossaryTerm\_lookGlossaryID(), getId(), getTermId(), getType(), setDescription(), and setTitle().

{
include_once 'Services/MetaData/classes/class.ilMD.php';
switch($a_element)
{
case 'General':
// Update Title and description
$md =& new ilMD($glo_id, $this->getId(), $this->getType());
$md_gen = $md->getGeneral();
//ilObject::_writeTitle($this->getId(),$md_gen->getTitle());
$this->setTitle($md_gen->getTitle());
foreach($md_gen->getDescriptionIds() as $id)
{
$md_des = $md_gen->getDescription($id);
//ilObject::_writeDescription($this->getId(),$md_des->getDescription());
$this->setDescription($md_des->getDescription());
break;
}
break;
default:
}
return true;
}

+ Here is the call graph for this function:

ilGlossaryDefinition::modifyExportIdentifier (   $a_tag,
  $a_param,
  $a_value 
)

Definition at line 499 of file class.ilGlossaryDefinition.php.

References getId().

{
if ($a_tag == "Identifier" && $a_param == "Entry")
{
$a_value = "il_".IL_INST_ID."_gdf_".$this->getId();
}
return $a_value;
}

+ Here is the call graph for this function:

ilGlossaryDefinition::moveDown ( )

Definition at line 322 of file class.ilGlossaryDefinition.php.

References $ilDB, getNr(), getTermId(), ilDB\LOCK_WRITE, and setNr().

{
global $ilDB;
// lock glossary_definition table
#ilDB::_lockTables(array('glossary_definition' => 'WRITE'));
$ilDB->lockTables(
array(
0 => array('name' => 'glossary_definition', 'type' => ilDB::LOCK_WRITE)));
// be sure to get the right number
$q = "SELECT * FROM glossary_definition WHERE id = ".
$ilDB->quote($this->id, "integer");
$def_set = $ilDB->query($q);
$def_rec = $ilDB->fetchAssoc($def_set);
$this->setNr($def_rec["nr"]);
// get max number
$q = "SELECT max(nr) as max_nr FROM glossary_definition WHERE term_id = ".
$ilDB->quote($this->getTermId(), "integer");
$max_set = $ilDB->query($q);
$max_rec = $ilDB->fetchAssoc($max_set);
if ($this->getNr() >= $max_rec["max_nr"])
{
$ilDB->unlockTables();
return;
}
// update numbers of other definitions
$ilDB->manipulate("UPDATE glossary_definition SET ".
" nr = nr - 1 ".
" WHERE term_id = ".$ilDB->quote($this->getTermId(), "integer")." ".
" AND nr = ".$ilDB->quote(($this->getNr() + 1), "integer"));
// delete current definition
$ilDB->manipulate("UPDATE glossary_definition SET ".
" nr = nr + 1 ".
" WHERE term_id = ".$ilDB->quote($this->getTermId(), "integer")." ".
" AND id = ".$ilDB->quote($this->getId(), "integer"));
// unlock glossary_definition table
$ilDB->unlockTables();
}

+ Here is the call graph for this function:

ilGlossaryDefinition::moveUp ( )

Definition at line 281 of file class.ilGlossaryDefinition.php.

References $ilDB, getNr(), ilDB\LOCK_WRITE, and setNr().

{
global $ilDB;
// lock glossary_definition table
#ilDB::_lockTables(array('glossary_definition' => 'WRITE'));
$ilDB->lockTables(
array(
0 => array('name' => 'glossary_definition', 'type' => ilDB::LOCK_WRITE)));
// be sure to get the right number
$q = "SELECT * FROM glossary_definition WHERE id = ".
$ilDB->quote($this->id, "integer");
$def_set = $ilDB->query($q);
$def_rec = $ilDB->fetchAssoc($def_set);
$this->setNr($def_rec["nr"]);
if ($this->getNr() < 2)
{
$ilDB->unlockTables();
return;
}
// update numbers of other definitions
$ilDB->manipulate("UPDATE glossary_definition SET ".
" nr = nr + 1 ".
" WHERE term_id = ".$ilDB->quote($this->getTermId(), "integer")." ".
" AND nr = ".$ilDB->quote(($this->getNr() - 1), "integer"));
// delete current definition
$ilDB->manipulate("UPDATE glossary_definition SET ".
" nr = nr - 1 ".
" WHERE term_id = ".$ilDB->quote($this->getTermId(), "integer")." ".
" AND id = ".$ilDB->quote($this->getId(), "integer"));
// unlock glossary_definition table
$ilDB->unlockTables();
}

+ Here is the call graph for this function:

ilGlossaryDefinition::read ( )

read data of content object

Definition at line 50 of file class.ilGlossaryDefinition.php.

References $ilDB, setNr(), setShortText(), setShortTextDirty(), and setTermId().

Referenced by ilGlossaryDefinition().

{
global $ilDB;
$q = "SELECT * FROM glossary_definition WHERE id = ".
$ilDB->quote($this->id, "integer");
$def_set = $ilDB->query($q);
$def_rec = $ilDB->fetchAssoc($def_set);
$this->setTermId($def_rec["term_id"]);
$this->setShortText($def_rec["short_text"]);
$this->setNr($def_rec["nr"]);
$this->setShortTextDirty($def_rec["short_text_dirty"]);
$this->page_object =& new ilPageObject("gdf", $this->id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGlossaryDefinition::setDescription (   $a_description)

Set description.

Parameters
stringdescription

Definition at line 155 of file class.ilGlossaryDefinition.php.

Referenced by MDUpdateListener().

{
$this->description = $a_description;
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::setId (   $a_id)

Definition at line 67 of file class.ilGlossaryDefinition.php.

Referenced by create().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::setNr (   $a_nr)

Definition at line 102 of file class.ilGlossaryDefinition.php.

Referenced by create(), delete(), moveDown(), moveUp(), and read().

{
$this->nr = $a_nr;
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::setShortText (   $a_text)

Definition at line 92 of file class.ilGlossaryDefinition.php.

References shortenShortText().

Referenced by read(), and updateShortText().

{
$this->short_text = $this->shortenShortText($a_text);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGlossaryDefinition::setShortTextDirty (   $a_val)

Set short text dirty.

Parameters
booleanshort text dirty

Definition at line 165 of file class.ilGlossaryDefinition.php.

Referenced by read(), and updateShortText().

{
$this->short_text_dirty = $a_val;
}

+ Here is the caller graph for this function:

static ilGlossaryDefinition::setShortTextsDirty (   $a_glo_id)
static

Set short texts dirty.

Parameters
@return

Definition at line 659 of file class.ilGlossaryDefinition.php.

References $ilDB, $term_id, and ilGlossaryTerm\getTermsOfGlossary().

Referenced by ilObjGlossaryGUI\saveProperties().

{
global $ilDB;
include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
$term_ids = ilGlossaryTerm::getTermsOfGlossary($a_glo_id);
foreach ($term_ids as $term_id)
{
$ilDB->manipulate("UPDATE glossary_definition SET ".
" short_text_dirty = ".$ilDB->quote(1, "integer").
" WHERE term_id = ".$ilDB->quote($term_id, "integer")
);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGlossaryDefinition::setTermId (   $a_term_id)

Definition at line 82 of file class.ilGlossaryDefinition.php.

Referenced by read().

{
$this->term_id = $a_term_id;
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::setTitle (   $a_title)

set title of content object

Definition at line 135 of file class.ilGlossaryDefinition.php.

Referenced by MDUpdateListener().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilGlossaryDefinition::shortenShortText (   $text)

Shorten short text.

Parameters
@return

Definition at line 389 of file class.ilGlossaryDefinition.php.

References $glo_id, getTermId(), ilObjGlossary\lookupSnippetLength(), and ilUtil\shortenText().

Referenced by setShortText(), and updateShortText().

{
$a_length = 196;
if ($this->getTermId() > 0)
{
include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
$glo_id = ilGlossaryTerm::_lookGlossaryId($this->getTermId());
if ($snippet_length > 0)
{
$a_length = $snippet_length;
}
}
$text = str_replace("<br/>", "<br>", $text);
$text = strip_tags($text, "<br>");
if (is_int(strpos(substr($text, $a_length - 16 - 5, 10), "[tex]")))
{
$offset = 5;
}
$short = ilUtil::shortenText($text, $a_length - 16 + $offset, true);
// make short text longer, if tex end tag is missing
$ltexs = strrpos($short, "[tex]");
$ltexe = strrpos($short, "[/tex]");
if ($ltexs > $ltexe)
{
$ltexe = strpos($text, "[/tex]", $ltexs);
if ($ltexe > 0)
{
$short = ilUtil::shortenText($text, $ltexe+6, true);
}
}
$short = ilUtil::shortenText($text, $a_length, true);
return $short;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGlossaryDefinition::update ( )

Definition at line 369 of file class.ilGlossaryDefinition.php.

References $ilDB, and updateMetaData().

Referenced by updateShortText().

{
global $ilDB;
$this->updateMetaData();
$ilDB->manipulate("UPDATE glossary_definition SET ".
" term_id = ".$ilDB->quote($this->getTermId(), "integer").", ".
" nr = ".$ilDB->quote($this->getNr(), "integer").", ".
" short_text = ".$ilDB->quote($this->getShortText(), "text").", ".
" short_text_dirty = ".$ilDB->quote($this->getShortTextDirty(), "integer")." ".
" WHERE id = ".$ilDB->quote($this->getId(), "integer"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGlossaryDefinition::updateMetaData ( )

update meta data entry

Definition at line 557 of file class.ilGlossaryDefinition.php.

References $glo_id, ilGlossaryTerm\_lookGlossaryID(), getDescription(), getId(), getTermId(), getTitle(), and getType().

Referenced by update().

{
include_once("Services/MetaData/classes/class.ilMD.php");
include_once("Services/MetaData/classes/class.ilMDGeneral.php");
include_once("Services/MetaData/classes/class.ilMDDescription.php");
$md =& new ilMD($glo_id, $this->getId(), $this->getType());
$md_gen =& $md->getGeneral();
$md_gen->setTitle($this->getTitle());
// sets first description (maybe not appropriate)
$md_des_ids =& $md_gen->getDescriptionIds();
if (count($md_des_ids) > 0)
{
$md_des =& $md_gen->getDescription($md_des_ids[0]);
$md_des->setDescription($this->getDescription());
$md_des->update();
}
$md_gen->update();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGlossaryDefinition::updateShortText ( )

Definition at line 430 of file class.ilGlossaryDefinition.php.

References setShortText(), setShortTextDirty(), shortenShortText(), and update().

{
$this->page_object->buildDom();
$text = $this->page_object->getFirstParagraphText();
$short = $this->shortenShortText($text);
$this->setShortText($short);
$this->setShortTextDirty(false);
$this->update();
}

+ Here is the call graph for this function:

Field Documentation

ilGlossaryDefinition::$glo_id
ilGlossaryDefinition::$id

Definition at line 20 of file class.ilGlossaryDefinition.php.

Referenced by getId(), and MDUpdateListener().

ilGlossaryDefinition::$ilias

Definition at line 16 of file class.ilGlossaryDefinition.php.

Referenced by ilGlossaryDefinition().

ilGlossaryDefinition::$lng

Definition at line 17 of file class.ilGlossaryDefinition.php.

Referenced by ilGlossaryDefinition().

ilGlossaryDefinition::$nr

Definition at line 25 of file class.ilGlossaryDefinition.php.

Referenced by getNr().

ilGlossaryDefinition::$page_object

Definition at line 23 of file class.ilGlossaryDefinition.php.

Referenced by getPageObject().

ilGlossaryDefinition::$short_text

Definition at line 24 of file class.ilGlossaryDefinition.php.

Referenced by getShortText().

ilGlossaryDefinition::$short_text_dirty = false

Definition at line 26 of file class.ilGlossaryDefinition.php.

Referenced by getShortTextDirty().

ilGlossaryDefinition::$term_id

Definition at line 21 of file class.ilGlossaryDefinition.php.

Referenced by getTermId(), and setShortTextsDirty().

ilGlossaryDefinition::$tpl

Definition at line 18 of file class.ilGlossaryDefinition.php.

Referenced by ilGlossaryDefinition().


The documentation for this class was generated from the following file: