ILIAS  release_8 Revision v8.23
ilObjectMetaDataBlockGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjectMetaDataBlockGUI:
+ Collaboration diagram for ilObjectMetaDataBlockGUI:

Public Member Functions

 __construct (ilAdvancedMDRecord $record, ?array $decorator_callback=null)
 Takes as an optional second input an array consisting of the object that the method that should be called back to belongs to, and a string with the name of the method. More...
 
 getBlockType ()
 
 setValues (ilAdvancedMDValues $a_values)
 
 executeCommand ()
 execute command More...
 
 fillDataSection ()
 Fill data section. More...
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 correctOffset ()
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 
 getBlockCommands ()
 
 getHTML ()
 
 fillHeaderCommands ()
 
 fillHeaderTitleBlock ()
 
 setDataSection (string $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 (array $a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 
 setPreviousNextLinks ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 
 getNoItemFoundContent ()
 

Static Public Member Functions

static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 

Static Public Attributes

static string $block_type = "advmd"
 

Protected Member Functions

 isRepositoryObject ()
 
 getLegacyContent ()
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 fillRowColor (string $a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getViewControls ()
 Get view controls. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 send (string $output)
 Send. More...
 

Protected Attributes

ilAdvancedMDRecord $record
 
ilAdvancedMDValues $values
 
array $callback
 
bool $new_rendering = true
 
- Protected Attributes inherited from ilBlockGUI
object $gui_object
 
ILIAS Block StandardGUIRequest $request
 
ILIAS Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 
bool $new_rendering = false
 

Static Protected Attributes

static array $records = []
 

Additional Inherited Members

- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 
const PRES_MAIN_TILE = 4
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Metadata block

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om ilObjectMetaDataBlockGUI: ilColumnGUI

Definition at line 27 of file class.ilObjectMetaDataBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectMetaDataBlockGUI::__construct ( ilAdvancedMDRecord  $record,
?array  $decorator_callback = null 
)

Takes as an optional second input an array consisting of the object that the method that should be called back to belongs to, and a string with the name of the method.

Parameters
ilAdvancedMDRecord$record
null|array{0ilObject, 1: string} $decorator_callback

Definition at line 43 of file class.ilObjectMetaDataBlockGUI.php.

References $DIC, $record, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ilAdvancedMDRecordTranslations\getInstanceByRecordId(), ILIAS\Repository\lng(), ilBlockGUI\setBlockId(), ilBlockGUI\setEnableNumInfo(), and ilBlockGUI\setTitle().

44  {
45  global $DIC;
46 
47  $this->ctrl = $DIC->ctrl();
48  $this->lng = $DIC->language();
49 
50 
52 
53  $this->record = $record;
54  $this->callback = $decorator_callback;
55 
56  $translations = ilAdvancedMDRecordTranslations::getInstanceByRecordId($this->record->getRecordId());
57  $this->setTitle($translations->getTitleForLanguage($this->lng->getLangKey()));
58  $this->setBlockId("advmd_" . $this->record->getRecordId());
59  $this->setEnableNumInfo(false);
60  $this->allow_moving = false;
61  }
setBlockId(string $a_block_id="0")
setEnableNumInfo(bool $a_enablenuminfo)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
setTitle(string $a_title)
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilObjectMetaDataBlockGUI::executeCommand ( )

execute command

Definition at line 95 of file class.ilObjectMetaDataBlockGUI.php.

References ILIAS\Repository\ctrl().

95  : void
96  {
97  $this->ctrl->getNextClass();
98  $cmd = $this->ctrl->getCmd("getHTML");
99  $this->$cmd();
100  }
+ Here is the call graph for this function:

◆ fillDataSection()

ilObjectMetaDataBlockGUI::fillDataSection ( )

Fill data section.

Definition at line 105 of file class.ilObjectMetaDataBlockGUI.php.

References getLegacyContent(), and ilBlockGUI\setDataSection().

105  : void
106  {
107  $this->setDataSection($this->getLegacyContent());
108  }
setDataSection(string $a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
+ Here is the call graph for this function:

◆ getBlockType()

ilObjectMetaDataBlockGUI::getBlockType ( )

Definition at line 66 of file class.ilObjectMetaDataBlockGUI.php.

66  : string
67  {
68  return self::$block_type;
69  }

◆ getLegacyContent()

ilObjectMetaDataBlockGUI::getLegacyContent ( )
protected

Definition at line 120 of file class.ilObjectMetaDataBlockGUI.php.

References ilADTFactory\getInstance(), ilAdvancedMDFieldTranslations\getInstanceByRecordId(), ILIAS\LTI\ToolProvider\getRecordId(), ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

Referenced by fillDataSection().

120  : string
121  {
122  $btpl = new ilTemplate("tpl.advmd_block.html", true, true, "Services/Object");
123 
124  // see ilAdvancedMDRecordGUI::parseInfoPage()
125 
128 
129  // this correctly binds group and definitions
130  $this->values->read();
131 
132  $defs = $this->values->getDefinitions();
133  foreach ($this->values->getADTGroup()->getElements() as $element_id => $element) {
134  $field_translations = ilAdvancedMDFieldTranslations::getInstanceByRecordId($defs[$element_id]->getRecordId());
135 
136  $btpl->setCurrentBlock("item");
137  $btpl->setVariable("CAPTION", $field_translations->getTitleForLanguage($element_id, $this->lng->getLangKey()));
138  if ($element->isNull()) {
139  $value = "-";
140  } else {
141  $value = ilADTFactory::getInstance()->getPresentationBridgeForInstance($element);
142 
143  if (in_array($element->getType(), array("MultiEnum", "Enum", "Text"))) {
144  $value->setDecoratorCallBack($this->callback);
145  }
146 
147  $value = $value->getHTML();
148  }
149  $btpl->setVariable("VALUE", $value);
150  $btpl->parseCurrentBlock();
151  }
152 
153  $html = $btpl->get();
154 
156 
157  return $html;
158  }
getRecordId()
Get the system record ID.
Definition: System.php:214
static setUseRelativeDates(bool $a_status)
set use relative dates
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilObjectMetaDataBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Definition at line 82 of file class.ilObjectMetaDataBlockGUI.php.

References IL_SCREEN_SIDE.

82  : string
83  {
84  return IL_SCREEN_SIDE;
85  }
const IL_SCREEN_SIDE

◆ isRepositoryObject()

ilObjectMetaDataBlockGUI::isRepositoryObject ( )
protected

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

74  : bool
75  {
76  return false;
77  }

◆ setValues()

ilObjectMetaDataBlockGUI::setValues ( ilAdvancedMDValues  $a_values)

Definition at line 87 of file class.ilObjectMetaDataBlockGUI.php.

87  : void
88  {
89  $this->values = $a_values;
90  }

Field Documentation

◆ $block_type

string ilObjectMetaDataBlockGUI::$block_type = "advmd"
static

Definition at line 29 of file class.ilObjectMetaDataBlockGUI.php.

◆ $callback

array ilObjectMetaDataBlockGUI::$callback
protected

Definition at line 34 of file class.ilObjectMetaDataBlockGUI.php.

◆ $new_rendering

bool ilObjectMetaDataBlockGUI::$new_rendering = true
protected

Definition at line 114 of file class.ilObjectMetaDataBlockGUI.php.

◆ $record

ilAdvancedMDRecord ilObjectMetaDataBlockGUI::$record
protected

Definition at line 32 of file class.ilObjectMetaDataBlockGUI.php.

Referenced by __construct().

◆ $records

array ilObjectMetaDataBlockGUI::$records = []
staticprotected

Definition at line 30 of file class.ilObjectMetaDataBlockGUI.php.

◆ $values

ilAdvancedMDValues ilObjectMetaDataBlockGUI::$values
protected

Definition at line 33 of file class.ilObjectMetaDataBlockGUI.php.


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