ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilClassificationBlockGUI Class Reference

Classification block, displayed in different contexts, e.g. More...

+ Inheritance diagram for ilClassificationBlockGUI:
+ Collaboration diagram for ilClassificationBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 
 getHTML ()
 Handle config status. More...
 
 getAjax ()
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Protected Member Functions

 validate ()
 
 filterContainer ()
 
 initProviders ($a_check_post=false)
 
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Protected Attributes

 $parent_obj_type
 
 $parent_obj_id
 
 $parent_ref_id
 
 $providers
 
 $item_list_gui
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 

Static Protected Attributes

static $providers_cache
 

Detailed Description

Classification block, displayed in different contexts, e.g.

categories

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

@ilCtrl_IsCalledBy ilClassificationBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilClassificationBlockGUI::__construct ( )

Constructor.

Parameters

Reimplemented from ilBlockGUI.

Definition at line 26 of file class.ilClassificationBlockGUI.php.

27 {
28 global $lng;
29
30 parent::__construct();
31
32 $this->parent_ref_id = (int)$_GET["ref_id"];
33 $this->parent_obj_id = ilObject::_lookupObjId($this->parent_ref_id);
34 $this->parent_obj_type = ilObject::_lookupType($this->parent_obj_id);
35
36 $lng->loadLanguageModule("classification");
37 $this->setTitle($lng->txt("clsfct_block_title"));
38 $this->setFooterInfo($lng->txt("clsfct_block_info"));
39 }
$_GET["client_id"]
setFooterInfo($a_footerinfo, $a_hide_and_icon=false)
Set Footer Info.
setTitle($a_title)
Set Title.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
global $lng
Definition: privfeed.php:17

References $_GET, $lng, ilObject\_lookupObjId(), ilObject\_lookupType(), ilBlockGUI\setFooterInfo(), and ilBlockGUI\setTitle().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilClassificationBlockGUI::executeCommand ( )

Definition at line 51 of file class.ilClassificationBlockGUI.php.

52 {
53 global $ilCtrl;
54
55 $cmd = $ilCtrl->getCmd();
56 $next_class = $ilCtrl->getNextClass($this);
57
58 switch ($next_class)
59 {
60 default:
61 // explorer call
62 if($ilCtrl->isAsynch() && $cmd != "getAjax" && $cmd != "filterContainer")
63 {
64 $this->getHTML();
65 }
66 else
67 {
68 $this->$cmd();
69 }
70 break;
71 }
72 }
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35

References $cmd, $ilCtrl, and getHTML().

+ Here is the call graph for this function:

◆ fillDataSection()

ilClassificationBlockGUI::fillDataSection ( )

Standard implementation for row based data.

Overwrite this and call setContent for other data.

Reimplemented from ilBlockGUI.

Definition at line 123 of file class.ilClassificationBlockGUI.php.

124 {
125 global $ilCtrl, $tpl;
126
127 $html = array();
128 foreach($this->providers as $provider)
129 {
130 $provider->render($html, $this);
131 }
132
133 $this->tpl->setVariable("BLOCK_ROW", "");
134
135 $ajax_block_id = "block_".$this->getBlockType()."_0";
136 $ajax_block_url = $ilCtrl->getLinkTarget($this, "getAjax", "", true, false);
137 $ajax_content_id = "il_center_col";
138 $ajax_content_url = $ilCtrl->getLinkTarget($this, "filterContainer", "", true, false);
139
140 // #15008 - always load regardless of content (because of redraw)
141 $tpl->addOnLoadCode('il.Classification.setAjax("'.$ajax_block_id.'", "'.
142 $ajax_block_url.'", "'.$ajax_content_id.'", "'.$ajax_content_url.'");');
143
144 if(sizeof($html))
145 {
146 $btpl = new ilTemplate("tpl.classification_block.html", true, true, "Services/Classification");
147
148 foreach($html as $item)
149 {
150 $btpl->setCurrentBlock("provider_chunk_bl");
151 $btpl->setVariable("TITLE", $item["title"]);
152 $btpl->setVariable("CHUNK", $item["html"]);
153 $btpl->parseCurrentBlock();
154 }
155
156 $this->tpl->setVariable("DATA", $btpl->get());
157 }
158 }
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
$html
Definition: example_001.php:87

References $html, $ilCtrl, League\OAuth2\Client\Provider\$provider, and $tpl.

◆ filterContainer()

ilClassificationBlockGUI::filterContainer ( )
protected

Definition at line 165 of file class.ilClassificationBlockGUI.php.

166 {
167 global $objDefinition, $lng, $tree, $ilAccess, $ilCtrl;
168
169 $this->initProviders();
170
171 // empty selection is invalid
172 if(!$_SESSION[self::getBlockType()])
173 {
174 exit();
175 }
176
177 $all_matching_provider_object_ids = null;
178
179 foreach($this->providers as $provider)
180 {
181 $id = get_class($provider);
182 $current = $_SESSION[self::getBlockType()][$id];
183 if($current)
184 {
185 // combine providers AND
186 $provider_object_ids = $provider->getFilteredObjects();
187 if(is_array($all_matching_provider_object_ids))
188 {
189 $all_matching_provider_object_ids = array_intersect($matching_provider_object_ids, $provider_object_ids);
190 }
191 else
192 {
193 $all_matching_provider_object_ids = $provider_object_ids;
194 }
195 }
196 }
197
198 $has_content = false;
199
200 $ltpl = new ilTemplate("tpl.classification_object_list.html", true, true, "Services/Classification");
201
202 if(sizeof($all_matching_provider_object_ids))
203 {
204 $fields = array(
205 "object_reference.ref_id"
206 ,"object_data.obj_id"
207 ,"object_data.type"
208 ,"object_data.title"
209 ,"object_data.description"
210 );
211 $matching = $tree->getSubTreeFilteredByObjIds($this->parent_ref_id, $all_matching_provider_object_ids, $fields);
212 if(sizeof($matching))
213 {
214 $valid_objects = array();
215
216 // :TODO: not sure if this makes sense...
217 include_once "Services/Object/classes/class.ilObjectListGUIPreloader.php";
219
220 foreach($matching as $item)
221 {
222 if($item["ref_id"] != $this->parent_ref_id &&
223 !$tree->isDeleted($item["ref_id"]) &&
224 $ilAccess->checkAccess("read", "", $item["ref_id"]))
225 {
226 $valid_objects[] = $item;
227
228 $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
229 }
230 }
231
232 if(sizeof($valid_objects))
233 {
234 $has_content = true;
235
236 $preloader->preload();
237
238 // see ilPDTaggingBlockGUI::showResourcesForTag()
239
240 $this->item_list_gui = array();
241 foreach($valid_objects as $obj)
242 {
243 $type = $obj["type"];
244
245 // get list gui class for each object type
246 if (empty($this->item_list_gui[$type]))
247 {
248 $class = $objDefinition->getClassName($type);
249 $location = $objDefinition->getLocation($type);
250
251 $full_class = "ilObj".$class."ListGUI";
252
253 include_once($location."/class.".$full_class.".php");
254 $this->item_list_gui[$type] = new $full_class();
255 $this->item_list_gui[$type]->enableDelete(false);
256 $this->item_list_gui[$type]->enablePath(true, $this->parent_ref_id); // relative path
257 $this->item_list_gui[$type]->enableCut(false);
258 $this->item_list_gui[$type]->enableCopy(false);
259 $this->item_list_gui[$type]->enableSubscribe(false);
260 $this->item_list_gui[$type]->enableLink(false);
261 $this->item_list_gui[$type]->enableIcon(true);
262
263 // :TOOD: for each item or just for each list?
264 foreach($this->providers as $provider)
265 {
266 $provider->initListGUI($this->item_list_gui[$type]);
267 }
268 }
269
270 $html = $this->item_list_gui[$type]->getListItemHTML(
271 $obj["ref_id"],
272 $obj["obj_id"],
273 $obj["title"],
274 $obj["description"]);
275
276 if ($html != "")
277 {
278 $css = ($css != "tblrow1") ? "tblrow1" : "tblrow2";
279
280 $ltpl->setCurrentBlock("res_row");
281 $ltpl->setVariable("ROWCLASS", $css);
282 $ltpl->setVariable("RESOURCE_HTML", $html);
283 $ltpl->setVariable("ALT_TYPE", $lng->txt("obj_".$type));
284 $ltpl->setVariable("IMG_TYPE",
285 ilUtil::getImagePath("icon_".$type.".svg"));
286 $ltpl->parseCurrentBlock();
287 }
288 }
289 }
290 }
291 }
292
293 include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
294 $content_block = new ilPDContentBlockGUI();
295 $content_block->setTitle($lng->txt("clsfct_content_title"));
296 $content_block->addHeaderCommand($ilCtrl->getParentReturn($this), "", true);
297
298 if($has_content)
299 {
300 $content_block->setContent($ltpl->get());
301 }
302 else
303 {
304 $content_block->setContent($lng->txt("clsfct_content_no_match"));
305 }
306
307 echo $content_block->getHTML();
308 exit();
309 }
$location
Definition: buildRTE.php:44
$_SESSION["AccountId"]
Preloader for object list GUIs.
BlockGUI class for (centered) Content on Personal Desktop.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $_SESSION, $html, $ilCtrl, $lng, $location, League\OAuth2\Client\Provider\$provider, ilObjectListGUI\CONTEXT_REPOSITORY, exit, getBlockType(), ilUtil\getImagePath(), and initProviders().

+ Here is the call graph for this function:

◆ getAjax()

ilClassificationBlockGUI::getAjax ( )

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

112 {
113 global $tpl;
114
115 $this->initProviders(true);
116
117 echo $this->getHTML();
118 echo $tpl->getOnLoadCodeForAsynch();
119
120 exit();
121 }

References $tpl, exit, getHTML(), and initProviders().

+ Here is the call graph for this function:

◆ getBlockType()

static ilClassificationBlockGUI::getBlockType ( )
static

Reimplemented from ilBlockGUI.

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

42 {
43 return 'clsfct';
44 }

Referenced by filterContainer(), and initProviders().

+ Here is the caller graph for this function:

◆ getHTML()

ilClassificationBlockGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

Definition at line 90 of file class.ilClassificationBlockGUI.php.

91 {
92 global $tpl, $ilCtrl;
93
94 if(!$ilCtrl->isAsynch())
95 {
96 unset($_SESSION[self::getBlockType()]);
97 }
98
99 $this->initProviders();
100
101 if(!$this->validate())
102 {
103 return "";
104 }
105
106 $tpl->addJavaScript("Services/Classification/js/ilClassification.js");
107
108 return parent::getHTML();
109 }

References $_SESSION, $ilCtrl, $tpl, initProviders(), and validate().

Referenced by executeCommand(), and getAjax().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilClassificationBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Definition at line 74 of file class.ilClassificationBlockGUI.php.

75 {
76 global $ilCtrl;
77
78 if($ilCtrl->isAsynch())
79 {
80 return;
81 }
82
83 switch($ilCtrl->getCmd())
84 {
85 case "filterContainer":
86 return IL_SCREEN_CENTER;
87 }
88 }
const IL_SCREEN_CENTER

References $ilCtrl, and IL_SCREEN_CENTER.

◆ initProviders()

ilClassificationBlockGUI::initProviders (   $a_check_post = false)
protected

Definition at line 311 of file class.ilClassificationBlockGUI.php.

312 {
313 if(!isset(self::$providers_cache[$this->parent_ref_id]))
314 {
315 include_once "Services/Classification/classes/class.ilClassificationProvider.php";
317 $this->parent_ref_id,
318 $this->parent_obj_id,
319 $this->parent_obj_typ
320 );
321 }
322 $this->providers = self::$providers_cache[$this->parent_ref_id];
323
324 if($a_check_post && (bool)!$_REQUEST["rdrw"])
325 {
326 foreach($this->providers as $provider)
327 {
328 $id = get_class($provider);
329 $current = $provider->importPostData($_SESSION[self::getBlockType()][$id]);
330 if($current)
331 {
332 $_SESSION[self::getBlockType()][$id] = $current;
333 }
334 else
335 {
336 unset($_SESSION[self::getBlockType()][$id]);
337 }
338 }
339 }
340
341 foreach($this->providers as $provider)
342 {
343 $id = get_class($provider);
344 $current = $_SESSION[self::getBlockType()][$id];
345 if($current)
346 {
347 $provider->setSelection($current);
348 }
349 }
350 }
static getValidProviders($a_parent_ref_id, $a_parent_obj_id, $a_parent_obj_type)
Get all valid providers (for parent container)

References $_SESSION, $parent_ref_id, League\OAuth2\Client\Provider\$provider, getBlockType(), and ilClassificationProvider\getValidProviders().

Referenced by filterContainer(), getAjax(), and getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

static ilClassificationBlockGUI::isRepositoryObject ( )
static

Reimplemented from ilBlockGUI.

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

47 {
48 return false;
49 }

◆ validate()

ilClassificationBlockGUI::validate ( )
protected

Definition at line 160 of file class.ilClassificationBlockGUI.php.

References $providers.

Referenced by getHTML().

+ Here is the caller graph for this function:

Field Documentation

◆ $item_list_gui

ilClassificationBlockGUI::$item_list_gui
protected

Definition at line 22 of file class.ilClassificationBlockGUI.php.

◆ $parent_obj_id

ilClassificationBlockGUI::$parent_obj_id
protected

Definition at line 19 of file class.ilClassificationBlockGUI.php.

◆ $parent_obj_type

ilClassificationBlockGUI::$parent_obj_type
protected

Definition at line 18 of file class.ilClassificationBlockGUI.php.

◆ $parent_ref_id

ilClassificationBlockGUI::$parent_ref_id
protected

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

Referenced by initProviders().

◆ $providers

ilClassificationBlockGUI::$providers
protected

Definition at line 21 of file class.ilClassificationBlockGUI.php.

Referenced by validate().

◆ $providers_cache

ilClassificationBlockGUI::$providers_cache
staticprotected

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


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