ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjContentPage Class Reference
+ Inheritance diagram for ilObjContentPage:
+ Collaboration diagram for ilObjContentPage:

Public Member Functions

 __construct (int $a_id=0, bool $a_reference=true)
 
 getObjectTranslation ()
 
 getPageObjIds ()
 
 trackProgress (int $usrId)
 
- Public Member Functions inherited from ilObject2
 __construct (int $a_id=0, bool $a_reference=true)
 Constructor. More...
 
 read ()
 
 create (bool $a_clone_mode=false)
 
 update ()
 
 delete ()
 
 cloneMetaData (ilObject $target_obj)
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 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!! More...
 
 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. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Protected Member Functions

 initType ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 doUpdate ()
 
 doDelete ()
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 beforeCreate ()
 If overwritten this method should return true, there is currently no "abort" handling for cases where "false" is returned. More...
 
 doUpdate ()
 
 beforeUpdate ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
 beforeCloneObject ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Protected Attributes

int $styleId = 0
 
ilObjectTranslation $objTrans = null
 
DomainService $content_style_domain
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
LOMServices $lom_services
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Private Member Functions

 initTranslationService ()
 
 initPageMetricsService (ILIAS\Refinery\Factory $refinery)
 

Private Attributes

PageMetricsService $pageMetricsService
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", ?int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static getIconForType (string $type)
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, ?\ilDBInterface $ilDB=null)
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 
- Data Fields inherited from ilContentPageObjectConstants
const OBJ_TYPE = 'copa'
 
const HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT = 'page_editor_style'
 
const UI_CMD_VIEW = 'view'
 
const UI_CMD_EDIT = 'edit'
 
const UI_CMD_UPDATE = 'update'
 
const UI_CMD_COPAGE_DOWNLOAD_FILE = 'downloadFile'
 
const UI_CMD_COPAGE_DISPLAY_FULLSCREEN = 'displayMediaFullscreen'
 
const UI_CMD_COPAGE_DISPLAY_MEDIA = 'displayMedia'
 
const UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH = 'download_paragraph'
 
const UI_CMD_COPAGE_EDIT = 'edit'
 
const UI_CMD_STYLES_EDIT = 'editStyleProperties'
 
const UI_TAB_ID_CONTENT = 'content'
 
const UI_TAB_ID_INFO = 'info_short'
 
const UI_TAB_ID_SETTINGS = 'settings'
 
const UI_TAB_ID_STYLE = 'style'
 
const UI_TAB_ID_I18N = 'i18n'
 
const UI_TAB_ID_LP = 'learning_progress'
 
const UI_TAB_ID_EXPORT = 'export'
 
const UI_TAB_ID_PERMISSIONS = 'perm_settings'
 
const UI_TAB_ID_MD = 'meta_data'
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilObjContentPage::__construct ( int  $a_id = 0,
bool  $a_reference = true 
)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), initPageMetricsService(), and initTranslationService().

34  {
35  global $DIC;
36 
37  parent::__construct($a_id, $a_reference);
38  $this->initTranslationService();
39  $this->initPageMetricsService($DIC->refinery());
40  $this->content_style_domain = $DIC->contentStyle()
41  ->domain();
42  }
initPageMetricsService(ILIAS\Refinery\Factory $refinery)
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ doCloneObject()

ilObjContentPage::doCloneObject ( ilObject2  $new_obj,
int  $a_target_id,
?int  $a_copy_id = null 
)
protected

Definition at line 69 of file class.ilObjContentPage.php.

References ilPageObject\_exists(), ilCopyWizardOptions\_getInstance(), ilContainer\_lookupContainerSetting(), ilContainer\_writeContainerSetting(), ilObject2\cloneMetaData(), ilObject\getId(), ilObjectTranslation\getInstance(), ilObject\getOfflineStatus(), ilObject\getType(), ilObjectServiceSettingsGUI\INFO_TAB_VISIBILITY, ilPageObject\lookupTranslations(), ilObject\setOfflineStatus(), and ilObject2\update().

69  : void
70  {
71  assert($new_obj instanceof ilObjContentPage);
72  parent::doCloneObject($new_obj, $a_target_id, $a_copy_id);
73  $this->cloneMetaData($new_obj);
74 
76  $ot->copy($new_obj->getId());
77 
78  if (ilContentPagePage::_exists($this->getType(), $this->getId(), '', true)) {
79  $translations = ilContentPagePage::lookupTranslations($this->getType(), $this->getId());
80  foreach ($translations as $language) {
81  $originalPageObject = new ilContentPagePage($this->getId(), 0, $language);
82  $copiedXML = $originalPageObject->copyXmlContent();
83 
84  $duplicatePageObject = new ilContentPagePage();
85  $duplicatePageObject->setId($new_obj->getId());
86  $duplicatePageObject->setParentId($new_obj->getId());
87  $duplicatePageObject->setLanguage($language);
88  $duplicatePageObject->setXMLContent($copiedXML);
89  $duplicatePageObject->createFromXML();
90 
91  $this->pageMetricsService->store(
93  $new_obj->getId(),
94  $duplicatePageObject->getLanguage()
95  )
96  );
97  }
98  }
99 
100  $style = $this->content_style_domain->styleForObjId($this->getId());
101  $style->cloneTo($new_obj->getId());
102 
104  $new_obj->getId(),
106  (string) ((bool) ilContainer::_lookupContainerSetting(
107  $this->getId(),
109  '1'
110  ))
111  );
112 
113  $lpSettings = new ilLPObjSettings($this->getId());
114  $lpSettings->cloneSettings($new_obj->getId());
115 
116  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
117  //copy online status if object is not the root copy object
118  if (!$cwo->isRootNode($this->getRefId())) {
119  $new_obj->setOfflineStatus($this->getOfflineStatus());
120  } else {
121  $new_obj->setOfflineStatus(true);
122  }
123  $new_obj->update();
124  }
cloneMetaData(ilObject $target_obj)
static lookupTranslations(string $a_parent_type, int $a_id)
Lookup translations.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static getInstance(int $obj_id)
setOfflineStatus(bool $status)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
static _getInstance(int $a_copy_id)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
+ Here is the call graph for this function:

◆ doCreate()

ilObjContentPage::doCreate ( bool  $clone_mode = false)
protected

Definition at line 133 of file class.ilObjContentPage.php.

References ilObject\createMetaData(), ilObject\getId(), initTranslationService(), ilObject\setOfflineStatus(), and ilObject2\update().

133  : void
134  {
135  parent::doCreate($clone_mode);
136 
137  $this->initTranslationService();
138 
139  $this->db->manipulateF(
140  'INSERT INTO content_page_data (content_page_id, stylesheet ) VALUES(%s, %s)',
141  ['integer', 'integer'],
142  [$this->getId(), 0]
143  );
144 
145  $this->setOfflineStatus(true);
146  $this->update();
147 
148  $this->createMetaData();
149  }
setOfflineStatus(bool $status)
+ Here is the call graph for this function:

◆ doDelete()

ilObjContentPage::doDelete ( )
protected

Definition at line 165 of file class.ilObjContentPage.php.

References ilPageObject\_exists(), ilObject\getId(), ilObject\getType(), and initTranslationService().

165  : void
166  {
167  parent::doDelete();
168 
169  if (ilContentPagePage::_exists($this->getType(), $this->getId(), '', true)) {
170  $originalPageObject = new ilContentPagePage($this->getId());
171  $originalPageObject->delete();
172  }
173 
174  $this->initTranslationService();
175  $this->objTrans->delete();
176 
177  $this->db->manipulateF(
178  'DELETE FROM content_page_metrics WHERE content_page_id = %s',
179  ['integer'],
180  [$this->getId()]
181  );
182 
183  $this->db->manipulateF(
184  'DELETE FROM content_page_data WHERE content_page_id = %s',
185  ['integer'],
186  [$this->getId()]
187  );
188  }
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
+ Here is the call graph for this function:

◆ doRead()

ilObjContentPage::doRead ( )
protected

Definition at line 126 of file class.ilObjContentPage.php.

References initTranslationService().

126  : void
127  {
128  parent::doRead();
129 
130  $this->initTranslationService();
131  }
+ Here is the call graph for this function:

◆ doUpdate()

ilObjContentPage::doUpdate ( )
protected

Definition at line 151 of file class.ilObjContentPage.php.

References ilObject\getLongDescription(), getObjectTranslation(), ilObject\getTitle(), initTranslationService(), and ilObject\updateMetaData().

151  : void
152  {
153  parent::doUpdate();
154 
155  $this->initTranslationService();
156 
157  $trans = $this->getObjectTranslation();
158  $trans->setDefaultTitle($this->getTitle());
159  $trans->setDefaultDescription($this->getLongDescription());
160  $trans->save();
161 
162  $this->updateMetaData();
163  }
getLongDescription()
get object long description (stored in object_description)
+ Here is the call graph for this function:

◆ getObjectTranslation()

ilObjContentPage::getObjectTranslation ( )

Definition at line 59 of file class.ilObjContentPage.php.

References $objTrans.

Referenced by doUpdate().

60  {
61  return $this->objTrans;
62  }
ilObjectTranslation $objTrans
+ Here is the caller graph for this function:

◆ getPageObjIds()

ilObjContentPage::getPageObjIds ( )
Returns
int[]

Definition at line 193 of file class.ilObjContentPage.php.

References $res, ilObject\getId(), ilObject\getType(), and ILIAS\Repository\int().

193  : array
194  {
195  $pageObjIds = [];
196 
197  $sql = 'SELECT DISTINCT page_id FROM page_object WHERE parent_id = %s AND parent_type = %s';
198  $res = $this->db->queryF(
199  $sql,
200  ['integer', 'text'],
201  [$this->getId(), $this->getType()]
202  );
203 
204  while ($row = $this->db->fetchAssoc($res)) {
205  $pageObjIds[] = (int) $row['page_id'];
206  }
207 
208  return $pageObjIds;
209  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

◆ initPageMetricsService()

ilObjContentPage::initPageMetricsService ( ILIAS\Refinery\Factory  $refinery)
private

Definition at line 51 of file class.ilObjContentPage.php.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ initTranslationService()

ilObjContentPage::initTranslationService ( )
private

Definition at line 44 of file class.ilObjContentPage.php.

References ilObject\getId(), ilObjectTranslation\getInstance(), and null.

Referenced by __construct(), doCreate(), doDelete(), doRead(), and doUpdate().

44  : void
45  {
46  if (null === $this->objTrans && $this->getId() > 0) {
47  $this->objTrans = ilObjectTranslation::getInstance($this->getId());
48  }
49  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getInstance(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initType()

ilObjContentPage::initType ( )
protected

Definition at line 64 of file class.ilObjContentPage.php.

64  : void
65  {
66  $this->type = self::OBJ_TYPE;
67  }

◆ trackProgress()

ilObjContentPage::trackProgress ( int  $usrId)

Definition at line 211 of file class.ilObjContentPage.php.

References ilLearningProgress\_tracProgress(), ilObject\getId(), ilObject\getRefId(), and ilObject\getType().

211  : void
212  {
214  $usrId,
215  $this->getId(),
216  $this->getRefId(),
217  $this->getType()
218  );
219  }
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')
+ Here is the call graph for this function:

Field Documentation

◆ $content_style_domain

DomainService ilObjContentPage::$content_style_domain
protected

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

◆ $objTrans

ilObjectTranslation ilObjContentPage::$objTrans = null
protected

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

Referenced by getObjectTranslation().

◆ $pageMetricsService

PageMetricsService ilObjContentPage::$pageMetricsService
private

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

◆ $styleId

int ilObjContentPage::$styleId = 0
protected

Definition at line 28 of file class.ilObjContentPage.php.


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