Inheritance diagram for ilObject:Public Member Functions | |
| ilObject ($a_id=0, $a_reference=true) | |
| Constructor public. | |
| withReferences () | |
| determines wehter objects are referenced or not (got ref ids or not) | |
| read ($a_force_db=false) | |
| read object data from db into object | |
| getId () | |
| get object id public | |
| setId ($a_id) | |
| set object id public | |
| setRefId ($a_id) | |
| set reference id public | |
| getRefId () | |
| get reference id public | |
| getType () | |
| get object type public | |
| setType ($a_type) | |
| set object type public | |
| getTitle () | |
| get object title public | |
| setTitle ($a_title) | |
| set object title | |
| getDescription () | |
| get object description | |
| setDescription ($a_desc) | |
| set object description | |
| getLongDescription () | |
| get object long description (stored in object_description) | |
| getImportId () | |
| get import id | |
| setImportId ($a_import_id) | |
| set import id | |
| getOwner () | |
| get object owner | |
| getOwnerName () | |
| _lookupOwnerName ($a_owner_id) | |
| lookup owner name for owner id | |
| setOwner ($a_owner) | |
| set object owner | |
| getCreateDate () | |
| get create date public | |
| getLastUpdateDate () | |
| get last update date public | |
| setObjDataRecord ($a_record) | |
| set object_data record (note: this method should only be called from the ilObjectFactory class) | |
| create () | |
| create | |
| update () | |
| update object in db | |
| MDUpdateListener ($a_element) | |
| Meta data update listener. | |
| createMetaData () | |
| create meta data entry | |
| updateMetaData () | |
| update meta data entry | |
| deleteMetaData () | |
| delete meta data entry | |
| updateOwner () | |
| update owner of object in db | |
| _getIdForImportId ($a_import_id) | |
| get current object id for import id (static) | |
| _getAllReferences ($a_id) | |
| get all reference ids of object | |
| _lookupTitle ($a_id) | |
| lookup object title | |
| _lookupDescription ($a_id) | |
| lookup object description | |
| _lookupLastUpdate ($a_id) | |
| lookup last update | |
| _lookupObjId ($a_id) | |
| _writeTitle ($a_obj_id, $a_title) | |
| write title to db (static) | |
| _writeDescription ($a_obj_id, $a_desc) | |
| write description to db (static) | |
| _writeImportId ($a_obj_id, $a_import_id) | |
| write import id to db (static) | |
| _lookupType ($a_id, $a_reference=false) | |
| lookup object type | |
| _isInTrash ($a_ref_id) | |
| checks wether object is in trash | |
| _hasUntrashedReference ($a_obj_id) | |
| checks wether an object has at least one reference that is not in trash | |
| _lookupObjectId ($a_ref_id) | |
| lookup object id | |
| _getObjectsDataForType ($a_type, $a_omit_trash=false) | |
| get all objects of a certain type | |
| putInTree ($a_parent_ref) | |
| maybe this method should be in tree object!? | |
| setPermissions ($a_parent_ref) | |
| set permissions of object | |
| createReference () | |
| creates reference for object | |
| countReferences () | |
| count references of object | |
| ilClone ($a_parent_ref) | |
| ilClone object into tree basic clone function. | |
| delete () | |
| delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! | |
| initDefaultRoles () | |
| init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public | |
| createRoleFolder () | |
| creates a local role folder | |
| notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0) | |
| notifys an object about an event occured Based on the event passed, each object may decide how it reacts. | |
| setRegisterMode ($a_bool) | |
| isUserRegistered ($a_user_id=0) | |
| requireRegistration () | |
| getXMLZip () | |
| getHTMLDirectory () | |
Static Public Member Functions | |
| _exists ($a_id, $a_reference=false) | |
| checks if an object exists in object_data | |
Data Fields | |
| $ilias | |
| $lng | |
| $id | |
| $ref_id | |
| $type | |
| $title | |
| $desc | |
| $long_desc | |
| $owner | |
| $create_date | |
| $last_update | |
| $import_id | |
| $register = false | |
| $referenced | |
| $objectList | |
| $max_title | |
| $max_desc | |
| $add_dots | |
| $obj_data_record | |
| object_data record | |
Definition at line 35 of file class.ilObject.php.
| ilObject::_exists | ( | $ | a_id, | |
| $ | a_reference = false | |||
| ) | [static] |
checks if an object exists in object_data
public
| integer | object id or reference id | |
| boolean | ture if id is a reference, else false (default) |
Definition at line 1303 of file class.ilObject.php.
Referenced by _lookupOwnerName(), ilObjRoleFolderGUI::confirmedDeleteObject(), ilObjRole::delete(), ilForum::fetchPostNodeData(), ilObjForumListGUI::getProperties(), ilForumExport::getUserData(), ilForum::getUserData(), and ilObjSCORMLearningModuleGUI::showTrackingItem().
{
global $ilias;
if ($a_reference)
{
$q = "SELECT * FROM object_data ".
"LEFT JOIN object_reference ON object_reference.obj_id=object_data.obj_id ".
"WHERE object_reference.ref_id='".$a_id."'";
}
else
{
$q = "SELECT * FROM object_data WHERE obj_id='".$a_id."'";
}
$r = $ilias->db->query($q);
return $r->numRows() ? true : false;
}
Here is the caller graph for this function:| ilObject::_getAllReferences | ( | $ | a_id | ) |
get all reference ids of object
| int | $a_id object id |
Definition at line 792 of file class.ilObject.php.
References $q.
Referenced by ilStructureObject::_goto(), ilLMPageObject::_goto(), ilGlossaryTerm::_goto(), _hasUntrashedReference(), and ilSearchResult::filter().
{
global $ilDB;
$q = "SELECT * FROM object_reference WHERE obj_id = '".$a_id."'";
$obj_set = $ilDB->query($q);
$ref = array();
while ($obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$ref[$obj_rec["ref_id"]] = $obj_rec["ref_id"];
}
return $ref;
}
Here is the caller graph for this function:| ilObject::_getIdForImportId | ( | $ | a_import_id | ) |
get current object id for import id (static)
| int | $a_import_id import id |
Definition at line 769 of file class.ilObject.php.
References $q.
| ilObject::_getObjectsDataForType | ( | $ | a_type, | |
| $ | a_omit_trash = false | |||
| ) |
get all objects of a certain type
| string | $a_type desired object type | |
| boolean | $a_omit_trash omit objects, that are in trash only (default: false) |
Definition at line 1034 of file class.ilObject.php.
References $q, and _hasUntrashedReference().
Referenced by ilObjSysUserTrackingGUI::trackingDataQueryFormObject().
{
global $ilDB;
$q = "SELECT * FROM object_data WHERE type = ".$ilDB->quote($a_type);
$obj_set = $ilDB->query($q);
$objects = array();
while ($obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC))
{
if ((!$a_omit_trash) || ilObject::_hasUntrashedReference($obj_rec["obj_id"]))
{
$objects[$obj_rec["title"].".".$obj_rec["obj_id"]] = array("id" => $obj_rec["obj_id"],
"type" => $obj_rec["type"], "title" => $obj_rec["title"],
"description" => $obj_rec["description"]);
}
}
ksort($objects);
return $objects;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::_hasUntrashedReference | ( | $ | a_obj_id | ) |
checks wether an object has at least one reference that is not in trash
Definition at line 994 of file class.ilObject.php.
References $ref_id, _getAllReferences(), and _isInTrash().
Referenced by ilObjSurvey::_getAvailableSurveys(), ilObjTest::_getAvailableTests(), ilLMObject::_getIdForImportId(), ilGlossaryTerm::_getIdForImportId(), _getObjectsDataForType(), ilObjSurveyQuestionPool::_isWriteable(), ilObjQuestionPool::_isWriteable(), ilObjTest::get_qpl_titles(), ilObjTest::getAvailableQuestionpoolIDs(), ilObjSurvey::getAvailableQuestionpools(), ilObjTest::getAvailableQuestionpools(), ilObjSurvey::getForbiddenQuestionpools(), and ilObjSurvey::getQuestionpoolTitles().
{
$ref_ids = ilObject::_getAllReferences($a_obj_id);
foreach($ref_ids as $ref_id)
{
if(!ilObject::_isInTrash($ref_id))
{
return true;
}
}
return false;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::_isInTrash | ( | $ | a_ref_id | ) |
checks wether object is in trash
Definition at line 984 of file class.ilObject.php.
References $tree.
Referenced by _hasUntrashedReference().
{
global $tree;
return $tree->isSaved($a_ref_id);
}
Here is the caller graph for this function:| ilObject::_lookupDescription | ( | $ | a_id | ) |
lookup object description
| int | $a_id object id |
Definition at line 829 of file class.ilObject.php.
References $q.
Referenced by ilSearchResult::getResultsForPresentation(), ilSearchresultGUI::showResults(), ilObjStyleSheetFolderGUI::viewObject(), and ilObjStyleSettingsGUI::viewObject().
{
global $ilDB;
$q = "SELECT description FROM object_data WHERE obj_id = '".$a_id."'";
$obj_set = $ilDB->query($q);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec["description"];
}
Here is the caller graph for this function:| ilObject::_lookupLastUpdate | ( | $ | a_id | ) |
lookup last update
| int | $a_id object id |
Definition at line 845 of file class.ilObject.php.
References $q.
Referenced by ilObjFileListGUI::getProperties().
{
global $ilDB;
$q = "SELECT last_update FROM object_data WHERE obj_id = '".$a_id."'";
$obj_set = $ilDB->query($q);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec["last_update"];
}
Here is the caller graph for this function:| ilObject::_lookupObjectId | ( | $ | a_ref_id | ) |
lookup object id
| int | $a_id object id |
Definition at line 1013 of file class.ilObject.php.
References $q.
Referenced by ilObjContentObjectGUI::addMenuEntry(), and ilRepositoryExplorer::isClickable().
{
global $ilDB;
$q = "SELECT obj_id FROM object_reference WHERE ref_id = '".$a_ref_id."'";
$obj_set = $ilDB->query($q);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec["obj_id"];
}
Here is the caller graph for this function:| ilObject::_lookupObjId | ( | $ | a_id | ) |
Definition at line 856 of file class.ilObject.php.
References $query, $res, and $row.
Referenced by ilObjCategoryGUI::__buildFilterSelect(), ilSearch::__checkAccess(), ilObjContentObjectAccess::_getLastAccessedPage(), ilTableOfContentsExplorer::buildTitle(), ilAccessHandler::checkAccessOfUser(), ilUserResult::createLink(), ilLMPresentationGUI::getLinkXML(), ilLMPageObjectGUI::getLinkXML(), ilObjectListGUI::insertPath(), ilObjCategoryGUI::listUsersObject(), ilAdvancedSearchGUI::saveResult(), ilSearchGUI::saveResult(), ilSearchresultGUI::showResults(), and ilSearchGUI::showSearch().
{
global $ilDB;
$query = "SELECT obj_id FROM object_reference ".
"WHERE ref_id = '".$a_id."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->obj_id;
}
return 0;
}
Here is the caller graph for this function:| ilObject::_lookupOwnerName | ( | $ | a_owner_id | ) |
lookup owner name for owner id
Definition at line 455 of file class.ilObject.php.
References $lng, $owner, and _exists().
Referenced by getOwnerName().
{
global $lng;
if ($a_owner_id != -1)
{
if (ilObject::_exists($a_owner_id))
{
$owner = new ilObjUser($a_owner_id);
}
}
if (is_object($owner))
{
$own_name = $owner->getFullname();
}
else
{
$own_name = $lng->txt("unknown");
}
return $own_name;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::_lookupTitle | ( | $ | a_id | ) |
lookup object title
| int | $a_id object id |
Definition at line 813 of file class.ilObject.php.
References $q.
Referenced by ilObjCategoryGUI::__buildFilterSelect(), ilObjContentObjectGUI::addMenuEntry(), ilObjStyleSheetFolder::addStyle(), ilObjStyleSettings::addStyle(), ilObjMediaPoolGUI::confirmRemove(), ilPageEditorGUI::copyLinkedMediaToClipboard(), ilObjMediaPool::deleteChild(), ilObjStyleSheetGUI::deleteObject(), ilObjStyleSheetFolderGUI::deleteStyleObject(), ilObjStyleSettingsGUI::deleteStyleObject(), ilAccessHandler::doConditionCheck(), ilPageEditorGUI::executeCommand(), ilObjSysUserTracking::getAccessPerUserDetail(), ilObjSysUserTracking::getAccessTotalPerObj(), ilObjUser::getClipboardObjects(), ilSearchResult::getResultsForPresentation(), ilObjMediaPoolGUI::insertFromClipboard(), ilObjectListGUI::insertPath(), ilObjectListGUI::insertPreconditions(), ilGlossaryPresentationGUI::listDefinitions(), ilGlossaryPresentationGUI::listTermByGiven(), ilObjCategoryGUI::listUsersObject(), ilObjCourseGUI::membersObject(), ilObjSysUserTrackingGUI::outputTrackingDataObject(), ilObjContentObjectGUI::properties(), saveForm(), ilAdvancedSearchGUI::saveResult(), ilSearchGUI::saveResult(), ilPageObjectGUI::showMediaFullscreen(), ilPageObjectGUI::showPage(), ilLMPresentationGUI::showPreconditionsOfPage(), ilSearchresultGUI::showResults(), ilSearchGUI::showSearch(), and ilObjMediaObjectGUI::showUsagesObject().
{
global $ilDB;
$q = "SELECT title FROM object_data WHERE obj_id = '".$a_id."'";
$obj_set = $ilDB->query($q);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec["title"];
}
Here is the caller graph for this function:| ilObject::_lookupType | ( | $ | a_id, | |
| $ | a_reference = false | |||
| ) |
lookup object type
| int | $a_id object id |
Definition at line 956 of file class.ilObject.php.
References $q.
Referenced by ilSoapUserAdministration::__validateUserData(), ilHistory::_createEntry(), ilConditionHandler::_getConditionsOfTarget(), ilHistory::_getEntriesForObject(), ilObjContentObjectGUI::addMenuEntry(), ilContainerGUI::addToDeskObject(), ilObjRoleGUI::assignDesktopItemObject(), ilAccessHandler::checkAccessOfUser(), ilObjMediaPoolGUI::confirmRemove(), ilObjMediaPoolGUI::copyToClipboard(), ilObjMediaPool::deleteChild(), ilRepositoryGUI::executeCommand(), ilSearchResult::filter(), ilLMPresentationGUI::getLinkXML(), ilLMPageObjectGUI::getLinkXML(), ilObjectListGUI::getListItemHTML(), ilHistoryGUI::ilHistoryGUI(), ilInternalLinkGUI::ilInternalLinkGUI(), ilRepositoryGUI::ilRepositoryGUI(), ilContainerGUI::removeFromDeskObject(), ilAdvancedSearchGUI::saveResult(), ilSearchGUI::saveResult(), ilRepositoryGUI::setHeader(), and ilPCParagraph::xml2output().
{
global $ilDB;
if ($a_reference === true)
{
$q = "SELECT type FROM object_reference as obr, object_data as obd ".
"WHERE obr.ref_id = '".$a_id."' ".
"AND obr.obj_id = obd.obj_id ";
#$q = "SELECT type FROM object_data as obj ".
# "LEFT JOIN object_reference as ref ON ref.obj_id=obj.obj_id ".
# "WHERE ref.ref_id = '".$a_id."'";
}
else
{
$q = "SELECT type FROM object_data WHERE obj_id = '".$a_id."'";
}
$obj_set = $ilDB->query($q);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return $obj_rec["type"];
}
Here is the caller graph for this function:| ilObject::_writeDescription | ( | $ | a_obj_id, | |
| $ | a_desc | |||
| ) |
write description to db (static)
| int | $a_obj_id object id | |
| string | $a_desc description public |
Definition at line 897 of file class.ilObject.php.
References $desc, $objDefinition, $q, $query, $res, ilUtil::prepareDBString(), and ilUtil::shortenText().
Referenced by ilObjMediaObject::MDUpdateListener(), and MDUpdateListener().
{
global $ilDB,$objDefinition;
$desc = ilUtil::shortenText($a_desc,MAXLENGTH_OBJ_DESC,true);
$q = "UPDATE object_data ".
"SET ".
"description = ".$ilDB->quote($desc).",".
"last_update = now() ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id);
$ilDB->query($q);
if($objDefinition->isRBACObject($this->getType()))
{
// Update long description
$res = $ilDB->query("SELECT * FROM object_description WHERE obj_id = '".$a_obj_id."'");
if($res->numRows())
{
$query = "UPDATE object_description SET description = '".
ilUtil::prepareDBString($a_desc)."' ".
"WHERE obj_id = '".$this->getId()."'";
}
else
{
$query = "INSERT INTO object_description SET obj_id = '".$this->getId()."', ".
"description = '".ilUtil::prepareDBString($a_desc)."'";
}
$ilDB->query($query);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::_writeImportId | ( | $ | a_obj_id, | |
| $ | a_import_id | |||
| ) |
write import id to db (static)
| int | $a_obj_id object id | |
| string | $a_import_id import id public |
Definition at line 938 of file class.ilObject.php.
References $q.
Referenced by ilObjGlossaryGUI::importFileObject(), and ilObjContentObjectGUI::importFileObject().
{
global $ilDB;
$q = "UPDATE object_data ".
"SET ".
"import_id = ".$ilDB->quote($a_import_id).",".
"last_update = now() ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id);
$ilDB->query($q);
}
Here is the caller graph for this function:| ilObject::_writeTitle | ( | $ | a_obj_id, | |
| $ | a_title | |||
| ) |
write title to db (static)
| int | $a_obj_id object id | |
| string | $a_title title public |
Definition at line 877 of file class.ilObject.php.
References $q.
Referenced by ilObjMediaObject::MDUpdateListener(), and MDUpdateListener().
{
global $ilDB;
$q = "UPDATE object_data ".
"SET ".
"title = ".$ilDB->quote($a_title).",".
"last_update = now() ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id);
$ilDB->query($q);
}
Here is the caller graph for this function:| ilObject::countReferences | ( | ) |
count references of object
public
Definition at line 1125 of file class.ilObject.php.
Referenced by delete().
{
if (!isset($this->id))
{
$message = "ilObject::countReferences(): No obj_id given!";
$this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
}
$q = "SELECT COUNT(ref_id) AS num FROM object_reference ".
"WHERE obj_id = '".$this->id."'";
$row = $this->ilias->db->getRow($q);
return $row->num;
}
Here is the caller graph for this function:| ilObject::create | ( | ) |
create
note: title, description and type should be set when this function is called
public
Reimplemented in ilObjFile, ilObjMediaObject, ilObjNoteFolder, ilObjRole, ilObjStyleSheet, ilObjFileBasedLM, ilObjMediaPool, ilObjSAHSLearningModule, and ilObjLinkResource.
Definition at line 531 of file class.ilObject.php.
References $ilUser, $log, $objDefinition, $q, $query, getDescription(), getImportId(), getLongDescription(), getTitle(), ilUtil::prepareDBString(), setOwner(), and ilUtil::shortenText().
Referenced by ilObjSurveyQuestionPool::create(), ilObjSurvey::create(), ilObjCourse::create(), ilObjGlossary::create(), ilObjContentObject::create(), ilObjTest::create(), ilObjQuestionPool::create(), and ilObjNote::createObject().
{
global $ilDB, $log,$ilUser,$objDefinition;
if (!isset($this->type))
{
$message = get_class($this)."::create(): No object type given!";
$this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
}
// write log entry
$log->write("ilObject::create(), start");
$this->title = ilUtil::shortenText($this->getTitle(), $this->max_title, $this->add_dots);
$this->desc = ilUtil::shortenText($this->getDescription(), $this->max_desc, $this->add_dots);
$q = "INSERT INTO object_data ".
"(type,title,description,owner,create_date,last_update,import_id) ".
"VALUES ".
"('".$this->type."',".$ilDB->quote($this->getTitle()).",'".ilUtil::prepareDBString($this->getDescription())."',".
"'".$ilUser->getId()."',now(),now(),'".
$this->getImportId()."')";
$ilDB->query($q);
$this->id = $ilDB->getLastInsertId();
// Save long form of description if is rbac object
if($objDefinition->isRBACObject($this->getType()))
{
$query = "INSERT INTO object_description SET ".
"obj_id = '".$this->id."', ".
"description = '".ilUtil::prepareDBString($this->getLongDescription())."'";
$ilDB->query($query);
}
// the line ($this->read();) messes up meta data handling: meta data,
// that is not saved at this time, gets lost, so we query for the dates alone
//$this->read();
$q = "SELECT last_update, create_date FROM object_data".
" WHERE obj_id = '".$this->id."'";
$obj_set = $this->ilias->db->query($q);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
$this->last_update = $obj_rec["last_update"];
$this->create_date = $obj_rec["create_date"];
// set owner for new objects
$this->setOwner($ilUser->getId());
// write log entry
$log->write("ilObject::create(), finished, obj_id: ".$this->id.", type: ".
$this->type.", title: ".$this->getTitle());
return $this->id;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::createMetaData | ( | ) |
create meta data entry
Reimplemented in ilObjMediaObject.
Definition at line 684 of file class.ilObject.php.
References $ilUser, getId(), getLongDescription(), getTitle(), and getType().
Referenced by ilObjSurveyQuestionPool::create(), ilObjSurvey::create(), ilObjLinkResource::create(), ilObjCourse::create(), ilObjSAHSLearningModule::create(), ilObjGlossary::create(), ilObjFileBasedLM::create(), ilObjContentObject::create(), ilObjTest::create(), and ilObjQuestionPool::create().
{
include_once 'Services/MetaData/classes/class.ilMDCreator.php';
global $ilUser;
$md_creator = new ilMDCreator($this->getId(),0,$this->getType());
$md_creator->setTitle($this->getTitle());
$md_creator->setTitleLanguage($ilUser->getPref('language'));
$md_creator->setDescription($this->getLongDescription());
$md_creator->setDescriptionLanguage($ilUser->getPref('language'));
$md_creator->setKeywordLanguage($ilUser->getPref('language'));
$md_creator->setLanguage($ilUser->getPref('language'));
$md_creator->create();
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::createReference | ( | ) |
creates reference for object
public
Reimplemented in ilObjTest, ilObjMediaObject, ilObjStyleSheet, ilObjMediaObject, and ilObjSurvey.
Definition at line 1098 of file class.ilObject.php.
References $q.
{
global $ilDB;
if (!isset($this->id))
{
$message = "ilObject::createNewReference(): No obj_id given!";
$this->raiseError($message,$this->ilias->error_obj->WARNING);
}
$q = "INSERT INTO object_reference ".
"(obj_id) VALUES ('".$this->id."')";
$this->ilias->db->query($q);
$this->ref_id = $ilDB->getLastInsertId();
$this->referenced = true;
return $this->ref_id;
}
| ilObject::createRoleFolder | ( | ) |
creates a local role folder
public
| string | rolefolder title | |
| string | rolefolder description | |
| object | parent object where the rolefolder is attached to |
Definition at line 1269 of file class.ilObject.php.
References $rbacreview, getId(), and getRefId().
Referenced by ilObjCourse::__initDefaultRoles(), ilObjiLincCourse::initDefaultRoles(), ilObjContentObject::initDefaultRoles(), ilObjGroup::initDefaultRoles(), ilObjForum::initDefaultRoles(), and ilObjChat::initDefaultRoles().
{
global $rbacreview;
// does a role folder already exists?
// (this check is only 'to be sure' that no second role folder is created under one object.
// the if-construct should never return true)
if ($rolf_data = $rbacreview->getRoleFolderofObject($this->getRefId()))
{
$rfoldObj = $this->ilias->obj_factory->getInstanceByRefId($rolf_data["ref_id"]);
}
else
{
include_once ("classes/class.ilObjRoleFolder.php");
$rfoldObj = new ilObjRoleFolder();
$rfoldObj->setTitle($this->getId());
$rfoldObj->setDescription(" (ref_id ".$this->getRefId().")");
$rfoldObj->create();
$rfoldObj->createReference();
$rfoldObj->putInTree($this->getRefId());
$rfoldObj->setPermissions($this->getRefId());
}
return $rfoldObj;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::delete | ( | ) |
delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!!
public
Reimplemented in ilObjQuestionPool, ilObjTest, ilObjChat, ilObjAssessmentFolder, ilObjAuthSettings, ilObjCategory, ilObjExercise, ilObjExternalToolsSettings, ilObjFile, ilObjForum, ilObjGroup, ilObjLibFolder, ilObjObjectFolder, ilObjRecoveryFolder, ilObjRole, ilObjRoleFolder, ilObjRoleTemplate, ilObjRootFolder, ilObjStyleSettings, ilObjStyleSheet, ilObjStyleSheetFolder, ilObjSystemFolder, ilObjSysUserTracking, ilObjUser, ilObjUserFolder, ilObj< module_name >, ilObjAICCLearningModule, ilObjContentObject, ilObjFileBasedLM, ilObjGlossary, ilObjMediaPool, ilObjSAHSLearningModule, ilObjMediaObject, ilObjCourse, ilObjiLincClassroom, ilObjiLincCourse, ilObjLinkResource, ilObjSurvey, and ilObjSurveyQuestionPool.
Definition at line 1185 of file class.ilObject.php.
References $log, $q, $query, $rbacadmin, countReferences(), getId(), getRefId(), getTitle(), and getType().
{
global $rbacadmin, $log;
$remove = false;
// delete object_data entry
if ((!$this->referenced) || ($this->countReferences() == 1))
{
// delete entry in object_data
$q = "DELETE FROM object_data ".
"WHERE obj_id = '".$this->getId()."'";
$this->ilias->db->query($q);
// delete long description
$query = "DELETE FROM object_description WHERE obj_id = '".$this->getId()."'";
$this->ilias->db->query($query);
// write log entry
$log->write("ilObject::delete(), deleted object, obj_id: ".$this->getId().", type: ".
$this->getType().", title: ".$this->getTitle());
$remove = true;
}
else
{
// write log entry
$log->write("ilObject::delete(), object not deleted, number of references: ".
$this->countReferences().", obj_id: ".$this->getId().", type: ".
$this->getType().", title: ".$this->getTitle());
}
// delete object_reference entry
if ($this->referenced)
{
// delete entry in object_reference
$q = "DELETE FROM object_reference ".
"WHERE ref_id = '".$this->getRefId()."'";
$this->ilias->db->query($q);
// write log entry
$log->write("ilObject::delete(), reference deleted, ref_id: ".$this->getRefId().
", obj_id: ".$this->getId().", type: ".
$this->getType().", title: ".$this->getTitle());
// DELETE PERMISSION ENTRIES IN RBAC_PA
// DONE: method overwritten in ilObjRole & ilObjUser.
// this call only applies for objects in rbac (not usr,role,rolt)
// TODO: Do this for role templates too
$rbacadmin->revokePermission($this->getRefId());
}
// remove conditions
if ($this->referenced)
{
$ch =& new ilConditionHandler();
$ch->delete($this->getRefId());
unset($ch);
}
return $remove;
}
Here is the call graph for this function:| ilObject::deleteMetaData | ( | ) |
delete meta data entry
Reimplemented in ilObjMediaObject.
Definition at line 730 of file class.ilObject.php.
References getId(), and getType().
Referenced by ilObjSurveyQuestionPool::delete(), ilObjSurvey::delete(), ilObjLinkResource::delete(), ilObjCourse::delete(), ilObjSAHSLearningModule::delete(), ilObjGlossary::delete(), ilObjFileBasedLM::delete(), ilObjContentObject::delete(), ilObjAICCLearningModule::delete(), ilObjTest::delete(), and ilObjQuestionPool::delete().
{
// Delete meta data
include_once('Services/MetaData/classes/class.ilMD.php');
$md = new ilMD($this->getId(), 0, $this->getType());
$md->deleteAll();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::getCreateDate | ( | ) |
get create date public
Definition at line 495 of file class.ilObject.php.
{
return $this->create_date;
}
| ilObject::getDescription | ( | ) |
get object description
public
Reimplemented in ilObjQuestionPool, ilObjContentObject, ilObjGlossary, ilObjMediaObject, and ilObjCourse.
Definition at line 376 of file class.ilObject.php.
Referenced by ilObjExercise::__formatSubject(), create(), ilClone(), ilObjSurvey::to_xml(), ilObjTest::to_xml(), ilObjiLincClassroom::update(), ilObjForum::update(), and update().
{
return $this->desc;
}
Here is the caller graph for this function:| ilObject::getHTMLDirectory | ( | ) |
| ilObject::getId | ( | ) |
get object id public
Reimplemented in ilObjMediaObject.
Definition at line 288 of file class.ilObject.php.
Referenced by ilObjCourse::__initDefaultRoles(), ilObjUser::addDesktopItem(), ilObjUser::addObjectToClipboard(), ilObjContentObject::checkTree(), ilObjMediaPool::create(), ilObjGlossary::create(), ilObjFile::create(), ilObjSurveyQuestionPool::createExportDirectory(), ilObjSurvey::createExportDirectory(), ilObjGlossary::createExportDirectory(), ilObjContentObject::createExportDirectory(), ilObjTest::createExportDirectory(), ilObjQuestionPool::createExportDirectory(), ilObjSurveyQuestionPool::createImportDirectory(), ilObjSurvey::createImportDirectory(), ilObjGlossary::createImportDirectory(), ilObjContentObject::createImportDirectory(), ilObjContentObject::createLMTree(), createMetaData(), ilObjNote::createObject(), createRoleFolder(), ilObjLinkResource::delete(), ilObjCourse::delete(), ilObjSAHSLearningModule::delete(), ilObjFileBasedLM::delete(), ilObjContentObject::delete(), ilObjAICCLearningModule::delete(), ilObjUser::delete(), ilObjStyleSheet::delete(), ilObjRoleTemplate::delete(), ilObjRole::delete(), ilObjForum::delete(), ilObjFile::delete(), delete(), ilObjSurveyQuestionPool::deleteAllData(), ilObjGroup::deleteApplicationListEntry(), deleteMetaData(), ilObjQuestionPool::deleteQuestionpool(), ilObjSurvey::deleteSurveyRecord(), ilObjTest::deleteTest(), ilObjFile::export(), ilObjGlossary::exportHTML(), ilObjContentObject::exportHTML(), ilObjContentObject::exportHTMLPages(), ilObjContentObject::exportSCORM(), ilObjGlossary::exportXMLMetaData(), ilObjContentObject::exportXMLMetaData(), ilObjTest::exportXMLMetaData(), ilObjQuestionPool::exportXMLMetaData(), ilObjContentObject::exportXMLPageObjects(), ilObjUser::getAppliedUsers(), ilObjForum::getCountUnread(), ilObjSAHSLearningModule::getDataDirectory(), ilObjFileBasedLM::getDataDirectory(), ilObjFile::getDirectory(), ilObjUser::getGroupMemberships(), ilObjTest::getImagePath(), ilObjTest::getImagePathWeb(), ilObjSurveyQuestionPool::getQuestionsTable(), ilObjQuestionPool::getQuestionsTable(), ilObjGlossary::getTermList(), ilObjSCORMLearningModule::getTrackingItems(), ilObjAICCLearningModule::getTrackingItems(), ilObjForum::ilClone(), ilObjFile::ilClone(), ilObjExercise::ilClone(), ilClone(), ilObjSurveyQuestionPool::importObject(), ilObjQuestionPool::importObject(), ilObjiLincCourse::initDefaultRoles(), ilObjContentObject::initDefaultRoles(), ilObjGroup::initDefaultRoles(), ilObjForum::initDefaultRoles(), ilObjChat::initDefaultRoles(), ilObjLinkResource::initLinkResourceItemsObject(), ilObjCourse::initWaitingList(), ilObjUser::isChild(), ilObjUser::isDesktopItem(), MDUpdateListener(), ilObjGlossary::modifyExportIdentifier(), ilObjSurveyQuestionPool::paste(), ilObjFolder::putInTree(), putInTree(), ilObjMediaPool::read(), ilObjContentObject::read(), ilObjStyleSheetFolder::read(), ilObjStyleSettings::read(), ilObjRoleFolder::read(), ilObjExercise::read(), ilObjAICCLearningModule::readObject(), ilObjFile::replaceFile(), ilObjiLincCourse::saveActivationStatus(), ilObjGroup::setExpirationDateTime(), ilObjGroup::setPassword(), ilObjGroup::setRegistrationFlag(), ilObjSurveyQuestionPool::to_xml(), ilObjiLincCourse::update(), ilObjSAHSLearningModule::update(), ilObjStyleSheetFolder::update(), ilObjStyleSettings::update(), ilObjForum::update(), update(), updateMetaData(), ilObjTest::updateMetaData(), ilObjUser::writeAccepted(), and ilObjStyleSheet::writeCSSFile().
{
return $this->id;
}
Here is the caller graph for this function:| ilObject::getImportId | ( | ) |
get import id
public
Reimplemented in ilObjContentObject, and ilObjMediaObject.
Definition at line 414 of file class.ilObject.php.
Referenced by create().
{
return $this->import_id;
}
Here is the caller graph for this function:| ilObject::getLastUpdateDate | ( | ) |
get last update date public
Definition at line 505 of file class.ilObject.php.
{
return $this->last_update;
}
| ilObject::getLongDescription | ( | ) |
get object long description (stored in object_description)
public
Definition at line 403 of file class.ilObject.php.
Referenced by create(), createMetaData(), update(), and updateMetaData().
{
return strlen($this->long_desc) ? $this->long_desc : $this->desc;
}
Here is the caller graph for this function:| ilObject::getOwner | ( | ) |
get object owner
public
Definition at line 436 of file class.ilObject.php.
Referenced by getOwnerName().
{
return $this->owner;
}
Here is the caller graph for this function:| ilObject::getOwnerName | ( | ) |
Definition at line 447 of file class.ilObject.php.
References _lookupOwnerName(), and getOwner().
Referenced by ilObjSysUserTracking::getAccessTotalPerObj().
{
return ilObject::_lookupOwnerName($this->getOwner());
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::getRefId | ( | ) |
get reference id public
Reimplemented in ilObjMediaObject, ilObjStyleSheet, and ilObjMediaObject.
Definition at line 319 of file class.ilObject.php.
Referenced by ilObjChat::__formatBody(), ilObjCourse::__getLocalRoles(), ilObjCourse::__initDefaultRoles(), ilObjRoleFolder::createRole(), createRoleFolder(), ilObjRoleFolder::delete(), delete(), ilObjSurvey::disinviteUser(), ilObjiLincCourse::getAdminIds(), ilObjGroup::getDefaultGroupRoles(), ilObjiLincCourse::getDefaultRoles(), ilObjGroup::getGroupAdminIds(), ilObjGroup::getGroupStatus(), ilObjGroup::getLocalGroupRoles(), ilObjiLincCourse::getLocalRoles(), ilObjSCORMLearningModule::getTrackedItems(), ilObjAICCLearningModule::getTrackedItems(), ilObjAICCLearningModule::getTrackingData(), ilObjSCORMLearningModule::getTrackingDataAgg(), ilObjSCORMLearningModule::getTrackingDataPerUser(), ilClone(), ilObjChat::ilObjChat(), ilObjChatServer::ilObjChatServer(), ilObjiLincCourse::initDefaultRoles(), ilObjGroup::initDefaultRoles(), ilObjForum::initDefaultRoles(), ilObjChat::initDefaultRoles(), ilObjSurvey::inviteGroup(), ilObjSurvey::inviteRole(), ilObjSurvey::inviteUser(), ilObjGroup::leaveGroup(), ilObjRoleFolder::purge(), ilObjFolder::putInTree(), putInTree(), ilObjExercise::read(), ilObjChatServer::read(), ilObjChat::read(), ilObjGroup::removeMember(), ilObjGroup::setGroupStatus(), ilObjSurvey::setInvitation(), and setPermissions().
{
return $this->ref_id;
}
Here is the caller graph for this function:| ilObject::getTitle | ( | ) |
get object title public
Reimplemented in ilObjQuestionPool, ilObjMediaObject, ilObjContentObject, ilObjGlossary, ilObjMediaObject, ilObjCourse, and ilObjSurveyQuestionPool.
Definition at line 349 of file class.ilObject.php.
Referenced by ilObjExercise::__formatSubject(), create(), createMetaData(), delete(), ilObjRoleTemplate::getFilterOfInternalTemplate(), ilObjChat::getHTMLDirectory(), ilClone(), ilObjSurvey::isComplete(), ilObjTest::isComplete(), ilObjRoleTemplate::isInternalTemplate(), putInTree(), ilObjSurvey::startSurvey(), ilObjSurvey::to_xml(), ilObjTest::to_xml(), ilObjiLincClassroom::update(), ilObjForum::update(), update(), updateMetaData(), and ilObjTest::updateMetaData().
{
return $this->title;
}
Here is the caller graph for this function:| ilObject::getType | ( | ) |
get object type public
Definition at line 329 of file class.ilObject.php.
Referenced by ilObjMediaObject::create(), ilObjMediaObject::createMetaData(), createMetaData(), delete(), ilObjMediaObject::deleteMetaData(), deleteMetaData(), ilObjGlossary::exportHTML(), ilObjContentObject::exportHTML(), ilObjContentObject::exportHTMLPages(), ilObjContentObject::exportSCORM(), ilObjContentObject::exportXML(), ilObjGlossary::exportXMLMetaData(), ilObjContentObject::exportXMLMetaData(), ilObjTest::exportXMLMetaData(), ilObjQuestionPool::exportXMLMetaData(), ilObjMediaObject::getXML(), ilClone(), ilObjGroup::isMember(), ilObjMediaObject::MDUpdateListener(), MDUpdateListener(), ilObjSurveyQuestionPool::notify(), ilObjSurvey::notify(), ilObjCourse::notify(), ilObjSAHSLearningModule::notify(), ilObjMediaPool::notify(), ilObjGlossary::notify(), ilObjFileBasedLM::notify(), ilObjContentObject::notify(), ilObj< module_name >::notify(), ilObjSysUserTracking::notify(), ilObjStyleSheetFolder::notify(), ilObjStyleSettings::notify(), ilObjRecoveryFolder::notify(), ilObjForum::notify(), ilObjExternalToolsSettings::notify(), ilObjAuthSettings::notify(), ilObjAssessmentFolder::notify(), ilObjTest::notify(), ilObjQuestionPool::notify(), putInTree(), setPermissions(), ilObjMediaObject::update(), ilObjMediaObject::updateMetaData(), updateMetaData(), and ilObjTest::updateMetaData().
{
return $this->type;
}
Here is the caller graph for this function:| ilObject::getXMLZip | ( | ) |
Reimplemented in ilObjFile, ilObjContentObject, ilObjDlBook, and ilObjGlossary.
Definition at line 1369 of file class.ilObject.php.
{
return false;
}
| ilObject::ilClone | ( | $ | a_parent_ref | ) |
ilClone object into tree basic clone function.
Register new object in object_data, creates reference and insert reference ID in tree. All object specific data must be copied in the ilClone function of the appropriate object class. Look in ilObjForum::ilClone() for example code
public
| integer | $a_parent_ref ref id of parent object |
Reimplemented in ilObjQuestionPool, ilObjTest, ilObjChat, ilObjAssessmentFolder, ilObjAuthSettings, ilObjCategory, ilObjExercise, ilObjExternalToolsSettings, ilObjFile, ilObjGroup, ilObjObjectFolder, ilObjRecoveryFolder, ilObjRole, ilObjRoleFolder, ilObjRoleTemplate, ilObjRootFolder, ilObjStyleSettings, ilObjStyleSheetFolder, ilObjSystemFolder, ilObjSysUserTracking, ilObjUserFolder, ilObj< module_name >, ilObjContentObject, ilObjFileBasedLM, ilObjGlossary, ilObjMediaPool, ilObjSAHSLearningModule, ilObjCourse, ilObjiLincCourse, ilObjLinkResource, ilObjSurvey, and ilObjSurveyQuestionPool.
Definition at line 1151 of file class.ilObject.php.
References $log, getDescription(), getId(), getRefId(), getTitle(), getType(), and ilObject().
{
global $log;
$new_obj = new ilObject();
$new_obj->setTitle($this->getTitle());
$new_obj->setType($this->getType());
$new_obj->setDescription($this->getDescription());
$new_obj->create();
$new_ref_id = $new_obj->createReference();
$new_obj->putInTree($a_parent_ref);
$new_obj->setPermissions($a_parent_ref);
unset($new_obj);
// write log entry
$log->write("ilObject::ilClone(), ref_id: ".$this->getRefId().",obj_id: ".$this->getId().", type: ".
$this->getType().", title: ".$this->getTitle().
", new ref_id: ".$new_obj->getRefId().", new obj_id:".$new_obj->getId());
// ... and finally always return new reference ID!!
return $new_ref_id;
}
Here is the call graph for this function:| ilObject::ilObject | ( | $ | a_id = 0, |
|
| $ | a_reference = true | |||
| ) |
Constructor public.
| integer | reference_id or object_id | |
| boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 111 of file class.ilObject.php.
References $ilBench, $ilias, $lng, and read().
Referenced by ilClone(), ilObjAICCLearningModule::ilObjAICCLearningModule(), ilObjAssessmentFolder::ilObjAssessmentFolder(), ilObjAuthSettings::ilObjAuthSettings(), ilObjCategory::ilObjCategory(), ilObjChat::ilObjChat(), ilObjChatServer::ilObjChatServer(), ilObjContentObject::ilObjContentObject(), ilObjCourse::ilObjCourse(), ilObjExercise::ilObjExercise(), ilObjExternalToolsSettings::ilObjExternalToolsSettings(), ilObjFile::ilObjFile(), ilObjFileBasedLM::ilObjFileBasedLM(), ilObjFolder::ilObjFolder(), ilObjForum::ilObjForum(), ilObjGlossary::ilObjGlossary(), ilObjGroup::ilObjGroup(), ilObjHACPLearningModule::ilObjHACPLearningModule(), ilObjiLincCourse::ilObjiLincCourse(), ilObjLanguage::ilObjLanguage(), ilObjLanguageFolder::ilObjLanguageFolder(), ilObjLibFolder::ilObjLibFolder(), ilObjLinkResource::ilObjLinkResource(), ilObjMail::ilObjMail(), ilObjMediaObject::ilObjMediaObject(), ilObjMediaPool::ilObjMediaPool(), ilObjNote::ilObjNote(), ilObjNoteFolder::ilObjNoteFolder(), ilObjObjectFolder::ilObjObjectFolder(), ilObjPaymentSettings::ilObjPaymentSettings(), ilObjQuestionPool::ilObjQuestionPool(), ilObjRecoveryFolder::ilObjRecoveryFolder(), ilObjRole::ilObjRole(), ilObjRoleFolder::ilObjRoleFolder(), ilObjRoleTemplate::ilObjRoleTemplate(), ilObjRootFolder::ilObjRootFolder(), ilObjSAHSLearningModule::ilObjSAHSLearningModule(), ilObjSCORMLearningModule::ilObjSCORMLearningModule(), ilObjSearchSettings::ilObjSearchSettings(), ilObjStyleSettings::ilObjStyleSettings(), ilObjStyleSheet::ilObjStyleSheet(), ilObjStyleSheetFolder::ilObjStyleSheetFolder(), ilObjSurvey::ilObjSurvey(), ilObjSurveyQuestionPool::ilObjSurveyQuestionPool(), ilObjSystemFolder::ilObjSystemFolder(), ilObjSysUserTracking::ilObjSysUserTracking(), ilObjTest::ilObjTest(), ilObjTypeDefinition::ilObjTypeDefinition(), ilObjUser::ilObjUser(), and ilObjUserFolder::ilObjUserFolder().
{
global $ilias, $lng, $ilBench;
$ilBench->start("Core", "ilObject_Constructor");
if (DEBUG)
{
echo "<br/><font color=\"red\">type(".$this->type.") id(".$a_id.") referenced(".$a_reference.")</font>";
}
$this->ilias =& $ilias;
$this->lng =& $lng;
$this->max_title = MAXLENGTH_OBJ_TITLE;
$this->max_desc = MAXLENGTH_OBJ_DESC;
$this->add_dots = true;
$this->referenced = $a_reference;
$this->call_by_reference = $a_reference;
if ($a_id == 0)
{
$this->referenced = false; // newly created objects are never referenced
} // they will get referenced if createReference() is called
if ($this->referenced)
{
$this->ref_id = $a_id;
}
else
{
$this->id = $a_id;
}
// read object data
if ($a_id != 0)
{
$this->read();
}
$ilBench->stop("Core", "ilObject_Constructor");
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::initDefaultRoles | ( | ) |
init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public
Reimplemented in ilObjQuestionPool, ilObjTest, ilObjChat, ilObjAssessmentFolder, ilObjAuthSettings, ilObjExternalToolsSettings, ilObjForum, ilObjGroup, ilObjRecoveryFolder, ilObjStyleSettings, ilObjStyleSheetFolder, ilObjSysUserTracking, ilObj< module_name >, ilObjContentObject, ilObjFileBasedLM, ilObjMediaPool, ilObjiLincCourse, ilObjSurvey, and ilObjSurveyQuestionPool.
Definition at line 1255 of file class.ilObject.php.
{
return array();
}
| ilObject::isUserRegistered | ( | $ | a_user_id = 0 |
) |
| ilObject::MDUpdateListener | ( | $ | a_element | ) |
Meta data update listener.
Important note: Do never call create() or update() method of ilObject here. It would result in an endless loop: update object -> update meta -> update object -> ... Use static _writeTitle() ... methods instead.
| string | $a_element |
Reimplemented in ilObjMediaObject.
Definition at line 651 of file class.ilObject.php.
References $id, _writeDescription(), _writeTitle(), getId(), getType(), setDescription(), and setTitle().
{
include_once 'Services/MetaData/classes/class.ilMD.php';
switch($a_element)
{
case 'General':
// Update Title and description
$md = new ilMD($this->getId(), 0, $this->getType());
$md_gen = $md->getGeneral();
ilObject::_writeTitle($this->getId(),$md_gen->getTitle());
$this->setTitle($md_gen->getTitle());
foreach($md_gen->getDescriptionIds() as $id)
{
$md_des = $md_gen->getDescription($id);
ilObject::_writeDescription($this->getId(),$md_des->getDescription());
$this->setDescription($md_des->getDescription());
break;
}
break;
default:
}
return true;
}
Here is the call graph for this function:| ilObject::notify | ( | $ | a_event, | |
| $ | a_ref_id, | |||
| $ | a_parent_non_rbac_id, | |||
| $ | a_node_id, | |||
| $ | a_params = 0 | |||
| ) |
notifys an object about an event occured Based on the event passed, each object may decide how it reacts.
TODO: add optional array to pass parameters
public
| string | event | |
| integer | reference id of object where the event occured | |
| integer | reference id of node in the tree which is actually notified | |
| array | passes optional parameters if required |
Reimplemented in ilObjQuestionPool, ilObjTest, ilObjAssessmentFolder, ilObjAuthSettings, ilObjExternalToolsSettings, ilObjForum, ilObjGroup, ilObjRecoveryFolder, ilObjRootFolder, ilObjStyleSettings, ilObjStyleSheetFolder, ilObjSysUserTracking, ilObj< module_name >, ilObjContentObject, ilObjFileBasedLM, ilObjGlossary, ilObjMediaPool, ilObjSAHSLearningModule, ilObjCourse, ilObjiLincCourse, ilObjSurvey, and ilObjSurveyQuestionPool.
Definition at line 1335 of file class.ilObject.php.
References $tree.
{
global $tree;
$parent_id = (int) $tree->getParentId($a_node_id);
if ($parent_id != 0)
{
$obj_data =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
$obj_data->notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$parent_id,$a_params);
}
return true;
}
| ilObject::putInTree | ( | $ | a_parent_ref | ) |
maybe this method should be in tree object!?
Reimplemented in ilObjFolder, and ilObjContentObject.
Definition at line 1060 of file class.ilObject.php.
References $log, $tree, getId(), getRefId(), getTitle(), and getType().
{
global $tree, $log;
$tree->insertNode($this->getRefId(), $a_parent_ref);
// write log entry
$log->write("ilObject::putInTree(), parent_ref: $a_parent_ref, ref_id: ".
$this->getRefId().", obj_id: ".$this->getId().", type: ".
$this->getType().", title: ".$this->getTitle());
}
Here is the call graph for this function:| ilObject::read | ( | $ | a_force_db = false |
) |
read object data from db into object
| boolean | public |
Reimplemented in ilObjQuestionPool, ilObjTest, ilObjForum, ilObjRoleFolder, ilObjCourse, ilObjSurvey, and ilObjSurveyQuestionPool.
Definition at line 169 of file class.ilObject.php.
References $ilBench, $obj, $objDefinition, $q, $query, $res, $row, and setDescription().
Referenced by ilObject().
{
global $objDefinition, $ilBench;
$ilBench->start("Core", "ilObject_read");
if (isset($this->obj_data_record) && !$a_force_db)
{
$obj = $this->obj_data_record;
}
else if ($this->referenced)
{
// check reference id
if (!isset($this->ref_id))
{
$message = "ilObject::read(): No ref_id given!";
$this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
}
// read object data
$ilBench->start("Core", "ilObject_read_readData");
/* old query (very slow)
$q = "SELECT * FROM object_data ".
"LEFT JOIN object_reference ON object_data.obj_id=object_reference.obj_id ".
"WHERE object_reference.ref_id='".$this->ref_id."'"; */
$q = "SELECT * FROM object_data, object_reference WHERE object_data.obj_id=object_reference.obj_id ".
"AND object_reference.ref_id='".$this->ref_id."'";
$object_set = $this->ilias->db->query($q);
$ilBench->stop("Core", "ilObject_read_readData");
// check number of records
if ($object_set->numRows() == 0)
{
$message = "ilObject::read(): Object with ref_id ".$this->ref_id." not found!";
$this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
}
$obj = $object_set->fetchRow(DB_FETCHMODE_ASSOC);
}
else
{
// check object id
if (!isset($this->id))
{
$message = "ilObject::read(): No obj_id given!";
$this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
}
// read object data
$q = "SELECT * FROM object_data ".
"WHERE obj_id = '".$this->id."'";
$object_set = $this->ilias->db->query($q);
// check number of records
if ($object_set->numRows() == 0)
{
$message = "ilObject::read(): Object with obj_id: ".$this->id." not found!";
$this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
}
$obj = $object_set->fetchRow(DB_FETCHMODE_ASSOC);
}
$this->id = $obj["obj_id"];
$this->type = $obj["type"];
$this->title = $obj["title"];
$this->desc = $obj["description"];
$this->owner = $obj["owner"];
$this->create_date = $obj["create_date"];
$this->last_update = $obj["last_update"];
$this->import_id = $obj["import_id"];
if($objDefinition->isRBACObject($this->getType()))
{
// Read long description
$query = "SELECT * FROM object_description WHERE obj_id = '".$this->id."'";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setDescription($row->description);
}
}
// multilingual support systemobjects (sys) & categories (db)
$ilBench->start("Core", "ilObject_Constructor_getTranslation");
$translation_type = $objDefinition->getTranslationType($this->type);
if ($translation_type == "sys")
{
$this->title = $this->lng->txt("obj_".$this->type);
$this->desc = $this->lng->txt("obj_".$this->type."_desc");
}
elseif ($translation_type == "db")
{
$q = "SELECT title,description FROM object_translation ".
"WHERE obj_id = ".$this->id." ".
"AND lang_code = '".$this->ilias->account->getCurrentLanguage()."' ".
"AND NOT lang_default = 1";
$r = $this->ilias->db->query($q);
$row = $r->fetchRow(DB_FETCHMODE_OBJECT);
if ($row)
{
$this->title = $row->title;
$this->setDescription($row->description);
#$this->desc = $row->description;
}
}
$ilBench->stop("Core", "ilObject_Constructor_getTranslation");
$ilBench->stop("Core", "ilObject_read");
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::requireRegistration | ( | ) |
Definition at line 1363 of file class.ilObject.php.
{
return $this->register;
}
| ilObject::setDescription | ( | $ | a_desc | ) |
set object description
public
| string | $a_desc object description |
Reimplemented in ilObjQuestionPool, ilObjContentObject, ilObjGlossary, ilObjMediaObject, and ilObjCourse.
Definition at line 387 of file class.ilObject.php.
References ilUtil::shortenText().
Referenced by ilObjRole::assignData(), ilObjNote::createObject(), ilObjSurvey::from_xml(), ilObjTest::from_xml(), ilObjLanguage::install(), MDUpdateListener(), ilObjiLincClassroom::read(), ilObjRoleFolder::read(), read(), ilObjLanguage::uninstall(), and ilObjNote::updateNote().
{
// Shortened form is storted in object_data. Long form is stored in object_description
$this->desc = ilUtil::shortenText($a_desc, $this->max_desc, $this->add_dots);
$this->long_desc = $a_desc;
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::setId | ( | $ | a_id | ) |
set object id public
| integer | $a_id object id |
Reimplemented in ilObjMediaObject, and ilObjCourse.
Definition at line 298 of file class.ilObject.php.
Referenced by ilObjUser::ilObjUser().
{
$this->id = $a_id;
}
Here is the caller graph for this function:| ilObject::setImportId | ( | $ | a_import_id | ) |
set import id
public
| string | $a_import_id import id |
Reimplemented in ilObjContentObject, and ilObjMediaObject.
Definition at line 425 of file class.ilObject.php.
{
$this->import_id = $a_import_id;
}
| ilObject::setObjDataRecord | ( | $ | a_record | ) |
set object_data record (note: this method should only be called from the ilObjectFactory class)
| array | $a_record assoc. array from table object_data public |
Definition at line 518 of file class.ilObject.php.
{
$this->obj_data_record = $a_record;
}
| ilObject::setOwner | ( | $ | a_owner | ) |
set object owner
public
| integer | $a_owner owner id |
Definition at line 485 of file class.ilObject.php.
Referenced by create(), and ilObjUser::setActive().
{
$this->owner = $a_owner;
}
Here is the caller graph for this function:| ilObject::setPermissions | ( | $ | a_parent_ref | ) |
set permissions of object
| integer | reference_id of parent object public |
Definition at line 1079 of file class.ilObject.php.
References $ops, $rbacadmin, $rbacreview, getRefId(), and getType().
{
global $rbacadmin, $rbacreview;
$parentRoles = $rbacreview->getParentRoleIds($a_parent_ref);
foreach ($parentRoles as $parRol)
{
$ops = $rbacreview->getOperationsOfRole($parRol["obj_id"], $this->getType(), $parRol["parent"]);
$rbacadmin->grantPermission($parRol["obj_id"], $ops, $this->getRefId());
}
}
Here is the call graph for this function:| ilObject::setRefId | ( | $ | a_id | ) |
set reference id public
| integer | $a_id reference id |
Definition at line 308 of file class.ilObject.php.
{
$this->ref_id = $a_id;
$this->referenced = true;
}
| ilObject::setRegisterMode | ( | $ | a_bool | ) |
Definition at line 1351 of file class.ilObject.php.
Referenced by ilObjGroup::ilObjGroup(), and ilObjiLincCourse::ilObjiLincCourse().
{
$this->register = (bool) $a_bool;
}
Here is the caller graph for this function:| ilObject::setTitle | ( | $ | a_title | ) |
set object title
public
| string | $a_title object title |
Reimplemented in ilObjQuestionPool, ilObjMediaObject, ilObjContentObject, ilObjGlossary, ilObjMediaObject, ilObjCourse, and ilObjSurveyQuestionPool.
Definition at line 360 of file class.ilObject.php.
References ilUtil::shortenText().
Referenced by ilObjRole::assignData(), ilObjNote::createObject(), ilObjSurvey::from_xml(), ilObjTest::from_xml(), ilObjTest::importObject(), MDUpdateListener(), ilObjiLincClassroom::read(), ilObjRoleFolder::read(), ilObjLanguage::uninstall(), and ilObjNote::updateNote().
{
if ($a_title == "")
{
$a_title = "NO TITLE";
}
$this->title = ilUtil::shortenText($a_title, $this->max_title, $this->add_dots);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::setType | ( | $ | a_type | ) |
set object type public
| integer | $a_type object type |
Definition at line 339 of file class.ilObject.php.
Referenced by ilObjNote::createObject().
{
$this->type = $a_type;
}
Here is the caller graph for this function:| ilObject::update | ( | ) |
update object in db
public
Reimplemented in ilObjQuestionPool, ilObjTest, ilObjAssessmentFolder, ilObjAuthSettings, ilObjExercise, ilObjExternalToolsSettings, ilObjFile, ilObjForum, ilObjMediaObject, ilObjRecoveryFolder, ilObjRole, ilObjStyleSettings, ilObjStyleSheet, ilObjStyleSheetFolder, ilObjSysUserTracking, ilObjUser, ilObj< module_name >, ilObjContentObject, ilObjFileBasedLM, ilObjGlossary, ilObjMediaPool, ilObjSAHSLearningModule, ilObjMediaObject, ilObjCourse, ilObjiLincClassroom, ilObjiLincCourse, ilObjLinkResource, ilObjPaymentSettings, ilObjSearchSettings, ilObjSurvey, and ilObjSurveyQuestionPool.
Definition at line 597 of file class.ilObject.php.
References $objDefinition, $q, $query, $res, getDescription(), getId(), getLongDescription(), getTitle(), and ilUtil::prepareDBString().
Referenced by ilObjLanguage::install(), ilObjLanguage::uninstall(), and ilObjNote::updateNote().
{
global $objDefinition;
$q = "UPDATE object_data ".
"SET ".
"title = '".ilUtil::prepareDBString($this->getTitle())."',".
"description = '".ilUtil::prepareDBString($this->getDescription())."', ".
"import_id = '".$this->getImportId()."', ".
"last_update = now() ".
"WHERE obj_id = '".$this->getId()."'";
$this->ilias->db->query($q);
// the line ($this->read();) messes up meta data handling: meta data,
// that is not saved at this time, gets lost, so we query for the dates alone
//$this->read();
$q = "SELECT last_update FROM object_data".
" WHERE obj_id = '".$this->getId()."'";
$obj_set = $this->ilias->db->query($q);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
$this->last_update = $obj_rec["last_update"];
if($objDefinition->isRBACObject($this->getType()))
{
// Update long description
$res = $this->ilias->db->query("SELECT * FROM object_description WHERE obj_id = '".$this->getId()."'");
if($res->numRows())
{
$query = "UPDATE object_description SET description = '".
ilUtil::prepareDBString($this->getLongDescription())."' ".
"WHERE obj_id = '".$this->getId()."'";
}
else
{
$query = "INSERT INTO object_description SET obj_id = '".$this->getId()."', ".
"description = '".ilUtil::prepareDBString($this->getLongDescription())."'";
}
$this->ilias->db->query($query);
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::updateMetaData | ( | ) |
update meta data entry
Reimplemented in ilObjTest, and ilObjMediaObject.
Definition at line 705 of file class.ilObject.php.
References getId(), getLongDescription(), getTitle(), and getType().
Referenced by ilObjSurveyQuestionPool::update(), ilObjSurvey::update(), ilObjLinkResource::update(), ilObjCourse::update(), ilObjSAHSLearningModule::update(), ilObjGlossary::update(), ilObjFileBasedLM::update(), ilObjContentObject::update(), and ilObjQuestionPool::update().
{
include_once("Services/MetaData/classes/class.ilMD.php");
include_once("Services/MetaData/classes/class.ilMDGeneral.php");
include_once("Services/MetaData/classes/class.ilMDDescription.php");
$md =& new ilMD($this->getId(), 0, $this->getType());
$md_gen =& $md->getGeneral();
$md_gen->setTitle($this->getTitle());
// sets first description (maybe not appropriate)
$md_des_ids =& $md_gen->getDescriptionIds();
if (count($md_des_ids) > 0)
{
$md_des =& $md_gen->getDescription($md_des_ids[0]);
$md_des->setDescription($this->getLongDescription());
$md_des->update();
}
$md_gen->update();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObject::updateOwner | ( | ) |
update owner of object in db
public
Definition at line 744 of file class.ilObject.php.
References $q.
Referenced by ilObjUser::update().
{
$q = "UPDATE object_data ".
"SET ".
"owner = '".$this->getOwner()."', ".
"last_update = now() ".
"WHERE obj_id = '".$this->getId()."'";
$this->ilias->db->query($q);
$q = "SELECT last_update FROM object_data".
" WHERE obj_id = '".$this->getId()."'";
$obj_set = $this->ilias->db->query($q);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
$this->last_update = $obj_rec["last_update"];
return true;
}
Here is the caller graph for this function:| ilObject::withReferences | ( | ) |
determines wehter objects are referenced or not (got ref ids or not)
Definition at line 157 of file class.ilObject.php.
Referenced by ilObjFolder::putInTree().
{
// both vars could differ. this method should always return true if one of them is true without changing their status
return ($this->call_by_reference) ? true : $this->referenced;
}
Here is the caller graph for this function:| ilObject::$add_dots |
Definition at line 98 of file class.ilObject.php.
| ilObject::$create_date |
Definition at line 63 of file class.ilObject.php.
Referenced by ilObjNote::saveNote(), and ilObjNote::updateNote().
| ilObject::$desc |
Definition at line 60 of file class.ilObject.php.
Referenced by _writeDescription().
| ilObject::$id |
Reimplemented in ilObjMediaObject.
Definition at line 56 of file class.ilObject.php.
Referenced by ilObjSystemFolder::_getHeaderTitle(), ilObjSystemFolder::_getHeaderTitleDescription(), ilObjUser::_getImportedUserId(), ilObjSysUserTracking::authorLms(), ilObjSurvey::getAnonymousId(), ilObjSysUserTracking::getObjId(), ilObjSysUserTracking::getTestId(), and MDUpdateListener().
| ilObject::$ilias |
Reimplemented in ilObjNote, and ilObjUser.
Definition at line 42 of file class.ilObject.php.
Referenced by ilObjCourse::_checkCondition(), ilObjExercise::_checkCondition(), ilObjContentObject::_checkPreconditionsOfPage(), ilObjTest::_createImportDirectory(), ilObjQuestionPool::_createImportDirectory(), ilObjAssessmentFolder::_enableAssessmentLogging(), ilObjAssessmentFolder::_enabledAssessmentLogging(), ilObjSysUserTracking::_enabledTracking(), ilObjSysUserTracking::_enabledUserRelatedData(), _exists(), ilObjAssessmentFolder::_getLogLanguage(), ilObjiLincCourse::_isActivated(), ilObjAssessmentFolder::_setLogLanguage(), ilObjForum::_updateOldAccess(), ilObjUserFolder::buildExportFile(), ilObjTest::createImportDirectory(), ilObjSysUserTracking::enableTracking(), ilObjSysUserTracking::enableUserRelatedData(), ilObjGlossary::exportHTML(), ilObjContentObject::exportHTML(), ilObjContentObject::exportPageHTML(), ilObjStyleSheet::getContentStylePath(), ilObjFile::getXMLZip(), ilObject(), ilObjForum::ilObjForum(), ilObjiLincClassroom::ilObjiLincClassroom(), ilObjTest::saveCompleteStatus(), and ilObjTest::saveToDb().
| ilObject::$import_id |
Definition at line 65 of file class.ilObject.php.
| ilObject::$last_update |
Definition at line 64 of file class.ilObject.php.
| ilObject::$lng |
Definition at line 49 of file class.ilObject.php.
Referenced by ilObjExercise::__formatBody(), ilObjiLincClassroom::_getDocent(), ilObjRole::_getTranslation(), ilObjSurvey::_goto(), ilObjLinkResource::_goto(), ilObjContentObject::_goto(), ilObjForum::_goto(), ilObjExercise::_goto(), ilObjTest::_goto(), _lookupOwnerName(), ilObjLanguageFolder::checkAllLanguages(), ilObjUser::getCourses(), ilObjLanguageFolder::getLanguages(), ilObject(), ilObjiLincClassroom::ilObjiLincClassroom(), ilObjLanguage::ilObjLanguage(), ilObjLanguageFolder::ilObjLanguageFolder(), ilObjTest::ilObjTest(), and ilObjTest::importObject().
| ilObject::$long_desc |
Definition at line 61 of file class.ilObject.php.
| ilObject::$max_desc |
Definition at line 92 of file class.ilObject.php.
| ilObject::$max_title |
Definition at line 86 of file class.ilObject.php.
| ilObject::$obj_data_record |
object_data record
Definition at line 103 of file class.ilObject.php.
| ilObject::$objectList |
Definition at line 80 of file class.ilObject.php.
| ilObject::$owner |
Definition at line 62 of file class.ilObject.php.
Referenced by ilObjSurvey::_addQuestionblock(), and _lookupOwnerName().
| ilObject::$ref_id |
Definition at line 57 of file class.ilObject.php.
Referenced by _hasUntrashedReference(), ilObjDlBook::addTranslations(), and ilObjDlBook::deleteTranslations().
| ilObject::$referenced |
Definition at line 73 of file class.ilObject.php.
| ilObject::$register = false |
Definition at line 66 of file class.ilObject.php.
| ilObject::$title |
Definition at line 59 of file class.ilObject.php.
Referenced by ilObjSurvey::_addQuestionblock(), ilObjSystemFolder::_getHeaderTitle(), ilObjSurvey::createQuestionblock(), ilObjMediaPool::deleteChild(), ilObjSysUserTracking::getObjId(), ilObjMediaObject::getTitle(), ilObjSurvey::insertQuestionblock(), ilObjSurvey::modifyQuestionblock(), and ilObjTest::testTitleExists().
| ilObject::$type |
Definition at line 58 of file class.ilObject.php.
Referenced by ilObjSysUserTracking::allAuthor(), ilObjSysUserTracking::authorLms(), ilObjUserFolder::createXMLExport(), ilObjMediaPool::deleteChild(), ilObjGlossary::getExportFiles(), ilObjContentObject::getExportFiles(), ilObjSysUserTracking::getObjId(), and ilObjTest::setTestType().
1.7.1