ILIAS  release_4-4 Revision
ilShopExplorer Class Reference

Class ilShopExplorer class for explorer view. More...

+ Inheritance diagram for ilShopExplorer:
+ Collaboration diagram for ilShopExplorer:

Public Member Functions

 ilShopExplorer ($tpl, $a_target, $a_ref_id)
 Constructor public. More...
 
 renderTree ()
 
 setOutput ($a_parent, $a_depth=1)
 Creates output for explorer view in admin menue recursive method public. More...
 
 getOutput ()
 
- 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
 
 $target = null
 
 $payment_objects = array()
 
- 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
 

Detailed Description

Class ilShopExplorer class for explorer view.

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de
Version
$Id:$

Definition at line 20 of file class.ilShopExplorer.php.

Member Function Documentation

◆ getOutput()

ilShopExplorer::getOutput ( )

Definition at line 143 of file class.ilShopExplorer.php.

144  {
145  return true;
146 
147  }

◆ ilShopExplorer()

ilShopExplorer::ilShopExplorer (   $tpl,
  $a_target,
  $a_ref_id 
)

Constructor public.

Parameters
stringscriptname

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

References $tpl, ilExplorer\$tree, ilExplorer\addFilter(), ilPaymentObject\getAllBuyableObjects(), IL_FM_NEGATIVE, ilExplorer\setFiltered(), and ilExplorer\setFilterMode().

45  {
46  global $tree;
47 
48  $this->tree = $tree;
49  $this->tpl = $tpl;
50  $this->target = $a_target;
51 
52  $this->payment_objects = ilPaymentObject::getAllBuyableObjects();
53 
54  $this->tpl->addCss('./Services/Payment/css/shop_tree.css');
55 
56  $this->addFilter("root");
57  $this->addFilter("cat");
58  $this->addFilter('catr');
59  $this->addFilter("grp");
60  $this->addFilter("icrs");
61  $this->addFilter("crs");
62  $this->addFilter('crsr');
63  $this->addFilter('rcrs');
64  $this->addFilter('file');
65  $this->addFilter('tst');
66  $this->addFilter('exc');
67  $this->setFiltered(true);
69 
70  }
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
setFiltered($a_bool)
active/deactivate the filter public
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
addFilter($a_item)
adds item to the filter public
const IL_FM_NEGATIVE
+ Here is the call graph for this function:

◆ renderTree()

ilShopExplorer::renderTree ( )

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

References setOutput().

73  {
74  $this->setOutput(0);
75  }
setOutput($a_parent, $a_depth=1)
Creates output for explorer view in admin menue recursive method public.
+ Here is the call graph for this function:

◆ setOutput()

ilShopExplorer::setOutput (   $a_parent,
  $a_depth = 1 
)

Creates output for explorer view in admin menue recursive method public.

Parameters
integerparent_node_id where to start from (default=0, 'root')
integerdepth level where to start (default=1)
Returns
string

Definition at line 85 of file class.ilShopExplorer.php.

References $ilCtrl, $ref_id, ilExplorer\$tree, ilPaymentObject\_isBuyable(), and ilExplorer\checkFilter().

Referenced by renderTree().

86  {
87  global $ilCtrl, $tree;
88 
89  $this->root_id = $tree->getRootId();
90 
91  if($a_parent < $a_depth)
92  {
93  foreach($this->payment_objects as $ref_id)
94  {
95  $objects = $tree->getPathFull($ref_id);
96 
97  foreach($objects as $object)
98  {
99  if($object['child'] == $this->root_id)
100  {
101  $href = $ilCtrl->getLinkTargetByClass('ilshopgui','');
102 
103  $title ="<span style='white-space:wrap;' class='frmTitle'><a class='small' href='".$href."'>"
104  .stripslashes($object['title'])."</a></span>"
105  ."<div style='white-space:nowrap; margin-bottom:5px;' class='small'></div>";
106 
107  $this->tpl->setVariable('TREE_ROOT_NODE_VARIABLE', 'Node'.$object['child']);
108  $this->tpl->setVariable('TREE_ROOT_NODE_LINK', $title);
109 
110  // Recursive
111  $this->setOutput($object['child'], $a_depth);
112  }
113  else
114  {
115  if($this->checkFilter($object['type']) && ilPaymentObject::_isBuyable($object['ref_id']))
116  {
117 
118  }
119  else
120  if($this->checkFilter($object['type']) && !ilPaymentObject::_isBuyable($object['ref_id']))
121  {
122  $href = $ilCtrl->getLinkTargetByClass('ilshopgui','');
123  $title ="<span style='white-space:wrap;' class='frmTitle'><a class='small' href='".$href."&tree_ref_id=".$object['child']."'>"
124  .stripslashes($object['title'])."</a></span>"
125  ."<div style='white-space:nowrap; margin-bottom:5px;' class='small'></div>";
126 
127  $this->tpl->setCurrentBlock('nodes');
128  $this->tpl->setVariable('NODES_VARNAME', 'Node'.$object['child']);
129  $this->tpl->setVariable('NODES_PARENT_VARNAME', 'Node'.$object['parent']);
130  $this->tpl->setVariable('NODES_LINK', $title);
131  $this->tpl->parseCurrentBlock();
132 
133  // Recursive
134  $this->setOutput($object['child'], $a_depth);
135  }
136  }
137  } //foreach
138  }
139  }
140  } //function
setOutput($a_parent, $a_depth=1)
Creates output for explorer view in admin menue recursive method public.
global $ilCtrl
Definition: ilias.php:18
static _isBuyable($a_ref_id, $a_subtype='')
checkFilter($a_item)
check if item is in filter private
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $payment_objects

ilShopExplorer::$payment_objects = array()

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

◆ $root_id

ilShopExplorer::$root_id

Definition at line 27 of file class.ilShopExplorer.php.

◆ $target

ilShopExplorer::$target = null

Definition at line 29 of file class.ilShopExplorer.php.


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