ILIAS  Release_4_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)

Protected Attributes

 $options
 $value
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.

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 49 of file class.ilRepositorySelectorInputGUI.php.

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

{
global $lng;
parent::__construct($a_title, $a_postvar);
$this->setClickableTypes(array("root", "cat", "grp", "fold", "crs"));
$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 155 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 145 of file class.ilRepositorySelectorInputGUI.php.

Referenced by 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 125 of file class.ilRepositorySelectorInputGUI.php.

Referenced by showRepositorySelection().

{
return $this->hm;
}

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::getSelectText ( )

Get select link text.

Returns
string select link text

Definition at line 105 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 299 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 75 of file class.ilRepositorySelectorInputGUI.php.

References $value.

Referenced by render().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilRepositorySelectorInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 289 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 232 of file class.ilRepositorySelectorInputGUI.php.

References $ilCtrl, $lng, 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 215 of file class.ilRepositorySelectorInputGUI.php.

References $ilCtrl, 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 198 of file class.ilRepositorySelectorInputGUI.php.

References $_GET, $ilCtrl, 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 135 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 115 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 95 of file class.ilRepositorySelectorInputGUI.php.

Referenced by __construct(), ilLPProgressTableGUI\initFilter(), ilLPObjectsTableGUI\initFilter(), ilUserTableGUI\initFilter(), and ilSearchGUI\initStandardSearchForm().

{
$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 65 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 85 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 174 of file class.ilRepositorySelectorInputGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, getClickableTypes(), getHeaderMessage(), ilFormPropertyGUI\getPostVar(), ilUtil\sendInfo(), and ilExplorer\setExpand().

{
global $tpl, $lng, $ilCtrl, $tree, $ilUser;
include_once 'Services/Search/classes/class.ilSearchRootSelector.php';
$ilCtrl->setParameter($this, "postvar", $this->getPostVar());
$exp = new ilSearchRootSelector($ilCtrl->getLinkTarget($this,'showRepositorySelection'));
$exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $tree->readRootId());
$exp->setExpandTarget($ilCtrl->getLinkTarget($this,'showRepositorySelection'));
$exp->setTargetClass(get_class($this));
$exp->setCmd('selectRepositoryItem');
$exp->setClickableTypes($this->getClickableTypes());
// build html-output
$exp->setOutput(0);
$tpl->setContent($exp->getOutput());
}

+ Here is the call graph for this function:

Field Documentation

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: