class for editing lm menu More...
Public Member Functions | |
ilLMMenuEditor () | |
setObjId ($a_obj_id) | |
getObjId () | |
setEntryId ($a_id) | |
getEntryId () | |
setLinkType ($a_link_type) | |
getLinkType () | |
setTitle ($a_title) | |
getTitle () | |
setTarget ($a_target) | |
getTarget () | |
setLinkRefId ($a_link_ref_id) | |
getLinkRefId () | |
create () | |
getMenuEntries ($a_only_active=false) | |
delete ($a_id) | |
delete menu entry | |
update () | |
update menu entry | |
readEntry ($a_id) | |
updateActiveStatus ($a_entries) | |
update active status of all menu entries of lm |
class for editing lm menu
Definition at line 32 of file class.ilLMMenuEditor.php.
ilLMMenuEditor::create | ( | ) |
Definition at line 103 of file class.ilLMMenuEditor.php.
References $q, getLinkRefId(), getLinkType(), getObjId(), getTarget(), and getTitle().
{ $q = "INSERT INTO lm_menu (lm_id,link_type,title,target,link_ref_id) ". "VALUES ". "(". $this->db->quote($this->getObjId()).",". $this->db->quote($this->getLinkType()).",". $this->db->quote($this->getTitle()).",". $this->db->quote($this->getTarget()).",". $this->db->quote($this->getLinkRefId()).")"; $r = $this->db->query($q); return true; }
ilLMMenuEditor::delete | ( | $ | a_id | ) |
ilLMMenuEditor::getEntryId | ( | ) |
Definition at line 58 of file class.ilLMMenuEditor.php.
Referenced by update().
{
return $this->entry_id;
}
ilLMMenuEditor::getLinkRefId | ( | ) |
Definition at line 98 of file class.ilLMMenuEditor.php.
Referenced by create(), and update().
{
return $this->link_ref_id;
}
ilLMMenuEditor::getLinkType | ( | ) |
Definition at line 68 of file class.ilLMMenuEditor.php.
Referenced by create(), and update().
{
return $this->link_type;
}
ilLMMenuEditor::getMenuEntries | ( | $ | a_only_active = false |
) |
Definition at line 118 of file class.ilLMMenuEditor.php.
References $entries, $q, and $row.
{ global $ilDB; $entries = array(); if ($a_only_active === true) { $and = " AND active = 'y'"; } $q = "SELECT * FROM lm_menu ". "WHERE lm_id = ".$ilDB->quote($this->lm_id). $and; $r = $this->db->query($q); while($row = $r->fetchRow(DB_FETCHMODE_OBJECT)) { $entries[] = array('id' => $row->id, 'title' => $row->title, 'link' => $row->target, 'type' => $row->link_type, 'ref_id' => $row->link_ref_id, 'active' => $row->active ); } return $entries; }
ilLMMenuEditor::getObjId | ( | ) |
Definition at line 48 of file class.ilLMMenuEditor.php.
Referenced by create().
{
return $this->lm_id;
}
ilLMMenuEditor::getTarget | ( | ) |
Definition at line 88 of file class.ilLMMenuEditor.php.
Referenced by create(), and update().
{
return $this->target;
}
ilLMMenuEditor::getTitle | ( | ) |
Definition at line 78 of file class.ilLMMenuEditor.php.
Referenced by create(), and update().
{
return $this->title;
}
ilLMMenuEditor::ilLMMenuEditor | ( | ) |
Definition at line 34 of file class.ilLMMenuEditor.php.
{
global $ilDB;
$this->db =& $ilDB;
$this->link_type = "extern";
$this->link_ref_id = null;
}
ilLMMenuEditor::readEntry | ( | $ | a_id | ) |
Definition at line 185 of file class.ilLMMenuEditor.php.
References $q, $row, setLinkRefId(), setLinkType(), setTarget(), and setTitle().
{ if (!$a_id) { return false; } $q = "SELECT * FROM lm_menu WHERE id = ".$this->db->quote($a_id); $r = $this->db->query($q); $row = $this->db->getRow($q,DB_FETCHMODE_OBJECT); $this->setTitle($row->title); $this->setTarget($row->target); $this->setLinkType($row->link_type); $this->setLinkRefId($row->link_ref_id); $this->setEntryid($a_id); }
ilLMMenuEditor::setEntryId | ( | $ | a_id | ) |
Definition at line 53 of file class.ilLMMenuEditor.php.
{ $this->entry_id = $a_id; }
ilLMMenuEditor::setLinkRefId | ( | $ | a_link_ref_id | ) |
Definition at line 93 of file class.ilLMMenuEditor.php.
Referenced by readEntry().
{ $this->link_ref_id = $a_link_ref_id; }
ilLMMenuEditor::setLinkType | ( | $ | a_link_type | ) |
Definition at line 63 of file class.ilLMMenuEditor.php.
Referenced by readEntry().
{ $this->link_type = $a_link_type; }
ilLMMenuEditor::setObjId | ( | $ | a_obj_id | ) |
Definition at line 43 of file class.ilLMMenuEditor.php.
{ $this->lm_id = $a_obj_id; }
ilLMMenuEditor::setTarget | ( | $ | a_target | ) |
Definition at line 83 of file class.ilLMMenuEditor.php.
Referenced by readEntry().
{ $this->target = $a_target; }
ilLMMenuEditor::setTitle | ( | $ | a_title | ) |
Definition at line 73 of file class.ilLMMenuEditor.php.
Referenced by readEntry().
{ $this->title = $a_title; }
ilLMMenuEditor::update | ( | ) |
update menu entry
Definition at line 170 of file class.ilLMMenuEditor.php.
References $q, getEntryId(), getLinkRefId(), getLinkType(), getTarget(), and getTitle().
{ global $ilDB; $q = "UPDATE lm_menu SET ". " link_type = ".$ilDB->quote($this->getLinkType()).",". " title = ".$ilDB->quote($this->getTitle()).",". " target = ".$ilDB->quote($this->getTarget()).",". " link_ref_id = ".$ilDB->quote($this->getLinkRefId()). " WHERE id = ".$ilDB->quote($this->getEntryId()); $r = $this->db->query($q); return true; }
ilLMMenuEditor::updateActiveStatus | ( | $ | a_entries | ) |
update active status of all menu entries of lm
array | entry ids |
Definition at line 209 of file class.ilLMMenuEditor.php.
References $q.