ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilExplorerSelectInputGUI Class Reference

Select explorer tree nodes input GUI. More...

+ Inheritance diagram for ilExplorerSelectInputGUI:
+ Collaboration diagram for ilExplorerSelectInputGUI:

Public Member Functions

 __construct ($a_title, $a_postvar, $a_explorer_gui, $a_multi=false)
 Constructor.
 getExplHandleCmd ()
 Get explorer handle command function.
 handleExplorerCommand ()
 Handle explorer command.
 getTitleForNodeId ($a_id)
 Get title for node id (needs to be overwritten, if explorer is not a tree eplorer.
 setValue ($a_value)
 Set Value.
 getValue ()
 Get Value.
 setValueByArray ($a_values)
 Set value by array.
 checkInput ()
 Check input, strip slashes etc.
 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
 __construct ($a_title="", $a_postvar="")
 Constructor.
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.

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.
 getMultiIconsHTML ()
 Get HTML for multiple value icons.
- 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

Select explorer tree nodes input GUI.

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

Definition at line 16 of file class.ilExplorerSelectInputGUI.php.

Constructor & Destructor Documentation

ilExplorerSelectInputGUI::__construct (   $a_title,
  $a_postvar,
  $a_explorer_gui,
  $a_multi = false 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

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

References $lng, and ilFormPropertyGUI\setType().

{
global $lng;
$this->multi_nodes = $a_multi;
$this->explorer_gui = $a_explorer_gui;
parent::__construct($a_title, $a_postvar);
$this->setType("exp_select");
}

+ Here is the call graph for this function:

Member Function Documentation

ilExplorerSelectInputGUI::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 111 of file class.ilExplorerSelectInputGUI.php.

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

{
global $lng;
// sanitize
if ($this->multi_nodes)
{
if (!is_array($_POST[$this->getPostVar()]))
{
$_POST[$this->getPostVar()] = array();
}
foreach ($_POST[$this->getPostVar()] as $k => $v)
{
$_POST[$this->getPostVar()][$k] = ilUtil::stripSlashes($v);
}
}
else
{
}
// check required
if ($this->getRequired())
{
if ((!$this->multi_nodes && trim($_POST[$this->getPostVar()]) == "") ||
($this->multi_nodes && count($_POST[$this->getPostVar()]) == 0))
{
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
}
return true;
}

+ Here is the call graph for this function:

ilExplorerSelectInputGUI::getExplHandleCmd ( )

Get explorer handle command function.

Parameters
@return

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

Referenced by ilTaxSelectInputGUI\__construct().

{
return "handleExplorerCommand";
}

+ Here is the caller graph for this function:

ilExplorerSelectInputGUI::getTableFilterHTML ( )

Get HTML for table filter.

Implements ilTableFilterItem.

Definition at line 244 of file class.ilExplorerSelectInputGUI.php.

References render().

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

+ Here is the call graph for this function:

ilExplorerSelectInputGUI::getTitleForNodeId (   $a_id)
abstract

Get title for node id (needs to be overwritten, if explorer is not a tree eplorer.

Parameters
@return

Reimplemented in ilTaxSelectInputGUI.

Referenced by render().

+ Here is the caller graph for this function:

ilExplorerSelectInputGUI::getValue ( )

Get Value.

Returns
mixed tax node id or array of node ids (multi mode)

Definition at line 91 of file class.ilExplorerSelectInputGUI.php.

Referenced by render().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilExplorerSelectInputGUI::handleExplorerCommand ( )

Handle explorer command.

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

{
$this->explorer_gui->handleCommand();
}
ilExplorerSelectInputGUI::insert ( $a_tpl)

Insert property html.

Parameters
ilTemplate

Definition at line 234 of file class.ilExplorerSelectInputGUI.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:

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

Render item.

Definition at line 150 of file class.ilExplorerSelectInputGUI.php.

References $GLOBALS, $ilCtrl, $lng, $tpl, ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getPostVar(), getTitleForNodeId(), getValue(), and ilYuiUtil\initPanel().

Referenced by getTableFilterHTML(), and insert().

{
global $lng, $ilCtrl, $ilObjDataCache, $tree;
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
$GLOBALS["tpl"]->addJavascript("./Services/UIComponent/Explorer2/js/Explorer2.js");
$tpl = new ilTemplate("tpl.prop_expl_select.html", true, true, "Services/UIComponent/Explorer2");
// set values
$val = $this->getValue();
if (is_array($val))
{
$val_txt = $sep = "";
foreach ($val as $v)
{
$tpl->setCurrentBlock("node_hid");
$tpl->setVariable("HID_NAME", $this->getPostVar()."[]");
$tpl->setVariable("HID_VAL", $v);
$tpl->parseCurrentBlock();
$val_txt.= $sep.$this->getTitleForNodeId($v);
$sep = ", ";
$this->explorer_gui->setNodeOpen($v);
$this->explorer_gui->setNodeSelected($v);
}
$tpl->setVariable("VAL_TXT", $val_txt);
}
else if ($val != "")
{
$tpl->setCurrentBlock("node_hid");
$tpl->setVariable("HID_NAME", $this->getPostVar());
$tpl->setVariable("HID_VAL", $val);
$tpl->parseCurrentBlock();
$tpl->setVariable("VAL_TXT", $this->getTitleForNodeId($val));
$this->explorer_gui->setNodeOpen($val);
$this->explorer_gui->setNodeSelected($val);
}
$tpl->setVariable("POST_VAR", $this->getPostVar());
$tpl->setVariable("ID", $this->getFieldId());
// $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
$tpl->setVariable("TXT_SELECT", $lng->txt("select"));
$tpl->setVariable("TXT_RESET", $lng->txt("reset"));
$tpl->setVariable("EXPL", $this->explorer_gui->getHTML());
$top_tb = new ilToolbarGUI();
$top_tb->addButton($lng->txt("select"), "#", "", "", "", "", "submit ilExplSelectInputButS");
$top_tb->addButton($lng->txt("cancel"), "#", "", "", "", "", "submit ilExplSelectInputButC");
$tpl->setVariable("TOP_TB", $top_tb->getHTML());
$tpl->setVariable("BOT_TB", $top_tb->getHTML());
//$tpl->setVariable("HREF_SELECT",
// $ilCtrl->getLinkTargetByClass(array($parent_gui, "ilformpropertydispatchgui", "ilrepositoryselectorinputgui"),
// "showRepositorySelection"));
/*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:

ilExplorerSelectInputGUI::setValue (   $a_value)

Set Value.

Parameters
mixedtax node id or array of node ids (multi mode)

Definition at line 67 of file class.ilExplorerSelectInputGUI.php.

Referenced by setValueByArray().

{
if ($this->multi_nodes && !is_array($a_value))
{
if ($a_value !== false)
{
$this->value = array($a_value);
}
else
{
$this->value = array();
}
}
else
{
$this->value = $a_value;
}
}

+ Here is the caller graph for this function:

ilExplorerSelectInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 101 of file class.ilExplorerSelectInputGUI.php.

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

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

+ Here is the call graph for this function:


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