ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWikiAdvMetaDataBlockGUI Class Reference

Advanced metadata wiki block. More...

+ Inheritance diagram for ilWikiAdvMetaDataBlockGUI:
+ Collaboration diagram for ilWikiAdvMetaDataBlockGUI:

Public Member Functions

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

Static Public Member Functions

static getBlockType ()
 Get block type. More...
 
static isRepositoryObject ()
 Is this a repository object. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
static getRecords ($a_wiki_obj_id)
 
static isActive ($a_wiki_obj_id)
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "wikiadvmd"
 
static $st_data
 

Protected Member Functions

 isHidden ()
 Is block currently hidden? More...
 
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Protected Attributes

 $export = false
 
 $obj_id
 
 $ref_id
 
 $page_id
 
 $record
 
 $adv_md_hidden
 
- 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 $records = array()
 

Detailed Description

Advanced metadata wiki block.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

ilWikiAdvMetaDataBlockGUI: ilColumnGUI

Definition at line 17 of file class.ilWikiAdvMetaDataBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWikiAdvMetaDataBlockGUI::__construct ( ilAdvancedMDRecord  $a_record)

Constructor.

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

References $ilCtrl, $lng, ilBlockGUI\setBlockId(), ilBlockGUI\setEnableNumInfo(), and ilBlockGUI\setTitle().

35  {
36  global $ilCtrl, $lng;
37 
38  parent::ilBlockGUI();
39 
40  $this->record = $a_record;
41 
42  $this->setTitle($this->record->getTitle());
43  $this->setBlockId("advmdwiki_".$this->record->getRecordId());
44  $this->setEnableNumInfo(false);
45  // $this->setAvailableDetailLevels(3);
46  $this->allow_moving = false;
47 
48  $lng->loadLanguageModule("wiki");
49  }
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

& ilWikiAdvMetaDataBlockGUI::executeCommand ( )

execute command

Definition at line 89 of file class.ilWikiAdvMetaDataBlockGUI.php.

References $cmd, and $ilCtrl.

90  {
91  global $ilCtrl;
92 
93  $next_class = $ilCtrl->getNextClass();
94  $cmd = $ilCtrl->getCmd("getHTML");
95 
96  switch ($next_class)
97  {
98  default:
99  return $this->$cmd();
100  }
101  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18

◆ fillDataSection()

ilWikiAdvMetaDataBlockGUI::fillDataSection ( )

Fill data section.

Definition at line 162 of file class.ilWikiAdvMetaDataBlockGUI.php.

References $lng, $obj_id, $page_id, ilADTFactory\getInstance(), ilBlockGUI\getTitle(), ilAdvancedMDValues\read(), ilBlockGUI\setDataSection(), ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

163  {
164  global $lng;
165 
166  $btpl = new ilTemplate("tpl.wiki_advmd_block.html", true, true, "Modules/Wiki");
167 
168  // see ilAdvancedMDRecordGUI::parseInfoPage()
169 
172 
173  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
174  include_once('Services/ADT/classes/class.ilADTFactory.php');
175 
176  $values = new ilAdvancedMDValues($this->record->getRecordId(), $this->obj_id, "wpg", $this->page_id);
177 
178  // this correctly binds group and definitions
179  $values->read();
180 
181  $defs = $values->getDefinitions();
182  foreach($values->getADTGroup()->getElements() as $element_id => $element)
183  {
184  $btpl->setCurrentBlock("item");
185  $btpl->setVariable("CAPTION", $defs[$element_id]->getTitle());
186  if($element->isNull())
187  {
188  $value = "-";
189  }
190  else
191  {
192  $value = ilADTFactory::getInstance()->getPresentationBridgeForInstance($element);
193 
194  if($element instanceof ilADTLocation)
195  {
196  $value->setSize("100%", "200px");
197  }
198 
199  $value = $value->getHTML();
200  }
201  $btpl->setVariable("VALUE", $value);
202  $btpl->parseCurrentBlock();
203  }
204 
205  /*
206  if ($this->isHidden())
207  {
208  $btpl->setVariable("HIDDEN_INFO", $lng->txt("wiki_adv_md_hidden"));
209  }
210  */
211 
212  $this->setDataSection($btpl->get());
213 
215 
216  return;
217  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
static setUseRelativeDates($a_status)
set use relative dates
static getInstance()
Get singleton.
static useRelativeDates()
check if relative dates are used
special template class to simplify handling of ITX/PEAR
read()
Get record values.
global $lng
Definition: privfeed.php:40
getTitle()
Get Title.
+ Here is the call graph for this function:

◆ getBlockType()

static ilWikiAdvMetaDataBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Definition at line 56 of file class.ilWikiAdvMetaDataBlockGUI.php.

57  {
58  return self::$block_type;
59  }

◆ getHTML()

ilWikiAdvMetaDataBlockGUI::getHTML (   $a_export = false)

Get block HTML code.

Definition at line 106 of file class.ilWikiAdvMetaDataBlockGUI.php.

References $ilCtrl, $lng, ilBlockGUI\addBlockCommand(), and isHidden().

107  {
108  global $ilCtrl, $lng, $ilAccess;
109 
110  $this->export = $a_export;
111 
112  $has_write = $ilAccess->checkAccess("write", "", $this->ref_id);
113 
114  if ($this->isHidden())
115  {
116  #16029 - hide completely
117  return;
118  }
119 
120  if (!$this->export && $has_write)
121  {
122  $this->addBlockCommand(
123  $ilCtrl->getLinkTargetByClass("ilwikipagegui", "editAdvancedMetaData"),
124  $lng->txt("edit"), "_top");
125 
126  if (!$this->isHidden())
127  {
128  $this->addBlockCommand(
129  $ilCtrl->getLinkTargetByClass("ilwikipagegui", "hideAdvancedMetaData"),
130  $lng->txt("hide"), "_top");
131  }
132  /* #16029 - moved to page actions
133  else
134  {
135  $this->addBlockCommand(
136  $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unhideAdvancedMetaData"),
137  $lng->txt("show"), "_top");
138  }
139  */
140  }
141 
142  return parent::getHTML();
143  }
addBlockCommand($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
global $ilCtrl
Definition: ilias.php:18
isHidden()
Is block currently hidden?
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getRecords()

static ilWikiAdvMetaDataBlockGUI::getRecords (   $a_wiki_obj_id)
static

Definition at line 219 of file class.ilWikiAdvMetaDataBlockGUI.php.

References $records, and ilAdvancedMDRecord\_getSelectedRecordsByObject().

Referenced by ilObjWikiGUI\renderSideBlock().

220  {
221  if(!array_key_exists($a_wiki_obj_id, self::$records))
222  {
223  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
224  self::$records[$a_wiki_obj_id] = ilAdvancedMDRecord::_getSelectedRecordsByObject("wiki", $a_wiki_obj_id, "wpg");
225  }
226  return self::$records[$a_wiki_obj_id];
227  }
$records
Definition: simple_test.php:17
static _getSelectedRecordsByObject($a_obj_type, $a_obj_id, $a_sub_type="")
Get selected records by object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilWikiAdvMetaDataBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

References IL_SCREEN_SIDE.

75  {
76  return IL_SCREEN_SIDE;
77  }
const IL_SCREEN_SIDE

◆ isActive()

static ilWikiAdvMetaDataBlockGUI::isActive (   $a_wiki_obj_id)
static

Definition at line 229 of file class.ilWikiAdvMetaDataBlockGUI.php.

Referenced by ilWikiFunctionsBlockGUI\fillDataSection(), and ilObjWikiGUI\renderSideBlock().

230  {
231  return (bool)sizeof(self::getRecords($a_wiki_obj_id));
232  }
+ Here is the caller graph for this function:

◆ isHidden()

ilWikiAdvMetaDataBlockGUI::isHidden ( )
protected

Is block currently hidden?

Returns
boolean

Definition at line 150 of file class.ilWikiAdvMetaDataBlockGUI.php.

References $adv_md_hidden, and ilWikiPage\lookupAdvancedMetadataHidden().

Referenced by getHTML().

151  {
152  if($this->adv_md_hidden === null)
153  {
154  $this->adv_md_hidden = ilWikiPage::lookupAdvancedMetadataHidden($this->page_id);
155  }
156  return $this->adv_md_hidden;
157  }
static lookupAdvancedMetadataHidden($a_page_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

static ilWikiAdvMetaDataBlockGUI::isRepositoryObject ( )
static

Is this a repository object.

Returns
string Block type.

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

67  {
68  return false;
69  }

◆ setObject()

ilWikiAdvMetaDataBlockGUI::setObject (   $a_wiki_ref_id,
  $a_wiki_obj_id,
  $a_page_id 
)

Definition at line 79 of file class.ilWikiAdvMetaDataBlockGUI.php.

80  {
81  $this->ref_id = $a_wiki_ref_id;
82  $this->obj_id = $a_wiki_obj_id;
83  $this->page_id = $a_page_id;
84  }

Field Documentation

◆ $adv_md_hidden

ilWikiAdvMetaDataBlockGUI::$adv_md_hidden
protected

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

Referenced by isHidden().

◆ $block_type

ilWikiAdvMetaDataBlockGUI::$block_type = "wikiadvmd"
static

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

◆ $export

ilWikiAdvMetaDataBlockGUI::$export = false
protected

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

◆ $obj_id

ilWikiAdvMetaDataBlockGUI::$obj_id
protected

Definition at line 23 of file class.ilWikiAdvMetaDataBlockGUI.php.

Referenced by fillDataSection().

◆ $page_id

ilWikiAdvMetaDataBlockGUI::$page_id
protected

Definition at line 25 of file class.ilWikiAdvMetaDataBlockGUI.php.

Referenced by fillDataSection().

◆ $record

ilWikiAdvMetaDataBlockGUI::$record
protected

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

◆ $records

ilWikiAdvMetaDataBlockGUI::$records = array()
staticprotected

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

◆ $ref_id

ilWikiAdvMetaDataBlockGUI::$ref_id
protected

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

◆ $st_data

ilWikiAdvMetaDataBlockGUI::$st_data
static

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


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