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");
79 $next_class =
$ilCtrl->getNextClass($this);
81 switch ($next_class) {
84 if (
$ilCtrl->isAsynch() && $cmd !=
"getAjax" && $cmd !=
"filterContainer") {
104 case "filterContainer":
124 $tpl->addJavaScript(
"Services/Classification/js/ilClassification.js");
126 return parent::getHTML();
136 echo $tpl->getOnLoadCodeForAsynch();
148 foreach ($this->providers as
$provider) {
149 $provider->render(
$html, $this);
152 $this->tpl->setVariable(
"BLOCK_ROW",
"");
154 $ajax_block_id =
"block_" . $this->
getBlockType() .
"_0";
155 $ajax_block_url =
$ilCtrl->getLinkTarget($this,
"getAjax",
"",
true,
false);
156 $ajax_content_id =
"il_center_col";
157 $ajax_content_url =
$ilCtrl->getLinkTarget($this,
"filterContainer",
"",
true,
false);
160 $tabs->setBackTarget($this->lng->txt(
"clsfct_back_to_cat"),
$ilCtrl->getParentReturn($this));
161 $tabs->addTab(
"sel_objects", $this->lng->txt(
"clsfct_selected_objects"),
"#");
162 $tabs_html =
$tabs->getHTML();
166 $tpl->addOnLoadCode(
'il.Classification.setAjax("' . $ajax_block_id .
'", "' .
167 $ajax_block_url .
'", "' . $ajax_content_id .
'", "' . $ajax_content_url .
'", ' . json_encode($tabs_html) .
');');
170 $btpl =
new ilTemplate(
"tpl.classification_block.html",
true,
true,
"Services/Classification");
172 foreach (
$html as $item) {
173 $btpl->setCurrentBlock(
"provider_chunk_bl");
174 $btpl->setVariable(
"TITLE", $item[
"title"]);
175 $btpl->setVariable(
"CHUNK", $item[
"html"]);
176 $btpl->parseCurrentBlock();
179 $this->tpl->setVariable(
"DATA", $btpl->get());
203 $all_matching_provider_object_ids = null;
205 foreach ($this->providers as
$provider) {
206 $id = get_class($provider);
210 $provider_object_ids = $provider->getFilteredObjects();
211 if (is_array($all_matching_provider_object_ids)) {
212 $all_matching_provider_object_ids = array_intersect($matching_provider_object_ids, $provider_object_ids);
214 $all_matching_provider_object_ids = $provider_object_ids;
219 $has_content =
false;
221 $ltpl =
new ilTemplate(
"tpl.classification_object_list.html",
true,
true,
"Services/Classification");
223 if (
sizeof($all_matching_provider_object_ids)) {
225 "object_reference.ref_id" 226 ,
"object_data.obj_id" 229 ,
"object_data.description" 231 $matching =
$tree->getSubTreeFilteredByObjIds($this->parent_ref_id, $all_matching_provider_object_ids, $fields);
232 if (
sizeof($matching)) {
233 $valid_objects = array();
236 include_once
"Services/Object/classes/class.ilObjectListGUIPreloader.php";
239 foreach ($matching as $item) {
240 if ($item[
"ref_id"] != $this->parent_ref_id &&
241 !
$tree->isDeleted($item[
"ref_id"]) &&
242 $ilAccess->checkAccess(
"visible",
"", $item[
"ref_id"])) {
247 foreach (
$tree->getPathFull($item[
"ref_id"]) as $p) {
248 if (in_array($p[
"type"], array(
"root",
"cat",
"crs",
"grp"))) {
249 $block_ref_id = $p[
"ref_id"];
250 $block_title = $p[
"title"];
253 if ($block_ref_id > 0) {
254 if (!is_array($valid_objects[$block_ref_id])) {
255 $valid_objects[$block_ref_id] = array(
256 "title" => $block_title,
260 $valid_objects[$block_ref_id][
"items"][] = $item;
263 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
267 if (
sizeof($valid_objects)) {
270 $preloader->preload();
274 $this->item_list_gui = array();
275 foreach ($valid_objects as $block) {
277 foreach ($items as $obj) {
278 $type = $obj[
"type"];
281 if (empty($this->item_list_gui[
$type])) {
282 $class = $objDefinition->getClassName($type);
283 $location = $objDefinition->getLocation($type);
285 $full_class =
"ilObj" . $class .
"ListGUI";
287 include_once(
$location .
"/class." . $full_class .
".php");
288 $this->item_list_gui[
$type] =
new $full_class();
289 $this->item_list_gui[
$type]->enableDelete(
false);
290 $this->item_list_gui[
$type]->enablePath(
292 $this->parent_ref_id,
295 $this->item_list_gui[
$type]->enableLinkedPath(
true);
296 $this->item_list_gui[
$type]->enableCut(
false);
297 $this->item_list_gui[
$type]->enableCopy(
false);
298 $this->item_list_gui[
$type]->enableSubscribe(
false);
299 $this->item_list_gui[
$type]->enableLink(
false);
300 $this->item_list_gui[
$type]->enableIcon(
true);
303 foreach ($this->providers as $provider) {
304 $provider->initListGUI($this->item_list_gui[$type]);
308 $html = $this->item_list_gui[
$type]->getListItemHTML(
316 $ltpl->setCurrentBlock(
"res_row");
317 $ltpl->setVariable(
"RESOURCE_HTML",
$html);
318 $ltpl->parseCurrentBlock();
321 $ltpl->setCurrentBlock(
"block");
322 $ltpl->setVariable(
"BLOCK_TITLE", $block[
"title"]);
323 $ltpl->parseCurrentBlock();
333 echo $tpl->getMessageHTML(
$lng->txt(
"clsfct_content_no_match"),
"info");
341 if (!isset(self::$providers_cache[$this->parent_ref_id])) {
342 include_once
"Services/Classification/classes/class.ilClassificationProvider.php";
344 $this->parent_ref_id,
345 $this->parent_obj_id,
346 $this->parent_obj_typ
351 if ($a_check_post && (
bool) !$_REQUEST[
"rdrw"]) {
352 foreach ($this->providers as
$provider) {
353 $id = get_class($provider);
363 foreach ($this->providers as
$provider) {
364 $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
PathGUI which handles materials assigned to sessions.
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)