5include_once
"./Services/Xml/classes/class.ilXmlWriter.php";
66 $this->user_id =
$ilUser->getId();
72 $this->mode = $a_mode;
77 $this->highlighter = $a_highlighter;
84 $this->check_permission = $a_status;
94 $this->user_id = $a_id;
103 $this->enable_operations = $a_status;
116 $this->enable_references = $a_stat;
133 return $this->objects ? $this->objects : array();
140 $ilAccess =
$DIC[
'ilAccess'];
141 $objDefinition =
$DIC[
'objDefinition'];
146 if (method_exists($object,
'getType') and $objDefinition->isRBACObject($object->getType())) {
147 if ($this->
isPermissionCheckEnabled() and !$ilAccess->checkAccessOfUser($this->getUserId(),
'read',
'', $object->getRefId())) {
151 $this->__appendObject($object);
165 public function __appendObject(
ilObject $object)
169 $tree =
$DIC[
'tree'];
170 $rbacreview =
$DIC[
'rbacreview'];
175 $objectDefinition =
$DIC[
'objDefinition'];
177 $id = $object->
getId();
178 if ($object->
getType() ==
"role" && $rbacreview->isRoleDeleted($id)) {
187 if ($objectDefinition->supportsOfflineHandling($object->
getType())) {
196 if ($this->mode == self::MODE_SEARCH_RESULT) {
198 if ($this->highlighter->getTitle($object->
getId(), 0)) {
199 $title = $this->highlighter->getTitle($object->
getId(), 0);
202 if ($this->highlighter->getDescription($object->
getId(), 0)) {
203 $description = $this->highlighter->getDescription($object->
getId(), 0);
207 #$this->xmlElement('Title', null, $title);
208 #$this->xmlElement('Description',null,$description);
209 #$this->xmlElement('SearchResultContent', null, $this->highlighter->getContent($object->getId(),0));
233 foreach ($refs as $ref_id) {
235 if (!$tree->isInTree($ref_id)) {
241 'parent_id'=> $tree->getParentId(intval($ref_id))
262 $tree =
$DIC[
'tree'];
264 if (!$tree->checkForParentType($a_ref_id,
'crs')) {
267 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
270 switch ($time_targets[
'timing_type']) {
287 # if($type == self::TIMING_TEMPORARILY_AVAILABLE)
292 array(
'starting_time' => $time_targets[
'timing_start'],
293 'ending_time' => $time_targets[
'timing_end'],
294 'visibility' => $vis)
298 # if($type == self::TIMING_PRESETTING)
303 'starting_time' => $time_targets[
'suggestion_start'],
304 'ending_time' => $time_targets[
'suggestion_end'],
305 'changeable' => $time_targets[
'changeable'])
322 include_once
'./Modules/File/classes/class.ilObjFileAccess.php';
326 $this->
xmlElement(
"Property", array(
'name' =>
'fileSize'), (
int)
$size);
327 $this->
xmlElement(
"Property", array(
'name' =>
'fileExtension'), (
string) $extension);
341 $ilAccess =
$DIC[
'ilAccess'];
342 $rbacreview =
$DIC[
'rbacreview'];
343 $objDefinition =
$DIC[
'objDefinition'];
346 $ops = $rbacreview->getOperationsOnTypeString(
$a_type);
347 if (is_array($ops)) {
348 foreach ($ops as $ops_id) {
349 $operation = $rbacreview->getOperation($ops_id);
351 if (count($operation) && $ilAccess->checkAccessOfUser($this->getUserId(), $operation[
'operation'],
'view', $a_ref_id)) {
352 $this->
xmlElement(
'Operation',
null, $operation[
'operation']);
361 $creation_operations = array();
363 $ops_id = $ops_ids[
$type];
369 $operation = $rbacreview->getOperation($ops_id);
371 if (count($operation) && $ilAccess->checkAccessOfUser($this->getUserId(), $operation[
'operation'],
'view', $a_ref_id)) {
372 $this->
xmlElement(
'Operation',
null, $operation[
'operation']);
387 $this->
xmlSetDtdDef(
"<!DOCTYPE Objects PUBLIC \"-//ILIAS//DTD ILIAS Repositoryobjects//EN\" \"" .
ILIAS_HTTP_PATH .
"/xml/ilias_object_4_0.dtd\">");
403 $ilAccess =
$DIC[
'ilAccess'];
405 include_once
'Services/AccessControl/classes/class.ilAccess.php';
407 $ilAccess->checkAccessOfUser($this->
getUserId(),
'read',
'view', $ref_id, $object->
getType(), $object->
getId());
409 if (!$info = $ilAccess->getInfo()) {
412 return $info[0][
'type'];
421 $tree =
$DIC[
'tree'];
423 $items = $tree->getPathFull($refid);
424 $writer->xmlStartTag(
"Path");
425 foreach ($items as $item) {
426 if ($item[
"ref_id"] == $refid) {
429 if ($item[
"type"] ==
"root") {
430 $item[
"title"] =
$lng->txt(
"repository");
432 $writer->xmlElement(
"Element", array(
"ref_id" => $item[
"ref_id"],
"type" => $item[
"type"]), $item[
"title"]);
434 $writer->xmlEndTag(
"Path");
An exception for terminatinating execution or to throw for unit testing.
static _lookupFileSize($a_id)
Quickly looks up the file size from the database and returns the number of bytes.
static _lookupVersion($a_id)
lookup version
static _lookupSuffix($a_id)
lookup suffix
const TIMINGS_DEACTIVATED
static getItem($a_ref_id)
Get item data.
const TIMING_TEMPORARILY_AVAILABLE
__appendOperations($a_ref_id, $a_type)
const TIMING_VISIBILITY_ON
setHighlighter($a_highlighter)
enableReferences($a_stat)
__getAccessInfo(&$object, $ref_id)
__appendTimeTargets($a_ref_id)
Append time target settings for items inside of courses.
static appendPathToObject($writer, $refid)
enablePermissionCheck($a_status)
const TIMING_VISIBILITY_OFF
enableOperations($a_status)
__appendObjectProperties(ilObject $obj)
Append object properties.
isPermissionCheckEnabled()
Class ilObject Basic functions for all objects.
getType()
get object type @access public
getOwner()
get object owner
getLastUpdateDate()
get last update date @access public
getOfflineStatus()
Get offline status.
getRefId()
get reference id @access public
static _getAllReferences($a_id)
get all reference ids of object
getDescription()
get object description
getId()
get object id @access public
getImportId()
get import id
getCreateDate()
get create date @access public
getTitle()
get object title @access public
static lookupCreateOperationIds($a_type_arr)
Lookup operation ids.
xmlEndTag($tag)
Writes an endtag.
xmlSetGenCmt($genCmt)
Sets generated comment.
xmlDumpMem($format=true)
Returns xml document from memory.
xmlHeader()
Writes xml header @access public.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
redirection script todo: (a better solution should control the processing via a xml file)