ILIAS  release_8 Revision v8.23
ilAsyncContainerSelectionExplorer Class Reference

Class ilAsyncContainerSelectionExplorer A class for async ilContainerSelectionExplorer which triggers "async_explorer-add_reference" event on the body when clicking a node. More...

+ Inheritance diagram for ilAsyncContainerSelectionExplorer:
+ Collaboration diagram for ilAsyncContainerSelectionExplorer:

Public Member Functions

 __construct (string $target, Factory $refinery, ILIAS\HTTP\Wrapper\RequestWrapper $request_wrapper)
 
 buildOnClick ($node_id, string $type, string $title)
 Creates the onclick function call. More...
 
 buildLinkTarget ($node_id, string $type)
 Sets the href-value to a void js call. More...
 
 getOutput ()
 Returns the explorer html and adds the javascript to the template. More...
 
 initJs ()
 
 addJsConf (string $key, string $value)
 Adds additional js to the onload code of the async explorer. More...
 
 getJsConf (string $key)
 Returns a certain setting of the additional configuration. More...
 
- Public Member Functions inherited from ilContainerSelectionExplorer
 __construct (string $a_target)
 
 setTargetType (string $a_type)
 
 getTargetType ()
 
 isClickable (string $type, int $ref_id=0)
 
 isVisible ($a_ref_id, string $a_type)
 
 formatHeader (ilTemplate $tpl, $a_obj_id, array $a_option)
 
- Public Member Functions inherited from ilExplorer
 setId (string $a_val)
 
 getId ()
 
 setAsynchExpanding (bool $a_val)
 
 getAsynchExpanding ()
 
 initItemCounter (int $a_number)
 
 setTitle (string $a_val)
 
 setTitleLength (int $a_length)
 
 getTitleLength ()
 
 getTitle ()
 
 setRoot ($a_root_id)
 
 getRoot ()
 
 setOrderColumn (string $a_column)
 
 setOrderDirection (string $a_direction)
 
 setTargetGet (string $a_target_get)
 
 setParamsGet (array $a_params_get)
 
 setExpandTarget (string $a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater (string $a_up_frame, string $a_up_script, string $a_params="")
 
 highlightNode (string $a_id)
 
 checkPermissions (bool $a_check)
 
 setSessionExpandVariable (string $a_var_name="expand")
 
 outputIcons (bool $a_icons)
 
 setClickable (string $a_type, bool $a_clickable)
 
 isVisible ( $a_ref_id, string $a_type)
 
 setTreeLead (string $a_val)
 
 getTreeLead ()
 
 isClickable (string $type, int $ref_id=0)
 
 setPostSort (bool $a_sort)
 
 setFilterMode (int $a_mode=IL_FM_NEGATIVE)
 
 getFilterMode ()
 
 setUseStandardFrame (bool $a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 
 getChildsOfNode ($a_parent_id)
 
 setOutput ( $a_parent_id, int $a_depth=1, int $a_obj_id=0, bool $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method. More...
 
 modifyChilds ( $a_parent_id, array $a_objects)
 
 showChilds ($a_parent_id)
 determines wether the childs of an object should be shown or not note: this standard implementation always returns true but it could be overwritten by derived classes (e.g. More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
 getMaximumTreeDepth ()
 
 getOutput ()
 
 handleListEndTags (ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
 handle list start tags ( More...
 
 formatHeader (ilTemplate $tpl, $a_obj_id, array $a_option)
 
 formatObject (ilTemplate $tpl, $a_node_id, array $a_option, $a_obj_id=0)
 
 getImage (string $a_name, string $a_type="", $a_obj_id="")
 
 getImageAlt (string $a_default_text, string $a_type="", $a_obj_id="")
 
 getNodeStyleClass ( $a_id, string $a_type)
 
 buildLinkTarget ( $a_node_id, string $a_type)
 
 buildOnClick ( $a_node_id, string $a_type, string $a_title)
 
 buildTitle (string $a_title, $a_id, string $a_type)
 
 buildDescription (string $a_desc, $a_id, string $a_type)
 
 buildSelect ($a_node_id, string $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget (string $a_type, $a_child=0, $a_obj_id=0)
 
 createTarget (string $a_type, $a_node_id, bool $a_highlighted_subtree=false, bool $a_append_anch=true)
 
 setFrameTarget (string $a_target)
 
 createLines (int $a_depth)
 
 is_in_array (int $a_start, int $a_depth)
 
 getIndex (array $a_data)
 
 addFilter (string $a_item)
 
 delFilter (string $a_item)
 
 setExpand ($a_node_id)
 set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) More...
 
 forceExpandAll (bool $a_mode, bool $a_show_minus=true)
 force expandAll. More...
 
 setFiltered (bool $a_bool)
 
 checkFilter (string $a_item)
 
 sortNodes (array $a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array More...
 

Static Public Member Functions

static addJavascript ()
 Adds the javascript to template. More...
 

Protected Member Functions

 addOnLoadCode (string $id, string $content)
 Adds onload code to the template. More...
 
- Protected Member Functions inherited from ilExplorer
 requestStr (string $key)
 

Protected Attributes

array $js_conf
 
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
 
- Protected Attributes inherited from ilContainerSelectionExplorer
ilAccessHandler $access
 
string $target_type
 
- Protected Attributes inherited from ilExplorer
ilObjectDefinition $obj_definition
 
ilErrorHandling $error
 
ilRbacSystem $rbacsystem
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
 $filter = []
 
string $highlighted = ""
 
bool $show_minus = true
 
int $counter = 0
 
bool $asnch_expanding = false
 
int $textwidth = 0
 
string $title = ""
 
string $up_frame = ""
 
string $a_up_script = ""
 
string $up_params = ""
 
string $frame_target = ""
 
string $up_script = ""
 
string $tree_lead = ""
 
array $iconList = []
 
ILIAS Refinery Factory $refinery
 
ILIAS HTTP Wrapper WrapperFactory $wrapper
 

Static Protected Attributes

static array $js_on_load_added = []
 

Additional Inherited Members

- Data Fields inherited from ilExplorer
string $id = ""
 
string $output = ""
 
array $format_options = []
 
ilTree $tree
 
string $target = ""
 
string $target_get = ""
 
string $params_get = ""
 
array $expanded = []
 
string $order_column = ""
 
string $order_direction = "asc"
 
string $expand_target = null
 
bool $rbac_check = false
 
bool $output_icons = false
 
string $expand_variable = ""
 
array $is_clickable = []
 
bool $post_sort = false
 
bool $filtered = false
 
bool $filter_mode
 
bool $expand_all = false
 
 $root_id = null
 
bool $use_standard_frame = false
 

Detailed Description

Class ilAsyncContainerSelectionExplorer A class for async ilContainerSelectionExplorer which triggers "async_explorer-add_reference" event on the body when clicking a node.

Author
Michael Herren mh@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Definition at line 31 of file class.ilAsyncContainerSelectionExplorer.php.

Constructor & Destructor Documentation

◆ __construct()

ilAsyncContainerSelectionExplorer::__construct ( string  $target,
Factory  $refinery,
ILIAS\HTTP\Wrapper\RequestWrapper  $request_wrapper 
)
Parameters
$targetstring url for the onclick event of a node

Definition at line 48 of file class.ilAsyncContainerSelectionExplorer.php.

References ilExplorer\$refinery, $request_wrapper, ILIAS\GlobalScreen\Provider\__construct(), addJsConf(), and ILIAS\Repository\refinery().

49  {
51 
52  $this->addJsConf('save_explorer_url', $target);
53 
54  $this->request_wrapper = $request_wrapper;
55  $this->refinery = $refinery;
56  }
ILIAS Refinery Factory $refinery
addJsConf(string $key, string $value)
Adds additional js to the onload code of the async explorer.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addJavascript()

static ilAsyncContainerSelectionExplorer::addJavascript ( )
static

Adds the javascript to template.

Definition at line 61 of file class.ilAsyncContainerSelectionExplorer.php.

References $DIC, ilExplorer\$tpl, and ilGlobalTemplateInterface\addJavaScript().

Referenced by ilObjStudyProgrammeTreeGUI\initAsyncUIElements().

61  : void
62  {
63  global $DIC;
64  $tpl = $DIC['tpl'];
65 
66  $tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
67  }
ilGlobalTemplateInterface $tpl
global $DIC
Definition: feed.php:28
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addJsConf()

ilAsyncContainerSelectionExplorer::addJsConf ( string  $key,
string  $value 
)

Adds additional js to the onload code of the async explorer.

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

References ILIAS\LTI\ToolProvider\$key.

Referenced by __construct().

136  : void
137  {
138  $this->js_conf[$key] = $value;
139  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the caller graph for this function:

◆ addOnLoadCode()

ilAsyncContainerSelectionExplorer::addOnLoadCode ( string  $id,
string  $content 
)
protected

Adds onload code to the template.

Definition at line 125 of file class.ilAsyncContainerSelectionExplorer.php.

References ilExplorer\$id.

Referenced by initJs().

125  : void
126  {
127  if (!isset(self::$js_on_load_added[$id])) {
128  $this->tpl->addOnLoadCode($content);
129  self::$js_on_load_added[$id] = $content;
130  }
131  }
+ Here is the caller graph for this function:

◆ buildLinkTarget()

ilAsyncContainerSelectionExplorer::buildLinkTarget (   $node_id,
string  $type 
)

Sets the href-value to a void js call.

Definition at line 92 of file class.ilAsyncContainerSelectionExplorer.php.

92  : string
93  {
94  return "javascript:void(0);";
95  }

◆ buildOnClick()

ilAsyncContainerSelectionExplorer::buildOnClick (   $node_id,
string  $type,
string  $title 
)

Creates the onclick function call.

Definition at line 72 of file class.ilAsyncContainerSelectionExplorer.php.

References $ref_id, and ILIAS\Repository\refinery().

72  : string
73  {
74  $result = "";
75  $ref_id = $this->request_wrapper->retrieve("ref_id", $this->refinery->kindlyTo()->int());
76  if ($ref_id) {
77  $result =
78  "$('body').trigger('async_explorer-add_reference', {target_id: '" .
79  $node_id .
80  "', type: '" .
81  $type .
82  "', parent_id: '" .
83  $ref_id .
84  "'});";
85  }
86  return $result;
87  }
$type
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:

◆ getJsConf()

ilAsyncContainerSelectionExplorer::getJsConf ( string  $key)

Returns a certain setting of the additional configuration.

Definition at line 144 of file class.ilAsyncContainerSelectionExplorer.php.

References ILIAS\LTI\ToolProvider\$key.

144  : string
145  {
146  return $this->js_conf[$key];
147  }
string $key
Consumer key/client ID value.
Definition: System.php:193

◆ getOutput()

ilAsyncContainerSelectionExplorer::getOutput ( )

Returns the explorer html and adds the javascript to the template.

Definition at line 100 of file class.ilAsyncContainerSelectionExplorer.php.

References initJs().

100  : string
101  {
102  $this->initJs();
103 
104  return parent::getOutput();
105  }
+ Here is the call graph for this function:

◆ initJs()

ilAsyncContainerSelectionExplorer::initJs ( )

Definition at line 111 of file class.ilAsyncContainerSelectionExplorer.php.

References addOnLoadCode(), and ilExplorer\getId().

Referenced by getOutput(), and ilObjStudyProgrammeTreeGUI\initAsyncUIElements().

111  : void
112  {
113  $this->addOnLoadCode(
114  'explorer',
115  '$("#' . $this->getId() . '").study_programme_async_explorer(' . json_encode(
116  $this->js_conf,
117  JSON_THROW_ON_ERROR
118  ) . ');'
119  );
120  }
addOnLoadCode(string $id, string $content)
Adds onload code to the template.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $js_conf

array ilAsyncContainerSelectionExplorer::$js_conf
protected

Definition at line 36 of file class.ilAsyncContainerSelectionExplorer.php.

◆ $js_on_load_added

array ilAsyncContainerSelectionExplorer::$js_on_load_added = []
staticprotected

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

◆ $request_wrapper

ILIAS HTTP Wrapper RequestWrapper ilAsyncContainerSelectionExplorer::$request_wrapper
protected

Definition at line 43 of file class.ilAsyncContainerSelectionExplorer.php.

Referenced by __construct().


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