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

Class ilDataCollectionField. More...

+ Inheritance diagram for ilDataCollectionILIASRefField:
+ Collaboration diagram for ilDataCollectionILIASRefField:

Public Member Functions

 __construct (ilDataCollectionRecord $record, ilDataCollectionField $field)
 
 getHTML (array $options=array())
 
 getSingleHTML (array $options=array())
 
 getLinkHTML ($title, $show_action_menu=false)
 
 getExportValue ()
 
 getStatus ()
 
- Public Member Functions inherited from ilDataCollectionRecordField
 __construct (ilDataCollectionRecord $record, ilDataCollectionField $field)
 
 doUpdate ()
 Update object in database. More...
 
 delete ()
 Delete record field in database. More...
 
 getValue ()
 
 setValue ($value, $omit_parsing=false)
 Set value for record field. More...
 
 getFormInput ()
 
 getExportValue ()
 
 getPlainText ()
 
 getHTML ($link=true)
 
 getSortingValue ($link=true)
 
 getSingleHTML ()
 
 getField ()
 
 getId ()
 
 getRecord ()
 

Protected Member Functions

 getActionLink ($mode)
 
- Protected Member Functions inherited from ilDataCollectionRecordField
 doRead ()
 Read object data from database. More...
 
 doCreate ()
 Create object in database. More...
 
 loadValue ()
 Load the value. More...
 

Protected Attributes

 $dcl_obj_id
 
 $properties = array()
 
- Protected Attributes inherited from ilDataCollectionRecordField
 $id
 
 $field
 
 $record
 
 $value
 
 $lng
 
 $user
 
 $ctrl
 
 $db
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDataCollectionILIASRefField::__construct ( ilDataCollectionRecord  $record,
ilDataCollectionField  $field 
)

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

References ilDataCollectionRecordField\getField(), ilDataCollectionField\getProperties(), and ilDataCollectionCache\getTableCache().

33  {
34  parent::__construct($record, $field);
35  $dclTable = ilDataCollectionCache::getTableCache($this->getField()->getTableId());
36  $this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
37  $this->properties = $field->getProperties();
38  }
getProperties()
Get all properties of a field.
+ Here is the call graph for this function:

Member Function Documentation

◆ getActionLink()

ilDataCollectionILIASRefField::getActionLink (   $mode)
protected
Parameters
string$modecopy|link
Returns
string

Definition at line 125 of file class.ilDataCollectionILIASRefField.php.

References $ilCtrl, and ilDataCollectionRecordField\getValue().

Referenced by getLinkHTML().

126  {
127  global $ilCtrl;
128  switch ($mode) {
129  case 'copy':
130  $ilCtrl->setParameterByClass('ilobjectcopygui', 'item_ref_id', $this->getValue());
131  $ilCtrl->setParameterByClass('ilobjrootfoldergui', 'item_ref_id', $this->getValue());
132  $ilCtrl->setParameterByClass('ilobjectcopygui', 'source_id', $this->getValue());
133  return $ilCtrl->getLinkTargetByClass('ilobjectcopygui', 'initTargetSelection');
134  case 'link':
135  return $ilCtrl->getLinkTargetByClass(array('ilrepositorygui','ilobjrootfoldergui'), 'link');
136  default:
137  return '';
138  }
139  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExportValue()

ilDataCollectionILIASRefField::getExportValue ( )

Definition at line 101 of file class.ilDataCollectionILIASRefField.php.

References ilDataCollectionRecordField\$value, ilLink\_getStaticLink(), and ilDataCollectionRecordField\getValue().

101  {
102  $value = $this->getValue();
104  return $link;
105  }
+ Here is the call graph for this function:

◆ getHTML()

ilDataCollectionILIASRefField::getHTML ( array  $options = array())
Parameters
array$options
Returns
mixed|string

Definition at line 45 of file class.ilDataCollectionILIASRefField.php.

References ilDataCollectionRecordField\$id, ilDataCollectionRecordField\$value, ilObject\_lookupObjId(), ilObject\_lookupTitle(), getLinkHTML(), ilDataCollectionRecordField\getValue(), ilDataCollectionField\PROPERTYID_DISPLAY_COPY_LINK_ACTION_MENU, and ilDataCollectionField\PROPERTYID_ILIAS_REFERENCE_LINK.

45  {
46  $value = $this->getValue();
47  if (!$value) {
48  return '';
49  }
51  $title = ilObject::_lookupTitle($id);
53  $html = $this->getLinkHTML($title, true);
54  } else if ($this->properties[ilDataCollectionField::PROPERTYID_ILIAS_REFERENCE_LINK]) {
55  $html = $this->getLinkHTML($title);
56  } else {
57  $html = $title;
58  }
59  return $html;
60  }
static _lookupTitle($a_id)
lookup object title
getLinkHTML($title, $show_action_menu=false)
static _lookupObjId($a_id)
+ Here is the call graph for this function:

◆ getLinkHTML()

ilDataCollectionILIASRefField::getLinkHTML (   $title,
  $show_action_menu = false 
)
Parameters
$title
$show_action_menu
Returns
string

Definition at line 83 of file class.ilDataCollectionILIASRefField.php.

References ilDataCollectionRecordField\$lng, ilLink\_getStaticLink(), getActionLink(), ilDataCollectionRecordField\getValue(), and ilDataCollectionField\PROPERTYID_ILIAS_REFERENCE_LINK.

Referenced by getHTML(), and getSingleHTML().

83  {
84  global $lng;
85  $link = ilLink::_getStaticLink($this->getValue());
86  if ($show_action_menu) {
87  $list = new ilAdvancedSelectionListGUI();
88  $list->setId('adv_list_copy_link_' . $this->field->getId() . $this->record->getId());
89  $list->setListTitle($title);
91  $list->addItem($lng->txt('view'), 'view', $link);
92  }
93  $list->addItem($lng->txt('copy'), 'copy', $this->getActionLink('copy'));
94  $list->addItem($lng->txt('link'), 'link', $this->getActionLink('link'));
95  return $list->getHTML();
96  } else {
97  return "<a href=\"$link\">$title</a>";
98  }
99  }
User interface class for advanced drop-down selection lists.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSingleHTML()

ilDataCollectionILIASRefField::getSingleHTML ( array  $options = array())

◆ getStatus()

ilDataCollectionILIASRefField::getStatus ( )

Definition at line 107 of file class.ilDataCollectionILIASRefField.php.

References $ilDB, $ilUser, $query, $result, ilObject2\_lookupObjectId(), DB_FETCHMODE_OBJECT, and ilDataCollectionRecordField\getValue().

107  {
108  global $ilDB, $ilUser;
109  $usr_id = $ilUser->getId();
110  $obj_ref = $this->getValue();
111  $obj_id = ilObject2::_lookupObjectId($obj_ref);
112  $query = " SELECT status_changed, status
113  FROM ut_lp_marks
114  WHERE usr_id = ".$usr_id." AND obj_id = ".$obj_id."
115 ";
116  $result = $ilDB->query($query);
117  return ($result->numRows() == 0)? false:$result->fetchRow(DB_FETCHMODE_OBJECT);
118  }
$result
static _lookupObjectId($a_ref_id)
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $dcl_obj_id

ilDataCollectionILIASRefField::$dcl_obj_id
protected

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

◆ $properties

ilDataCollectionILIASRefField::$properties = array()
protected

Definition at line 31 of file class.ilDataCollectionILIASRefField.php.


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