ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilRepositorySelectorInputGUI Class Reference

This class represents a repository selector in a property form. More...

+ Inheritance diagram for ilRepositorySelectorInputGUI:
+ Collaboration diagram for ilRepositorySelectorInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setValue ($a_value)
 Set Value.
 getValue ()
 Get Value.
 setValueByArray ($a_values)
 Set value by array.
 setSelectText ($a_val)
 Set select link text.
 getSelectText ()
 Get select link text.
 setHeaderMessage ($a_val)
 Set header message.
 getHeaderMessage ()
 Get header message.
 setClickableTypes ($a_types)
 Set clickable types.
 getClickableTypes ()
 Get clickable types.
 checkInput ()
 Check input, strip slashes etc.
 showRepositorySelection ()
 Select Repository Item.
 selectRepositoryItem ()
 Select repository item.
 reset ()
 Reset.
 render ($a_mode="property_form")
 Render item.
 insert (&$a_tpl)
 Insert property html.
 getTableFilterHTML ()
 Get HTML for table filter.
- Public Member Functions inherited from ilFormPropertyGUI
executeCommand ()
 Execute command.
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setPostVar ($a_postvar)
 Set Post Variable.
 getPostVar ()
 Get Post Variable.
 getFieldId ()
 Get Post Variable.
 setInfo ($a_info)
 Set Information Text.
 getInfo ()
 Get Information Text.
 setAlert ($a_alert)
 Set Alert Text.
 getAlert ()
 Get Alert Text.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required.
 setDisabled ($a_disabled)
 Set Disabled.
 getDisabled ()
 Get Disabled.
 setParentForm ($a_parentform)
 Set Parent Form.
 getParentForm ()
 Get Parent Form.
 setParent ($a_val)
 Set Parent GUI object.
 getParent ()
 Get Parent GUI object.
 getSubForm ()
 Get sub form html.
 hideSubForm ()
 Sub form hidden on init?
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders)
 getHiddenTitle ()
 Get hidden title.
 getItemByPostVar ($a_post_var)
 Get item by post var.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 writeToSession ()
 Write to session.
 clearFromSession ()
 Clear session value.
 readFromSession ()
 Read from session.
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties)
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi.
 getMulti ()
 Get Multi.
 setMultiValues (array $a_values)
 Set multi values.
 getMultiValues ()
 Get multi values.
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g.

Protected Member Functions

 getHighlightedNode ()
 Returns the highlighted object.
 getVisibleTypes ()
 returns all visible types like container and clickable types
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.
 getMultiIconsHTML ()
 Get HTML for multiple value icons.

Protected Attributes

 $options
 $value
 $container_types = array("root", "cat", "grp", "fold", "crs")
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""
 $multi = false
 $multi_sortable = false
 $multi_addremove = true
 $multi_values

Detailed Description

This class represents a repository selector in a property form.

The implementation is kind of beta. It looses all other inputs, if the selector link is used.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilRepositorySelectorInputGUI: ilFormPropertyDispatchGUI

Definition at line 38 of file class.ilRepositorySelectorInputGUI.php.

Constructor & Destructor Documentation

ilRepositorySelectorInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

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

References $lng, setClickableTypes(), setHeaderMessage(), setSelectText(), and ilFormPropertyGUI\setType().

{
global $lng;
parent::__construct($a_title, $a_postvar);
$this->setClickableTypes($this->container_types);
$this->setHeaderMessage($lng->txt('search_area_info'));
$this->setType("rep_select");
$this->setSelectText($lng->txt("select"));
}

+ Here is the call graph for this function:

Member Function Documentation

ilRepositorySelectorInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 156 of file class.ilRepositorySelectorInputGUI.php.

References $_POST, $lng, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

{
global $lng;
$_POST[$this->getPostVar()] =
if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "")
{
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
return true;
}

+ Here is the call graph for this function:

ilRepositorySelectorInputGUI::getClickableTypes ( )

Get clickable types.

Returns
array clickable types

Definition at line 146 of file class.ilRepositorySelectorInputGUI.php.

Referenced by getVisibleTypes(), render(), and showRepositorySelection().

{
return $this->clickable_types;
}

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::getHeaderMessage ( )

Get header message.

Returns
string header message

Definition at line 126 of file class.ilRepositorySelectorInputGUI.php.

Referenced by showRepositorySelection().

{
return $this->hm;
}

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::getHighlightedNode ( )
protected

Returns the highlighted object.

Returns
int ref_id (node)

Definition at line 318 of file class.ilRepositorySelectorInputGUI.php.

References ilObject\_lookupType(), getValue(), and getVisibleTypes().

Referenced by showRepositorySelection().

{
global $tree;
if(!in_array(ilObject::_lookupType($this->getValue(),true), $this->getVisibleTypes()))
{
return $tree->getParentId($this->getValue());
}
return $this->getValue();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::getSelectText ( )

Get select link text.

Returns
string select link text

Definition at line 106 of file class.ilRepositorySelectorInputGUI.php.

Referenced by render().

{
return $this->select_text;
}

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::getTableFilterHTML ( )

Get HTML for table filter.

Implements ilTableFilterItem.

Definition at line 307 of file class.ilRepositorySelectorInputGUI.php.

References render().

{
$html = $this->render("table_filter");
return $html;
}

+ Here is the call graph for this function:

ilRepositorySelectorInputGUI::getValue ( )

Get Value.

Returns
int ref id of selected repository item

Definition at line 76 of file class.ilRepositorySelectorInputGUI.php.

References $value.

Referenced by getHighlightedNode(), render(), and showRepositorySelection().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::getVisibleTypes ( )
protected

returns all visible types like container and clickable types

Returns
array

Definition at line 335 of file class.ilRepositorySelectorInputGUI.php.

References getClickableTypes().

Referenced by getHighlightedNode(), and showRepositorySelection().

{
return array_merge((array)$this->container_types, (array)$this->getClickableTypes());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 297 of file class.ilRepositorySelectorInputGUI.php.

References render().

{
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $this->render());
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilRepositorySelectorInputGUI::render (   $a_mode = "property_form")

Render item.

Definition at line 240 of file class.ilRepositorySelectorInputGUI.php.

References $ilCtrl, $lng, $nd, ilFormPropertyGUI\$title, $tpl, getClickableTypes(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getParent(), ilFormPropertyGUI\getPostVar(), getSelectText(), getValue(), and ilUtil\prepareFormOutput().

Referenced by getTableFilterHTML(), and insert().

{
global $lng, $ilCtrl, $ilObjDataCache, $tree;
$tpl = new ilTemplate("tpl.prop_rep_select.html", true, true, "Services/Form");
$tpl->setVariable("POST_VAR", $this->getPostVar());
$tpl->setVariable("ID", $this->getFieldId());
$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
$tpl->setVariable("TXT_SELECT", $this->getSelectText());
$tpl->setVariable("TXT_RESET", $lng->txt("reset"));
switch ($a_mode)
{
case "property_form":
$parent_gui = "ilpropertyformgui";
break;
case "table_filter":
$parent_gui = get_class($this->getParent());
break;
}
$ilCtrl->setParameterByClass("ilrepositoryselectorinputgui",
"postvar", $this->getPostVar());
$tpl->setVariable("HREF_SELECT",
$ilCtrl->getLinkTargetByClass(array($parent_gui, "ilformpropertydispatchgui", "ilrepositoryselectorinputgui"),
"showRepositorySelection"));
$tpl->setVariable("HREF_RESET",
$ilCtrl->getLinkTargetByClass(array($parent_gui, "ilformpropertydispatchgui", "ilrepositoryselectorinputgui"),
"reset"));
if ($this->getValue() > 0 && $this->getValue() != ROOT_FOLDER_ID)
{
$tpl->setVariable("TXT_ITEM",
$ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($this->getValue())));
}
else
{
$nd = $tree->getNodeData(ROOT_FOLDER_ID);
$title = $nd["title"];
if ($title == "ILIAS")
{
$title = $lng->txt("repository");
}
if (in_array($nd["type"], $this->getClickableTypes()))
{
$tpl->setVariable("TXT_ITEM", $title);
}
}
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::reset ( )

Reset.

Definition at line 223 of file class.ilRepositorySelectorInputGUI.php.

References $ilCtrl, $ilUser, ilFormPropertyGUI\getFieldId(), setValue(), and ilFormPropertyGUI\writeToSession().

{
global $ilCtrl, $ilUser;
$anchor = $ilUser->prefs["screen_reader_optimization"]
? $this->getFieldId()."_anchor"
: "";
$this->setValue("");
$this->writeToSession();
$ilCtrl->returnToParent($this, $anchor);
}

+ Here is the call graph for this function:

ilRepositorySelectorInputGUI::selectRepositoryItem ( )

Select repository item.

Definition at line 206 of file class.ilRepositorySelectorInputGUI.php.

References $_GET, $ilCtrl, $ilUser, ilFormPropertyGUI\getFieldId(), setValue(), and ilFormPropertyGUI\writeToSession().

{
global $ilCtrl, $ilUser;
$anchor = $ilUser->prefs["screen_reader_optimization"]
? $this->getFieldId()."_anchor"
: "";
$this->setValue($_GET["root_id"]);
$this->writeToSession();
$ilCtrl->returnToParent($this, $anchor);
}

+ Here is the call graph for this function:

ilRepositorySelectorInputGUI::setClickableTypes (   $a_types)

Set clickable types.

Parameters
arrayclickable types

Definition at line 136 of file class.ilRepositorySelectorInputGUI.php.

Referenced by __construct().

{
$this->clickable_types = $a_types;
}

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::setHeaderMessage (   $a_val)

Set header message.

Parameters
stringheader message

Definition at line 116 of file class.ilRepositorySelectorInputGUI.php.

Referenced by __construct().

{
$this->hm = $a_val;
}

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::setSelectText (   $a_val)

Set select link text.

Parameters
stringselect link text

Definition at line 96 of file class.ilRepositorySelectorInputGUI.php.

Referenced by __construct(), ilSearchBaseGUI\getSearchAreaForm(), ilLPTableBaseGUI\initFilter(), and ilUserTableGUI\initFilter().

{
$this->select_text = $a_val;
}

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::setValue (   $a_value)

Set Value.

Parameters
intref id of selected repository item

Definition at line 66 of file class.ilRepositorySelectorInputGUI.php.

Referenced by reset(), selectRepositoryItem(), and setValueByArray().

{
$this->value = $a_value;
}

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 86 of file class.ilRepositorySelectorInputGUI.php.

References ilFormPropertyGUI\getPostVar(), and setValue().

{
$this->setValue($a_values[$this->getPostVar()]);
}

+ Here is the call graph for this function:

ilRepositorySelectorInputGUI::showRepositorySelection ( )

Select Repository Item.

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

References $ilCtrl, $ilUser, $lng, $tpl, getClickableTypes(), getHeaderMessage(), getHighlightedNode(), ilFormPropertyGUI\getPostVar(), getValue(), getVisibleTypes(), and ilUtil\sendInfo().

{
global $tpl, $lng, $ilCtrl, $tree, $ilUser;
include_once 'Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php';
$ilCtrl->setParameter($this, "postvar", $this->getPostVar());
$exp = new ilRepositorySelectorExplorerGUI($this, "showRepositorySelection",
$this, "selectRepositoryItem", "root_id");
$exp->setTypeWhiteList($this->getVisibleTypes());
$exp->setClickableTypes($this->getClickableTypes());
if($this->getValue())
{
$exp->setPathOpen($this->getValue());
$exp->setHighlightedNode($this->getHighlightedNode());
}
if ($exp->handleCommand())
{
return;
}
// build html-output
$tpl->setContent($exp->getHTML());
}

+ Here is the call graph for this function:

Field Documentation

ilRepositorySelectorInputGUI::$container_types = array("root", "cat", "grp", "fold", "crs")
protected

Definition at line 42 of file class.ilRepositorySelectorInputGUI.php.

ilRepositorySelectorInputGUI::$options
protected

Definition at line 40 of file class.ilRepositorySelectorInputGUI.php.

ilRepositorySelectorInputGUI::$value
protected

Definition at line 41 of file class.ilRepositorySelectorInputGUI.php.

Referenced by getValue().


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