ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLocatorGUI Class Reference

locator handling class More...

+ Collaboration diagram for ilLocatorGUI:

Public Member Functions

 ilLocatorGUI ()
 Constructor.
 setTextOnly ($a_textonly)
 Set Only text, no HTML.
 setOffline ($a_offline)
 getOffline ()
 getTextOnly ()
 Get Only text, no HTML.
 addRepositoryItems ($a_ref_id=0)
 add repository item
 addAdministrationItems ($a_ref_id=0)
 add administration tree items
 addContextItems ($a_ref_id, $a_omit_node=false, $a_stop=0)
 addItem ($a_title, $a_link, $a_frame="", $a_ref_id=0, $type=null)
 add locator item
 clearItems ()
 Clear all Items.
 getItems ()
 Get all locator entries.
 getHTML ()
 Get locator HTML.

Protected Attributes

 $lng
 $entries

Detailed Description

locator handling class

This class supplies an implementation for the locator. The locator will send its output to ist own frame, enabling more flexibility in the design of the desktop.

Author
Arjan Ammerlaan a.l.a.nosp@m.mmer.nosp@m.laan@.nosp@m.web..nosp@m.de
Version
Id:
class.ilLocatorGUI.php 22262 2009-10-31 11:55:08Z smeyer

Definition at line 15 of file class.ilLocatorGUI.php.

Member Function Documentation

ilLocatorGUI::addAdministrationItems (   $a_ref_id = 0)

add administration tree items

Parameters
int$a_ref_idcurrent ref id (optional); if empty $_GET["ref_id"] is used

Definition at line 124 of file class.ilLocatorGUI.php.

References $_GET, $ilCtrl, $lng, $path, $row, 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"), "", $row["child"]);
}
}
}

+ Here is the call graph for this function:

ilLocatorGUI::addContextItems (   $a_ref_id,
  $a_omit_node = false,
  $a_stop = 0 
)

Definition at line 159 of file class.ilLocatorGUI.php.

References $path, $row, and addItem().

{
global $tree;
if ($a_ref_id > 0)
{
$path = $tree->getPathFull($a_ref_id);
// we want to show the full path, from the major container to the item
// (folders are not! treated as containers here), at least one parent item
$r_path = array_reverse($path);
$first = "";
$omit = array();
$do_omit = false;
foreach ($r_path as $key => $row)
{
if ($first == "")
{
if (in_array($row["type"], array("root", "cat", "grp", "crs")) &&
$row["child"] != $a_ref_id)
{
$first = $row["child"];
}
}
if ($a_stop == $row["child"])
{
$do_omit = true;
}
$omit[$row["child"]] = $do_omit;
}
$add_it = false;
foreach ($path as $key => $row)
{
if ($first == $row["child"])
{
$add_it = true;
}
if ($add_it && !$omit[$row["child"]] &&
(!$a_omit_node || ($row["child"] != $a_ref_id)))
{
//echo "-".ilObject::_lookupTitle($row["obj_id"])."-";
if ($row["title"] == "ILIAS" && $row["type"] == "root")
{
$row["title"] = $this->lng->txt("repository");
}
$this->addItem($row["title"],
"./goto.php?client_id=".rawurlencode(CLIENT_ID)."&target=".$row["type"]."_".$row["child"],
"_top", $row["child"], $row["type"]);
}
}
}
}

+ Here is the call graph for this function:

ilLocatorGUI::addItem (   $a_title,
  $a_link,
  $a_frame = "",
  $a_ref_id = 0,
  $type = null 
)

add locator item

Parameters
string$a_titleitem title
string$a_linkitem link
string$a_frameframe target

Definition at line 222 of file class.ilLocatorGUI.php.

Referenced by addAdministrationItems(), addContextItems(), and addRepositoryItems().

{
$this->entries[] = array("title" => $a_title,
"link" => $a_link, "frame" => $a_frame, "ref_id" => $a_ref_id, "type" => $type);
}

+ Here is the caller graph for this function:

ilLocatorGUI::addRepositoryItems (   $a_ref_id = 0)

add repository item

Parameters
int$a_ref_idcurrent ref id (optional); if empty $_GET["ref_id"] is used

Definition at line 70 of file class.ilLocatorGUI.php.

References $_GET, $path, $row, ilFrameTargetInfo\_getFrame(), addItem(), and ilMemberViewSettings\getInstance().

{
global $tree;
if ($a_ref_id == 0)
{
$a_ref_id = $_GET["ref_id"];
}
include_once './Services/Container/classes/class.ilMemberViewSettings.php';
if(ilMemberViewSettings::getInstance()->isActive() and $a_ref_id != ROOT_FOLDER_ID)
{
$a_start = ilMemberViewSettings::getInstance()->getContainer();
}
else
{
$a_start = ROOT_FOLDER_ID;
}
$pre = "";
if (defined("ILIAS_MODULE"))
{
$pre = "../";
}
if ($a_ref_id > 0)
{
$path = $tree->getPathFull($a_ref_id,$a_start);
// add item for each node on path
foreach ((array) $path as $key => $row)
{
if (!in_array($row["type"], array("root", "cat","crs", "fold", "grp", "icrs")))
{
continue;
}
if ($row["title"] == "ILIAS" && $row["type"] == "root")
{
$row["title"] = $this->lng->txt("repository");
}
$this->addItem($row["title"],
$pre."repository.php?cmd=frameset&ref_id=".$row["child"],
ilFrameTargetInfo::_getFrame("MainContent"), $row["child"]);
}
}
}

+ Here is the call graph for this function:

ilLocatorGUI::clearItems ( )

Clear all Items.

Definition at line 231 of file class.ilLocatorGUI.php.

{
$this->entries = array();
}
ilLocatorGUI::getHTML ( )

Get locator HTML.

Definition at line 247 of file class.ilLocatorGUI.php.

References $ilSetting, $lng, ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupType(), getItems(), getOffline(), and getTextOnly().

{
global $lng, $ilSetting;
if ($this->getTextOnly())
{
$loc_tpl = new ilTemplate("tpl.locator_text_only.html", true, true, "Services/Locator");
}
else
{
$loc_tpl = new ilTemplate("tpl.locator.html", true, true, "Services/Locator");
}
$items = $this->getItems();
$first = true;
if (is_array($items))
{
foreach($items as $item)
{
if (!$first)
{
$loc_tpl->touchBlock("locator_separator_prefix");
}
if ($item["ref_id"] > 0)
{
$obj_id = ilObject::_lookupObjId($item["ref_id"]);
$type = ilObject::_lookupType($obj_id);
if (!$this->getTextOnly())
{
$icon_path = ilObject::_getIcon($obj_id, "tiny", $type,
$this->getOffline());
}
$loc_tpl->setCurrentBlock("locator_img");
$loc_tpl->setVariable("IMG_SRC", $icon_path);
$loc_tpl->setVariable("IMG_ALT",
$lng->txt("obj_".$type));
$loc_tpl->parseCurrentBlock();
}
$loc_tpl->setCurrentBlock("locator_item");
if ($item["link"] != "")
{
$loc_tpl->setVariable("LINK_ITEM", $item["link"]);
if ($item["frame"] != "")
{
$loc_tpl->setVariable("LINK_TARGET", ' target="'.$item["frame"].'" ');
}
$loc_tpl->setVariable("ITEM", $item["title"]);
}
else
{
$loc_tpl->setVariable("PREFIX", $item["title"]);
}
$loc_tpl->parseCurrentBlock();
$first = false;
}
}
else
{
$loc_tpl->setVariable("NOITEM", " ");
$loc_tpl->touchBlock("locator");
}
$loc_tpl->setVariable("TXT_BREADCRUMBS", $lng->txt("breadcrumb_navigation"));
return trim($loc_tpl->get());
}

+ Here is the call graph for this function:

ilLocatorGUI::getItems ( )

Get all locator entries.

Definition at line 239 of file class.ilLocatorGUI.php.

References $entries.

Referenced by getHTML().

{
}

+ Here is the caller graph for this function:

ilLocatorGUI::getOffline ( )

Definition at line 49 of file class.ilLocatorGUI.php.

Referenced by getHTML().

{
return $this->offline;
}

+ Here is the caller graph for this function:

ilLocatorGUI::getTextOnly ( )

Get Only text, no HTML.

Returns
boolean Only text, no HTML

Definition at line 59 of file class.ilLocatorGUI.php.

Referenced by getHTML().

{
return $this->textonly;
}

+ Here is the caller graph for this function:

ilLocatorGUI::ilLocatorGUI ( )

Constructor.

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

References $lng, and setTextOnly().

{
global $lng;
$this->lng =& $lng;
$this->entries = array();
$this->setTextOnly(false);
$this->offline = false;
}

+ Here is the call graph for this function:

ilLocatorGUI::setOffline (   $a_offline)

Definition at line 44 of file class.ilLocatorGUI.php.

{
$this->offline = $a_offline;
}
ilLocatorGUI::setTextOnly (   $a_textonly)

Set Only text, no HTML.

Parameters
boolean$a_textonlyOnly text, no HTML

Definition at line 39 of file class.ilLocatorGUI.php.

Referenced by ilLocatorGUI().

{
$this->textonly = $a_textonly;
}

+ Here is the caller graph for this function:

Field Documentation

ilLocatorGUI::$entries
protected

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

Referenced by getItems().

ilLocatorGUI::$lng
protected

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

Referenced by addAdministrationItems(), getHTML(), and ilLocatorGUI().


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