ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilClassificationBlockGUI Class Reference

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

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

Public Member Functions

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

Static Public Member Functions

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

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.

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$

ilClassificationBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

ilClassificationBlockGUI::__construct ( )

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

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

{
global $lng;
$this->parent_ref_id = (int)$_GET["ref_id"];
$this->parent_obj_id = ilObject::_lookupObjId($this->parent_ref_id);
$this->parent_obj_type = ilObject::_lookupType($this->parent_obj_id);
$lng->loadLanguageModule("classification");
$this->setTitle($lng->txt("clsfct_block_title"));
$this->setFooterInfo($lng->txt("clsfct_block_info"));
}

+ Here is the call graph for this function:

Member Function Documentation

ilClassificationBlockGUI::executeCommand ( )

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

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

{
global $ilCtrl;
$cmd = $ilCtrl->getCmd();
$next_class = $ilCtrl->getNextClass($this);
switch ($next_class)
{
default:
// explorer call
if($ilCtrl->isAsynch() && $cmd != "getAjax" && $cmd != "filterContainer")
{
$this->getHTML();
}
else
{
$this->$cmd();
}
break;
}
}

+ Here is the call graph for this function:

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.

References $ilCtrl, and $tpl.

{
global $ilCtrl, $tpl;
$html = array();
foreach($this->providers as $provider)
{
$provider->render($html, $this);
}
$this->tpl->setVariable("BLOCK_ROW", "");
$ajax_block_id = "block_".$this->getBlockType()."_0";
$ajax_block_url = $ilCtrl->getLinkTarget($this, "getAjax", "", true, false);
$ajax_content_id = "il_center_col";
$ajax_content_url = $ilCtrl->getLinkTarget($this, "filterContainer", "", true, false);
// #15008 - always load regardless of content (because of redraw)
$tpl->addOnLoadCode('il.Classification.setAjax("'.$ajax_block_id.'", "'.
$ajax_block_url.'", "'.$ajax_content_id.'", "'.$ajax_content_url.'");');
if(sizeof($html))
{
$btpl = new ilTemplate("tpl.classification_block.html", true, true, "Services/Classification");
foreach($html as $item)
{
$btpl->setCurrentBlock("provider_chunk_bl");
$btpl->setVariable("TITLE", $item["title"]);
$btpl->setVariable("CHUNK", $item["html"]);
$btpl->parseCurrentBlock();
}
$this->tpl->setVariable("DATA", $btpl->get());
}
}
ilClassificationBlockGUI::filterContainer ( )
protected

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

References $_SESSION, $ilCtrl, $lng, $location, ilObjectListGUI\CONTEXT_REPOSITORY, exit, getBlockType(), ilUtil\getImagePath(), and initProviders().

{
global $objDefinition, $lng, $tree, $ilAccess, $ilCtrl;
$this->initProviders();
// empty selection is invalid
if(!$_SESSION[self::getBlockType()])
{
exit();
}
$all_matching_provider_object_ids = null;
foreach($this->providers as $provider)
{
$id = get_class($provider);
$current = $_SESSION[self::getBlockType()][$id];
if($current)
{
// combine providers AND
$provider_object_ids = $provider->getFilteredObjects();
if(is_array($all_matching_provider_object_ids))
{
$all_matching_provider_object_ids = array_intersect($matching_provider_object_ids, $provider_object_ids);
}
else
{
$all_matching_provider_object_ids = $provider_object_ids;
}
}
}
$has_content = false;
$ltpl = new ilTemplate("tpl.classification_object_list.html", true, true, "Services/Classification");
if(sizeof($all_matching_provider_object_ids))
{
$fields = array(
"object_reference.ref_id"
,"object_data.obj_id"
,"object_data.type"
,"object_data.title"
,"object_data.description"
);
$matching = $tree->getSubTreeFilteredByObjIds($this->parent_ref_id, $all_matching_provider_object_ids, $fields);
if(sizeof($matching))
{
$valid_objects = array();
// :TODO: not sure if this makes sense...
include_once "Services/Object/classes/class.ilObjectListGUIPreloader.php";
foreach($matching as $item)
{
if($item["ref_id"] != $this->parent_ref_id &&
!$tree->isDeleted($item["ref_id"]) &&
$ilAccess->checkAccess("read", "", $item["ref_id"]))
{
$valid_objects[] = $item;
$preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
}
}
if(sizeof($valid_objects))
{
$has_content = true;
$preloader->preload();
// see ilPDTaggingBlockGUI::showResourcesForTag()
$this->item_list_gui = array();
foreach($valid_objects as $obj)
{
$type = $obj["type"];
// get list gui class for each object type
if (empty($this->item_list_gui[$type]))
{
$class = $objDefinition->getClassName($type);
$location = $objDefinition->getLocation($type);
$full_class = "ilObj".$class."ListGUI";
include_once($location."/class.".$full_class.".php");
$this->item_list_gui[$type] = new $full_class();
$this->item_list_gui[$type]->enableDelete(false);
$this->item_list_gui[$type]->enablePath(true, $this->parent_ref_id); // relative path
$this->item_list_gui[$type]->enableCut(false);
$this->item_list_gui[$type]->enableCopy(false);
$this->item_list_gui[$type]->enableSubscribe(false);
$this->item_list_gui[$type]->enablePayment(false);
$this->item_list_gui[$type]->enableLink(false);
$this->item_list_gui[$type]->enableIcon(true);
// :TOOD: for each item or just for each list?
foreach($this->providers as $provider)
{
$provider->initListGUI($this->item_list_gui[$type]);
}
}
$html = $this->item_list_gui[$type]->getListItemHTML(
$obj["ref_id"],
$obj["obj_id"],
$obj["title"],
$obj["description"]);
if ($html != "")
{
$css = ($css != "tblrow1") ? "tblrow1" : "tblrow2";
$ltpl->setCurrentBlock("res_row");
$ltpl->setVariable("ROWCLASS", $css);
$ltpl->setVariable("RESOURCE_HTML", $html);
$ltpl->setVariable("ALT_TYPE", $lng->txt("obj_".$type));
$ltpl->setVariable("IMG_TYPE",
ilUtil::getImagePath("icon_".$type.".svg"));
$ltpl->parseCurrentBlock();
}
}
}
}
}
include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
$content_block = new ilPDContentBlockGUI();
$content_block->setTitle($lng->txt("clsfct_content_title"));
$content_block->addHeaderCommand($ilCtrl->getParentReturn($this), "", true);
if($has_content)
{
$content_block->setContent($ltpl->get());
}
else
{
$content_block->setContent($lng->txt("clsfct_content_no_match"));
}
echo $content_block->getHTML();
exit();
}

+ Here is the call graph for this function:

ilClassificationBlockGUI::getAjax ( )

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

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

{
global $tpl;
$this->initProviders(true);
echo $this->getHTML();
echo $tpl->getOnLoadCodeForAsynch();
exit();
}

+ Here is the call graph for this function:

static ilClassificationBlockGUI::getBlockType ( )
static

Reimplemented from ilBlockGUI.

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

Referenced by filterContainer(), and initProviders().

{
return 'clsfct';
}

+ Here is the caller graph for this function:

ilClassificationBlockGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

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

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

Referenced by executeCommand(), and getAjax().

{
global $tpl, $ilCtrl;
if(!$ilCtrl->isAsynch())
{
unset($_SESSION[self::getBlockType()]);
}
$this->initProviders();
if(!$this->validate())
{
return "";
}
$tpl->addJavaScript("Services/Classification/js/ilClassification.js");
return parent::getHTML();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilClassificationBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

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

References $ilCtrl, and IL_SCREEN_CENTER.

{
global $ilCtrl;
if($ilCtrl->isAsynch())
{
return;
}
switch($ilCtrl->getCmd())
{
case "filterContainer":
}
}
ilClassificationBlockGUI::initProviders (   $a_check_post = false)
protected

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

References $_REQUEST, $_SESSION, $parent_ref_id, getBlockType(), and ilClassificationProvider\getValidProviders().

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

{
if(!isset(self::$providers_cache[$this->parent_ref_id]))
{
include_once "Services/Classification/classes/class.ilClassificationProvider.php";
$this->parent_ref_id,
$this->parent_obj_id,
$this->parent_obj_typ
);
}
$this->providers = self::$providers_cache[$this->parent_ref_id];
if($a_check_post && (bool)!$_REQUEST["rdrw"])
{
foreach($this->providers as $provider)
{
$id = get_class($provider);
$current = $provider->importPostData($_SESSION[self::getBlockType()][$id]);
if($current)
{
$_SESSION[self::getBlockType()][$id] = $current;
}
else
{
unset($_SESSION[self::getBlockType()][$id]);
}
}
}
foreach($this->providers as $provider)
{
$id = get_class($provider);
$current = $_SESSION[self::getBlockType()][$id];
if($current)
{
$provider->setSelection($current);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilClassificationBlockGUI::isRepositoryObject ( )
static

Reimplemented from ilBlockGUI.

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

{
return false;
}
ilClassificationBlockGUI::validate ( )
protected

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

References $providers.

Referenced by getHTML().

{
return sizeof($this->providers);
}

+ Here is the caller graph for this function:

Field Documentation

ilClassificationBlockGUI::$item_list_gui
protected

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

ilClassificationBlockGUI::$parent_obj_id
protected

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

ilClassificationBlockGUI::$parent_obj_type
protected

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

ilClassificationBlockGUI::$parent_ref_id
protected

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

Referenced by initProviders().

ilClassificationBlockGUI::$providers
protected

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

Referenced by validate().

ilClassificationBlockGUI::$providers_cache
staticprotected

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


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