ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPublicSectionSelector Class Reference
+ Inheritance diagram for ilPublicSectionSelector:
+ Collaboration diagram for ilPublicSectionSelector:

Public Member Functions

 ilPublicSectionSelector ($a_target, &$a_lm_obj, $a_gui_class)
 Constructor public. More...
 
 formatHeader ($tpl, $a_obj_id, $a_option)
 overwritten method from base class public More...
 
 getOutput ()
 Creates output recursive method public. More...
 
 formatObject (&$tpl, $a_node_id, $a_option, $a_obj_id=0)
 Creates output recursive method private. More...
 
- Public Member Functions inherited from ilLMExplorer
 ilLMExplorer ($a_target, $a_lm_obj, $a_lang="-")
 Constructor public. More...
 
 formatHeader (&$tpl, $a_obj_id, $a_option)
 overwritten method from base class public More...
 
 isClickable ($a_type, $a_obj_id=0)
 check if links for certain object type are activated More...
 
- Public Member Functions inherited from ilExplorer
 ilExplorer ($a_target)
 Constructor public. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setAsynchExpanding ($a_val)
 Set asynch expanding. More...
 
 getAsynchExpanding ()
 Get asynch expanding. More...
 
 initItemCounter ($a_number)
 Init item counter. More...
 
 setTitle ($a_val)
 Set title. More...
 
 setTitleLength ($a_length)
 Set max title length. More...
 
 getTitleLength ()
 Get max title length. More...
 
 getTitle ()
 Get title. More...
 
 setRoot ($a_root_id)
 Set root node. More...
 
 getRoot ()
 get root id More...
 
 setOrderColumn ($a_column)
 set the order column public More...
 
 setOrderDirection ($a_direction)
 set the order direction public More...
 
 setTargetGet ($a_target_get)
 set the varname in Get-string public More...
 
 setParamsGet ($a_params_get)
 set additional params to be passed in Get-string public More...
 
 setExpandTarget ($a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater ($a_up_frame, $a_up_script, $a_params="")
 Set Explorer Updater. More...
 
 highlightNode ($a_id)
 set highlighted node More...
 
 checkPermissions ($a_check)
 check permissions via rbac More...
 
 setSessionExpandVariable ($a_var_name="expand")
 set name of expand session variable More...
 
 outputIcons ($a_icons)
 output icons More...
 
 setClickable ($a_type, $a_clickable)
 (de-)activates links for a certain object type More...
 
 isVisible ($a_ref_id, $a_type)
 
 setTreeLead ($a_val)
 Set tree leading content. More...
 
 getTreeLead ()
 Get tree leading content. More...
 
 isClickable ($a_type, $a_ref_id=0)
 check if links for certain object type are activated More...
 
 setPostSort ($a_sort)
 process post sorting More...
 
 setFilterMode ($a_mode=IL_FM_NEGATIVE)
 set filter mode More...
 
 getFilterMode ()
 get filter mode More...
 
 setUseStandardFrame ($a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 Get use standard explorer frame. More...
 
 getChildsOfNode ($a_parent_id)
 Get childs of node. More...
 
 setOutput ($a_parent_id, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method public. More...
 
 modifyChilds ($a_parent_id, $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 ()
 Get maximum tree depth. More...
 
 getOutput ()
 Creates output recursive method public. More...
 
 handleListEndTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list start tags ( More...
 
 formatHeader (&$tpl, $a_obj_id, $a_option)
 Creates output for header (is empty here but can be overwritten in derived classes) More...
 
 formatObject (&$tpl, $a_node_id, $a_option, $a_obj_id=0)
 Creates output recursive method private. More...
 
 getImage ($a_name, $a_type="", $a_obj_id="")
 get image path (may be overwritten by derived classes) More...
 
 getImageAlt ($a_default_text, $a_type="", $a_obj_id="")
 get image alt text More...
 
 getNodeStyleClass ($a_id, $a_type)
 get style class for node More...
 
 buildLinkTarget ($a_node_id, $a_type)
 get link target (may be overwritten by derived classes) More...
 
 buildOnClick ($a_node_id, $a_type, $a_title)
 get onclick event handling (may be overwritten by derived classes) More...
 
 buildTitle ($a_title, $a_id, $a_type)
 standard implementation for title, may be overwritten by derived classes More...
 
 buildDescription ($a_desc, $a_id, $a_type)
 standard implementation for description, may be overwritten by derived classes More...
 
 buildSelect ($a_node_id, $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget ($a_type, $a_child=0, $a_obj_id=0)
 get frame target (may be overwritten by derived classes) More...
 
 createTarget ($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
 Creates Get Parameter private. More...
 
 setFrameTarget ($a_target)
 set target frame or not frame? More...
 
 createLines ($a_depth)
 Creates lines for explorer view private. More...
 
 is_in_array ($a_start, $a_depth)
 DESCRIPTION MISSING private. More...
 
 getIndex ($a_data)
 get index of format_options array from specific ref_id,parent_id private More...
 
 addFilter ($a_item)
 adds item to the filter public More...
 
 delFilter ($a_item)
 removes item from the filter public More...
 
 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,...) private More...
 
 forceExpandAll ($a_mode, $a_show_minus=true)
 force expandAll. More...
 
 setFiltered ($a_bool)
 active/deactivate the filter public More...
 
 checkFilter ($a_item)
 check if item is in filter private More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array private More...
 

Data Fields

 $root_id
 
 $output
 
 $ctrl
 
 $selectable_type
 
 $ref_id
 
- Data Fields inherited from ilLMExplorer
 $root_id
 
 $lm_obj
 
 $output
 
- Data Fields inherited from ilExplorer
 $id
 
 $ilias
 
 $output
 
 $format_options
 
 $tree
 
 $target
 
 $target_get
 
 $params_get
 
 $expanded
 
 $order_column
 
 $order_direction = "asc"
 
 $expand_target
 
 $rbac_check
 
 $output_icons
 
 $expand_variable
 
 $is_clickable
 
 $post_sort
 
 $filtered = false
 
 $filter_mode
 
 $expand_all = false
 
 $root_id = null
 
 $use_standard_frame = false
 

Additional Inherited Members

- Protected Member Functions inherited from ilLMExplorer
 checkLPIcon ($a_id)
 
- Protected Attributes inherited from ilLMExplorer
 $lp_cache
 

Detailed Description

Definition at line 35 of file class.ilPublicSectionSelector.php.

Member Function Documentation

◆ formatHeader()

ilPublicSectionSelector::formatHeader (   $tpl,
  $a_obj_id,
  $a_option 
)

overwritten method from base class public

Parameters
integerobj_id
integerarray options
Returns
string

Definition at line 75 of file class.ilPublicSectionSelector.php.

References ilExplorer\$ilias, and $lng.

Referenced by getOutput().

76  {
77  global $lng, $ilias;
78 
79  return;
80 
81  /*
82  $tpl->setCurrentBlock("link");
83  $tpl->setVariable("TITLE", ilUtil::shortenText($this->lm_obj->getTitle(), $this->textwidth, true));
84  $tpl->setVariable("LINK_TARGET", $this->target);
85  $tpl->setVariable("TARGET", " target=\"".$this->frame_target."\"");
86  $tpl->parseCurrentBlock();
87 
88  $tpl->setCurrentBlock("element");
89  $tpl->parseCurrentBlock();
90 
91  //$this->output[] = $tpl->get();
92  */
93  }
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ formatObject()

ilPublicSectionSelector::formatObject ( $tpl,
  $a_node_id,
  $a_option,
  $a_obj_id = 0 
)

Creates output recursive method private.

Parameters
integer
array
Returns
string

Definition at line 164 of file class.ilPublicSectionSelector.php.

References $lng, $tpl, ilLMObject\_isPagePublic(), ilUtil\array_php2js(), ilUtil\getImagePath(), and ilUtil\shortenText().

Referenced by getOutput().

165  {
166  global $lng;
167 
168  if (!isset($a_node_id) or !is_array($a_option))
169  {
170  $this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ".
171  "node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
172  }
173 
174  if ($this->output_icons)
175  {
176  $tpl->setCurrentBlock("icon");
177  $tpl->setVariable("ICON_IMAGE" ,ilUtil::getImagePath("icon_".$a_option["type"].".png"));
178  $tpl->setVariable("PAGE_ID" , $a_node_id);
179 
180  //$this->iconList[] = "iconid_".$a_node_id;
181 
182  $tpl->setVariable("TXT_ALT_IMG", $lng->txt($a_option["desc"]));
183  $tpl->parseCurrentBlock();
184  }
185 
186  if (!$a_option["container"])
187  {
188  $tpl->setCurrentBlock("checkbox");
189  $tpl->setVariable("PAGE_ID", $a_node_id);
190  if (ilLMObject::_isPagePublic($a_node_id))
191  {
192  $tpl->setVariable("CHECKED","checked=\"checked\"");
193  }
194 
195  $tpl->parseCurrentBlock();
196  }
197  else
198  {
199  $childs = $this->tree->getChilds($a_node_id);
200 
201  foreach ($childs as $node)
202  {
203  if ($node["type"] == "pg")
204  {
205  $pages[] = $node["child"];
206  }
207  }
208 
209  $js_pages = ilUtil::array_php2js($pages);
210  $tpl->setVariable("ONCLICK", " onclick=\"alterCheckboxes('PublicSelector','page_',$js_pages); return false;\"");
211  }
212 
213  $tpl->setCurrentBlock("text");
214  $tpl->setVariable("PAGE_ID", $a_node_id);
215  $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
216  $tpl->parseCurrentBlock();
217 
218  $tpl->setCurrentBlock("element");
219  $tpl->parseCurrentBlock();
220 
221  //$this->output[] = $tpl->get();
222  }
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
redirection script todo: (a better solution should control the processing via a xml file) ...
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static array_php2js($data)
convert php arrays to javascript arrays
global $lng
Definition: privfeed.php:40
static _isPagePublic($a_node_id, $a_check_public_mode=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOutput()

ilPublicSectionSelector::getOutput ( )

Creates output recursive method public.

Returns
string

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

References $ilBench, $options, $tpl, ilExplorer\createLines(), formatHeader(), formatObject(), ilExplorer\handleListEndTags(), and ilExplorer\handleListStartTags().

102  {
103  global $ilBench, $tpl;
104 
105  $ilBench->start("Explorer", "getOutput");
106 
107  $this->format_options[0]["tab"] = array();
108 
109  $depth = $this->tree->getMaximumDepth();
110 
111  for ($i=0;$i<$depth;++$i)
112  {
113  $this->createLines($i);
114  }
115 
116  // set global body class
117  $tpl->setBodyClass("il_Explorer");
118 
119  $tpl_tree = new ilTemplate("tpl.tree_form.html", true, true, "Modules/LearningModule");
120 
121  $cur_depth = -1;
122  foreach ($this->format_options as $key => $options)
123  {
124 //echo "-".$options["depth"]."-";
125  if (!$options["visible"])
126  {
127  continue;
128  }
129 
130  // end tags
131  $this->handleListEndTags($tpl_tree, $cur_depth, $options["depth"]);
132 
133  // start tags
134  $this->handleListStartTags($tpl_tree, $cur_depth, $options["depth"]);
135 
136  $cur_depth = $options["depth"];
137 
138  if ($options["visible"] and $key != 0)
139  {
140  $this->formatObject($tpl_tree, $options["child"],$options,$options['obj_id']);
141  }
142  if ($key == 0)
143  {
144  $this->formatHeader($tpl_tree, $options["child"],$options);
145  }
146 
147  }
148 
149  $this->handleListEndTags($tpl_tree, $cur_depth, -1);
150 
151  $ilBench->stop("Explorer", "getOutput");
152 
153  return $tpl_tree->get();
154  }
handleListEndTags(&$a_tpl_tree, $a_cur_depth, $a_item_depth)
handle list end tags ( and )
formatHeader($tpl, $a_obj_id, $a_option)
overwritten method from base class public
if(!is_array($argv)) $options
formatObject(&$tpl, $a_node_id, $a_option, $a_obj_id=0)
Creates output recursive method private.
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
handleListStartTags(&$a_tpl_tree, $a_cur_depth, $a_item_depth)
handle list start tags (
global $ilBench
Definition: ilias.php:18
createLines($a_depth)
Creates lines for explorer view private.
+ Here is the call graph for this function:

◆ ilPublicSectionSelector()

ilPublicSectionSelector::ilPublicSectionSelector (   $a_target,
$a_lm_obj,
  $a_gui_class 
)

Constructor public.

Parameters
stringscriptname
objectlm object
stringgui class name

Definition at line 56 of file class.ilPublicSectionSelector.php.

References $ilCtrl, ilExplorer\forceExpandAll(), and ilExplorer\setSessionExpandVariable().

57  {
58  global $ilCtrl;
59 
60  $this->ctrl =& $ilCtrl;
61  $this->gui_class = $a_gui_class;
62 
63  parent::ilLMExplorer($a_target, $a_lm_obj);
64  $this->forceExpandAll(true);
65  $this->setSessionExpandVariable("lmpublicselectorexpand");
66  }
forceExpandAll($a_mode, $a_show_minus=true)
force expandAll.
global $ilCtrl
Definition: ilias.php:18
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilPublicSectionSelector::$ctrl

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

◆ $output

ilPublicSectionSelector::$output

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

◆ $ref_id

ilPublicSectionSelector::$ref_id

Definition at line 47 of file class.ilPublicSectionSelector.php.

◆ $root_id

ilPublicSectionSelector::$root_id

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

◆ $selectable_type

ilPublicSectionSelector::$selectable_type

Definition at line 46 of file class.ilPublicSectionSelector.php.


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