4 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
40 $this->lng = $DIC->language();
41 $this->ctrl = $DIC->ctrl();
42 $this->obj_definition = $DIC[
"objDefinition"];
43 $this->tree = $DIC->repositoryTree();
44 $this->access = $DIC->access();
45 $lng = $DIC->language();
47 parent::__construct();
49 $this->parent_ref_id = (int)
$_GET[
"ref_id"];
53 $lng->loadLanguageModule(
"classification");
73 $next_class =
$ilCtrl->getNextClass($this);
75 switch ($next_class) {
78 if (
$ilCtrl->isAsynch() && $cmd !=
"getAjax" && $cmd !=
"filterContainer") {
98 case "filterContainer":
118 $tpl->addJavaScript(
"Services/Classification/js/ilClassification.js");
120 return parent::getHTML();
130 echo
$tpl->getOnLoadCodeForAsynch();
142 foreach ($this->providers as
$provider) {
143 $provider->render(
$html, $this);
146 $this->tpl->setVariable(
"BLOCK_ROW",
"");
148 $ajax_block_id =
"block_" . $this->
getBlockType() .
"_0";
149 $ajax_block_url =
$ilCtrl->getLinkTarget($this,
"getAjax",
"",
true,
false);
150 $ajax_content_id =
"il_center_col";
151 $ajax_content_url =
$ilCtrl->getLinkTarget($this,
"filterContainer",
"",
true,
false);
154 $tabs->setBackTarget($this->lng->txt(
"clsfct_back_to_cat"),
$ilCtrl->getParentReturn($this));
155 $tabs->addTab(
"sel_objects", $this->lng->txt(
"clsfct_selected_objects"),
"#");
156 $tabs_html =
$tabs->getHTML();
160 $tpl->addOnLoadCode(
'il.Classification.setAjax("' . $ajax_block_id .
'", "' .
161 $ajax_block_url .
'", "' . $ajax_content_id .
'", "' . $ajax_content_url .
'", ' . json_encode($tabs_html) .
');');
164 $btpl =
new ilTemplate(
"tpl.classification_block.html",
true,
true,
"Services/Classification");
166 foreach (
$html as $item) {
167 $btpl->setCurrentBlock(
"provider_chunk_bl");
168 $btpl->setVariable(
"TITLE", $item[
"title"]);
169 $btpl->setVariable(
"CHUNK", $item[
"html"]);
170 $btpl->parseCurrentBlock();
173 $this->tpl->setVariable(
"DATA", $btpl->get());
197 $all_matching_provider_object_ids = null;
199 foreach ($this->providers as
$provider) {
200 $id = get_class($provider);
204 $provider_object_ids = $provider->getFilteredObjects();
205 if (is_array($all_matching_provider_object_ids)) {
206 $all_matching_provider_object_ids = array_intersect($matching_provider_object_ids, $provider_object_ids);
208 $all_matching_provider_object_ids = $provider_object_ids;
213 $has_content =
false;
215 $ltpl =
new ilTemplate(
"tpl.classification_object_list.html",
true,
true,
"Services/Classification");
217 if (
sizeof($all_matching_provider_object_ids)) {
219 "object_reference.ref_id" 220 ,
"object_data.obj_id" 223 ,
"object_data.description" 225 $matching =
$tree->getSubTreeFilteredByObjIds($this->parent_ref_id, $all_matching_provider_object_ids, $fields);
226 if (
sizeof($matching)) {
227 $valid_objects =
array();
230 include_once
"Services/Object/classes/class.ilObjectListGUIPreloader.php";
233 foreach ($matching as $item) {
234 if ($item[
"ref_id"] != $this->parent_ref_id &&
235 !
$tree->isDeleted($item[
"ref_id"]) &&
236 $ilAccess->checkAccess(
"visible",
"", $item[
"ref_id"])) {
241 foreach (
$tree->getPathFull($item[
"ref_id"]) as $p) {
242 if (in_array($p[
"type"],
array(
"root",
"cat",
"crs",
"grp"))) {
243 $block_ref_id = $p[
"ref_id"];
244 $block_title = $p[
"title"];
247 if ($block_ref_id > 0) {
248 if (!is_array($valid_objects[$block_ref_id])) {
249 $valid_objects[$block_ref_id] =
array(
250 "title" => $block_title,
254 $valid_objects[$block_ref_id][
"items"][] = $item;
257 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
261 if (
sizeof($valid_objects)) {
264 $preloader->preload();
268 $this->item_list_gui =
array();
269 foreach ($valid_objects as $block) {
271 foreach ($items as $obj) {
272 $type = $obj[
"type"];
275 if (empty($this->item_list_gui[
$type])) {
276 $class = $objDefinition->getClassName($type);
277 $location = $objDefinition->getLocation($type);
279 $full_class =
"ilObj" . $class .
"ListGUI";
281 include_once(
$location .
"/class." . $full_class .
".php");
282 $this->item_list_gui[
$type] =
new $full_class();
283 $this->item_list_gui[
$type]->enableDelete(
false);
284 $this->item_list_gui[
$type]->enablePath(
true, $this->parent_ref_id);
285 $this->item_list_gui[
$type]->enableLinkedPath(
true);
286 $this->item_list_gui[
$type]->enableCut(
false);
287 $this->item_list_gui[
$type]->enableCopy(
false);
288 $this->item_list_gui[
$type]->enableSubscribe(
false);
289 $this->item_list_gui[
$type]->enableLink(
false);
290 $this->item_list_gui[
$type]->enableIcon(
true);
293 foreach ($this->providers as $provider) {
294 $provider->initListGUI($this->item_list_gui[$type]);
298 $html = $this->item_list_gui[
$type]->getListItemHTML(
306 $ltpl->setCurrentBlock(
"res_row");
307 $ltpl->setVariable(
"RESOURCE_HTML",
$html);
308 $ltpl->parseCurrentBlock();
311 $ltpl->setCurrentBlock(
"block");
312 $ltpl->setVariable(
"BLOCK_TITLE", $block[
"title"]);
313 $ltpl->parseCurrentBlock();
323 echo
$tpl->getMessageHTML(
$lng->txt(
"clsfct_content_no_match"),
"info");
331 if (!isset(self::$providers_cache[$this->parent_ref_id])) {
332 include_once
"Services/Classification/classes/class.ilClassificationProvider.php";
334 $this->parent_ref_id,
335 $this->parent_obj_id,
336 $this->parent_obj_typ
341 if ($a_check_post && (
bool) !$_REQUEST[
"rdrw"]) {
342 foreach ($this->providers as
$provider) {
343 $id = get_class($provider);
353 foreach ($this->providers as
$provider) {
354 $id = get_class($provider);
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getValidProviders($a_parent_ref_id, $a_parent_obj_id, $a_parent_obj_type)
Get all valid providers (for parent container)
setFooterInfo($a_footerinfo, $a_hide_and_icon=false)
Set Footer Info.
if(!array_key_exists('StateId', $_REQUEST)) $id
Classification block, displayed in different contexts, e.g.
Preloader for object list GUIs.
setTitle($a_title)
Set Title.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static isRepositoryObject()
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
if(!empty($this->data['faventry'])) $tabs
This class represents a block method of a block.
initProviders($a_check_post=false)