Public Member Functions | |
| ilLocatorGUI ($a_display_frame=true) | |
| Constructor. | |
| addRepositoryItems ($a_ref_id=0) | |
| add repository items | |
| addAdministrationItems ($a_ref_id=0) | |
| add administration tree items | |
| addItem ($a_title, $a_link, $a_frame="") | |
| add locator item | |
| clearItems () | |
| getItems () | |
| get all locator entries | |
| navigate ($newLocLevel, $newLocName, $newLocLink, $newLocTarget) | |
| DEPRECATED! | |
| output () | |
| DEPRECATED! | |
Data Fields | |
| $tpl | |
| $lng | |
| $locator_data | |
| $locator_level | |
| $display_frame | |
| indicates if the locator bar is displayed in a frame environment or not | |
Definition at line 36 of file class.ilLocatorGUI.php.
| ilLocatorGUI::addAdministrationItems | ( | $ | a_ref_id = 0 |
) |
add administration tree items
| int | $a_ref_id current ref id (optional); if empty $_GET["ref_id"] is used |
Definition at line 143 of file class.ilLocatorGUI.php.
References $_GET, $ilCtrl, $key, $lng, $row, $tree, and addItem().
{
global $tree, $ilCtrl, $objDefinition, $lng;
if ($a_ref_id == 0)
{
$a_ref_id = $_GET["ref_id"];
}
if ($a_ref_id > 0)
{
$path = $tree->getPathFull($a_ref_id);
// add item for each node on path
foreach ($path as $key => $row)
{
if (!in_array($row["type"], array("root", "cat", "crs", "fold", "grp", "icrs")))
{
continue;
}
if ($row["child"] == ROOT_FOLDER_ID)
{
$row["title"] = $lng->txt("repository");
}
$class_name = $objDefinition->getClassName($row["type"]);
$class = strtolower("ilObj".$class_name."GUI");
$ilCtrl->setParameterByClass($class, "ref_id", $row["child"]);
$this->addItem($row["title"],
$ilCtrl->getLinkTargetbyClass($class, "view"));
}
}
}
Here is the call graph for this function:| ilLocatorGUI::addItem | ( | $ | a_title, | |
| $ | a_link, | |||
| $ | a_frame = "" | |||
| ) |
add locator item
| string | $a_title item title | |
| string | $a_link item link | |
| string | $a_frame frame target |
Definition at line 185 of file class.ilLocatorGUI.php.
Referenced by addAdministrationItems(), and addRepositoryItems().
{
$this->entries[] = array("title" => $a_title,
"link" => $a_link, "frame" => $a_frame);
}
Here is the caller graph for this function:| ilLocatorGUI::addRepositoryItems | ( | $ | a_ref_id = 0 |
) |
add repository items
| int | $a_ref_id current ref id (optional); if empty $_GET["ref_id"] is used |
Definition at line 99 of file class.ilLocatorGUI.php.
References $_GET, $key, $row, $tree, ilFrameTargetInfo::_getFrame(), and addItem().
{
global $tree;
if ($a_ref_id == 0)
{
$a_ref_id = $_GET["ref_id"];
}
$pre = "";
if (defined("ILIAS_MODULE"))
{
$pre = "../";
}
if ($a_ref_id > 0)
{
$path = $tree->getPathFull($a_ref_id);
// add item for each node on path
foreach ($path as $key => $row)
{
if (!in_array($row["type"], array("root", "cat","crs", "fold", "grp", "icrs")))
{
continue;
}
if ($row["title"] == "ILIAS")
{
$row["title"] = $this->lng->txt("repository");
}
$this->addItem($row["title"],
$pre."repository.php?cmd=frameset&ref_id=".$row["child"],
ilFrameTargetInfo::_getFrame("MainContent"));
}
}
}
Here is the call graph for this function:| ilLocatorGUI::clearItems | ( | ) |
Definition at line 192 of file class.ilLocatorGUI.php.
{
$this->entries = array();
}
| ilLocatorGUI::getItems | ( | ) |
get all locator entries
Definition at line 200 of file class.ilLocatorGUI.php.
{
return $this->entries;
}
| ilLocatorGUI::ilLocatorGUI | ( | $ | a_display_frame = true |
) |
| ilLocatorGUI::navigate | ( | $ | newLocLevel, | |
| $ | newLocName, | |||
| $ | newLocLink, | |||
| $ | newLocTarget | |||
| ) |
DEPRECATED!
Definition at line 208 of file class.ilLocatorGUI.php.
References $_SESSION.
{
if ($newLocLevel > -1)
{
// update local variables
if ($this->display_frame) {
$this->locator_data = $_SESSION["locator_data"];
$this->locator_level = $_SESSION["locator_level"];
}
// navigate: check whether links should be deleted or added / updated
if ($newLocLevel < $this->locator_level)
{
// remove link(s) of deeper levels (clean up array when leap-frogging ;)
for ($i = $this->locator_level ; $i >= $newLocLevel ; $i --)
{
$this->locator_data[$i][0] = "";
$this->locator_data[$i][1] = "";
$this->locator_data[$i][2] = "";
}
}
// add current link or update
$this->locator_data[$newLocLevel][0] = $newLocName;
$this->locator_data[$newLocLevel][1] = $newLocLink;
$this->locator_data[$newLocLevel][2] = $newLocTarget;
// set level current
$this->locator_level = $newLocLevel;
// update session variables
if ($this->display_frame) {
$_SESSION["locator_data"] = $this->locator_data;
$_SESSION["locator_level"] = $this->locator_level;
}
}
}
| ilLocatorGUI::output | ( | ) |
DEPRECATED!
Definition at line 247 of file class.ilLocatorGUI.php.
References $_SESSION.
{
// update local variables
if ($this->display_frame) {
$this->locator_data = $_SESSION["locator_data"];
$this->locator_level = $_SESSION["locator_level"];
}
// select the template
if ($this->display_frame) {
$this->tpl = new ilTemplate("tpl.locator_frame.html", true, true);
} else {
$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html");
}
// locator title
$this->tpl->setVariable("TXT_LOCATOR", $this->lng->txt("locator"));
// walk through array and generate locator
if ($this->locator_level < 0)
{
$this->tpl->setCurrentBlock("locator_text");
$this->tpl->setVariable("ITEM", " - ERROR Locator array empty! -"); // ######## LANG FILE ENTRY ###########
$this->tpl->parseCurrentBlock();
}
else
{
for ($i = 0 ; $i <= $this->locator_level ; $i ++)
{
// generate links, skip empty links
if ( ($this->locator_data[$i][0] != "") & ($this->locator_data[$i][1] != "") )
{
// locator entry
if ($i == $this->locator_level)
{
if ($this->display_frame) {
$this->tpl->setCurrentBlock("locator_text");
$this->tpl->setVariable("ITEM", $this->locator_data[$i][0]);
$this->tpl->parseCurrentBlock("locator_text");
} else {
$this->tpl->setCurrentBlock("locator_text");
$this->tpl->setVariable("ITEM", $this->locator_data[$i][0]);
$this->tpl->setVariable("LINK_ITEM", $this->locator_data[$i][1]);
$this->tpl->setVariable("LINK_TARGET", $this->locator_data[$i][2]);
$this->tpl->parseCurrentBlock("locator_text");
}
}
else
{
if ($this->display_frame) {
$this->tpl->setCurrentBlock("locator_link");
$this->tpl->setVariable("ITEM", $this->locator_data[$i][0]);
$this->tpl->setVariable("LINK_ITEM", $this->locator_data[$i][1]);
$this->tpl->setVariable("LINK_TARGET", $this->locator_data[$i][2]);
$this->tpl->parseCurrentBlock("locator_link");
} else {
$this->tpl->touchBlock("locator_separator");
$this->tpl->setCurrentBlock("locator_item");
$this->tpl->setVariable("ITEM", $this->locator_data[$i][0]);
$this->tpl->setVariable("LINK_ITEM", $this->locator_data[$i][1]);
$this->tpl->setVariable("LINK_TARGET", $this->locator_data[$i][2]);
$this->tpl->parseCurrentBlock("locator_item");
}
}
}
}
}
// output
if ($this->display_frame) {
$this->tpl->show();
}
}
| ilLocatorGUI::$display_frame |
indicates if the locator bar is displayed in a frame environment or not
Definition at line 75 of file class.ilLocatorGUI.php.
| ilLocatorGUI::$lng |
Definition at line 50 of file class.ilLocatorGUI.php.
Referenced by addAdministrationItems(), and ilLocatorGUI().
| ilLocatorGUI::$locator_data |
Definition at line 58 of file class.ilLocatorGUI.php.
| ilLocatorGUI::$locator_level |
Definition at line 67 of file class.ilLocatorGUI.php.
| ilLocatorGUI::$tpl |
Definition at line 43 of file class.ilLocatorGUI.php.
Referenced by ilLocatorGUI().
1.7.1