4 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
32 $this->parent_ref_id = (int)
$_GET[
"ref_id"];
36 $lng->loadLanguageModule(
"classification");
37 $this->
setTitle($lng->txt(
"clsfct_block_title"));
55 $cmd = $ilCtrl->getCmd();
56 $next_class = $ilCtrl->getNextClass($this);
62 if($ilCtrl->isAsynch() &&
$cmd !=
"getAjax" &&
$cmd !=
"filterContainer")
78 if($ilCtrl->isAsynch())
83 switch($ilCtrl->getCmd())
85 case "filterContainer":
94 if(!$ilCtrl->isAsynch())
106 $tpl->addJavaScript(
"Services/Classification/js/ilClassification.js");
118 echo $tpl->getOnLoadCodeForAsynch();
128 foreach($this->providers as $provider)
130 $provider->render($html, $this);
133 $this->tpl->setVariable(
"BLOCK_ROW",
"");
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);
141 $tpl->addOnLoadCode(
'il.Classification.setAjax("'.$ajax_block_id.
'", "'.
142 $ajax_block_url.
'", "'.$ajax_content_id.
'", "'.$ajax_content_url.
'");');
146 $btpl =
new ilTemplate(
"tpl.classification_block.html",
true,
true,
"Services/Classification");
148 foreach($html as $item)
150 $btpl->setCurrentBlock(
"provider_chunk_bl");
151 $btpl->setVariable(
"TITLE", $item[
"title"]);
152 $btpl->setVariable(
"CHUNK", $item[
"html"]);
153 $btpl->parseCurrentBlock();
156 $this->tpl->setVariable(
"DATA", $btpl->get());
167 global $objDefinition,
$lng, $tree, $ilAccess,
$ilCtrl;
177 $all_matching_provider_object_ids = null;
179 foreach($this->providers as $provider)
181 $id = get_class($provider);
186 $provider_object_ids = $provider->getFilteredObjects();
187 if(is_array($all_matching_provider_object_ids))
189 $all_matching_provider_object_ids = array_intersect($matching_provider_object_ids, $provider_object_ids);
193 $all_matching_provider_object_ids = $provider_object_ids;
198 $has_content =
false;
200 $ltpl =
new ilTemplate(
"tpl.classification_object_list.html",
true,
true,
"Services/Classification");
202 if(
sizeof($all_matching_provider_object_ids))
205 "object_reference.ref_id"
206 ,
"object_data.obj_id"
209 ,
"object_data.description"
211 $matching = $tree->getSubTreeFilteredByObjIds($this->parent_ref_id, $all_matching_provider_object_ids, $fields);
212 if(
sizeof($matching))
214 $valid_objects = array();
217 include_once
"Services/Object/classes/class.ilObjectListGUIPreloader.php";
220 foreach($matching as $item)
222 if($item[
"ref_id"] != $this->parent_ref_id &&
223 !$tree->isDeleted($item[
"ref_id"]) &&
224 $ilAccess->checkAccess(
"read",
"", $item[
"ref_id"]))
226 $valid_objects[] = $item;
228 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
232 if(
sizeof($valid_objects))
236 $preloader->preload();
240 $this->item_list_gui = array();
241 foreach($valid_objects as $obj)
243 $type = $obj[
"type"];
246 if (empty($this->item_list_gui[$type]))
248 $class = $objDefinition->getClassName($type);
249 $location = $objDefinition->getLocation($type);
251 $full_class =
"ilObj".$class.
"ListGUI";
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);
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]->enablePayment(
false);
261 $this->item_list_gui[$type]->enableLink(
false);
262 $this->item_list_gui[$type]->enableIcon(
true);
265 foreach($this->providers as $provider)
267 $provider->initListGUI($this->item_list_gui[$type]);
271 $html = $this->item_list_gui[$type]->getListItemHTML(
275 $obj[
"description"]);
279 $css = ($css !=
"tblrow1") ?
"tblrow1" :
"tblrow2";
281 $ltpl->setCurrentBlock(
"res_row");
282 $ltpl->setVariable(
"ROWCLASS", $css);
283 $ltpl->setVariable(
"RESOURCE_HTML", $html);
284 $ltpl->setVariable(
"ALT_TYPE", $lng->txt(
"obj_".$type));
285 $ltpl->setVariable(
"IMG_TYPE",
287 $ltpl->parseCurrentBlock();
294 include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
296 $content_block->setTitle($lng->txt(
"clsfct_content_title"));
297 $content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
"",
true);
301 $content_block->setContent($ltpl->get());
305 $content_block->setContent($lng->txt(
"clsfct_content_no_match"));
308 echo $content_block->getHTML();
314 if(!isset(self::$providers_cache[$this->parent_ref_id]))
316 include_once
"Services/Classification/classes/class.ilClassificationProvider.php";
318 $this->parent_ref_id,
319 $this->parent_obj_id,
320 $this->parent_obj_typ
325 if($a_check_post && (
bool)!
$_REQUEST[
"rdrw"])
327 foreach($this->providers as $provider)
329 $id = get_class($provider);
330 $current = $provider->importPostData(
$_SESSION[self::getBlockType()][$id]);
337 unset(
$_SESSION[self::getBlockType()][$id]);
342 foreach($this->providers as $provider)
344 $id = get_class($provider);
348 $provider->setSelection($current);