ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjWiki Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjWiki:
+ Collaboration diagram for ilObjWiki:

Public Member Functions

 __construct (int $a_id=0, bool $a_call_by_reference=true)
 
 setOnline (bool $a_online)
 
 getOnline ()
 
 setRatingOverall (bool $a_rating)
 
 setRating (bool $a_rating)
 
 getRatingOverall ()
 
 setRatingPages (bool $a_rating)
 
 getRatingPages ()
 
 setRatingAsBlock (bool $a_rating)
 
 getRatingAsBlock ()
 
 setRatingForNewPages (bool $a_rating)
 
 getRatingForNewPages ()
 
 setRatingCategories (bool $a_rating)
 
 getRatingCategories ()
 
 setPublicNotes (bool $a_val)
 
 getPublicNotes ()
 
 setStartPage (string $a_startpage)
 
 getStartPage ()
 
 setShortTitle (string $a_shorttitle)
 
 getShortTitle ()
 
 setIntroduction (string $a_introduction)
 
 getIntroduction ()
 
 setPageToc (bool $a_val)
 
 getPageToc ()
 
 setEmptyPageTemplate (bool $a_val)
 
 getEmptyPageTemplate ()
 
 setLinkMetadataValues (bool $a_val)
 
 getLinkMetadataValues ()
 
 create (bool $a_prevent_start_page_creation=false)
 
 update (bool $a_prevent_start_page_creation=false)
 
 read ()
 
 delete ()
 delete object and all related data More...
 
 isImportantPage (int $a_page_id)
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
 getTemplateSelectionOnCreation (string $lang="-")
 Get template selection on creation? If more than one template (including empty page template) is activated -> return true. More...
 
 createWikiPage (string $a_page_title, int $a_template_page=0)
 Create new wiki page. More...
 
 initUserHTMLExport (bool $with_comments=false)
 
 startUserHTMLExport (bool $with_comments=false)
 
 getUserHTMLExportProgress (bool $with_comments=false)
 Get user html export progress. More...
 
 deliverUserHTMLExport (bool $with_comments=false)
 
 decorateAdvMDValue (string $a_value)
 Decorate adv md value. More...
 
 isCommentsExportPossible ()
 Is export possible. More...
 
- 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, int $new_obj_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...
 

Static Public Member Functions

static checkShortTitleAvailability (string $a_short_title)
 
static _lookupRatingOverall (int $a_wiki_id)
 Lookup whether rating is activated for whole object. More...
 
static _lookupRating (int $a_wiki_id)
 Lookup whether rating is activated. More...
 
static _lookupRatingCategories (int $a_wiki_id)
 Lookup whether rating categories are activated. More...
 
static _lookupRatingAsBlock (int $a_wiki_id)
 Lookup whether rating side block is activated. More...
 
static _lookupPublicNotes (int $a_wiki_id)
 Lookup whether public notes are activated. More...
 
static _lookupLinkMetadataValues (int $a_wiki_id)
 Lookup whether metadata should be auto linked. More...
 
static _lookupStartPage (int $a_wiki_id)
 
static writeStartPage (int $a_id, string $a_name)
 
static _performSearch (int $a_wiki_id, string $a_searchterm)
 Search in Wiki. More...
 
static _lookupPageToc (int $a_wiki_id)
 
static getAdvMDSubItemTitle (int $a_obj_id, string $a_sub_type, int $a_sub_id)
 
- 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)
 
static getAdvMDSubItemTitle (int $a_obj_id, string $a_sub_type, int $a_sub_id)
 

Protected Member Functions

 updateInternalLinksOnCopy (array $map)
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Protected Attributes

ILIAS Notes Service $notes
 
ILIAS Wiki InternalDomainService $domain
 
bool $page_toc = false
 
int $style_id = 0
 
string $introduction = ""
 
string $shorttitle = ""
 
string $startpage = ""
 
bool $rating_categories = false
 
bool $rating_new_pages = false
 
bool $rating = false
 
bool $rating_block = false
 
bool $rating_overall = false
 
ilObjUser $user
 
bool $online = false
 
bool $public_notes = true
 
bool $empty_page_templ = true
 
bool $link_md_values = false
 
ilSetting $setting
 
ILIAS Style Content DomainService $content_style_service
 
- 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
 

Static Private Member Functions

static _lookup (int $a_wiki_id, string $a_field)
 Lookup a data field. More...
 

Additional Inherited Members

- 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
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjWiki

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilObjWiki::__construct ( int  $a_id = 0,
bool  $a_call_by_reference = true 
)

Definition at line 46 of file class.ilObjWiki.php.

49 {
50 global $DIC;
51
52 $this->domain = $DIC->wiki()->internal()->domain();
53
54 $this->db = $DIC->database();
55 $this->user = $DIC->user();
56 $this->type = "wiki";
57 $this->setting = $DIC->settings();
58 $this->notes = $DIC->notes();
59 parent::__construct($a_id, $a_call_by_reference);
60
61 $this->content_style_service = $DIC
62 ->contentStyle()
63 ->domain();
64 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _lookup()

static ilObjWiki::_lookup ( int  $a_wiki_id,
string  $a_field 
)
staticprivate

Lookup a data field.

Returns
mixed

Definition at line 407 of file class.ilObjWiki.php.

408 {
409 global $DIC;
410
411 $ilDB = $DIC->database();
412
413 $query = "SELECT $a_field FROM il_wiki_data WHERE id = " .
414 $ilDB->quote($a_wiki_id, "integer");
415 $set = $ilDB->query($query);
416 $rec = $ilDB->fetchAssoc($set);
417 return $rec[$a_field] ?? null;
418 }

References $DIC, and $ilDB.

◆ _lookupLinkMetadataValues()

static ilObjWiki::_lookupLinkMetadataValues ( int  $a_wiki_id)
static

Lookup whether metadata should be auto linked.

Definition at line 398 of file class.ilObjWiki.php.

398 : bool
399 {
400 return (bool) self::_lookup($a_wiki_id, "link_md_values");
401 }
static _lookup(int $a_wiki_id, string $a_field)
Lookup a data field.

◆ _lookupPageToc()

static ilObjWiki::_lookupPageToc ( int  $a_wiki_id)
static

Definition at line 492 of file class.ilObjWiki.php.

494 : bool {
495 return (bool) self::_lookup($a_wiki_id, "page_toc");
496 }

Referenced by ilWikiPageConfig\configureByObjectId().

+ Here is the caller graph for this function:

◆ _lookupPublicNotes()

static ilObjWiki::_lookupPublicNotes ( int  $a_wiki_id)
static

Lookup whether public notes are activated.

Definition at line 390 of file class.ilObjWiki.php.

390 : bool
391 {
392 return (bool) self::_lookup($a_wiki_id, "public_notes");
393 }

Referenced by ilWikiPageGUI\getCommentsHTMLExport(), and ilWikiPageGUI\preview().

+ Here is the caller graph for this function:

◆ _lookupRating()

static ilObjWiki::_lookupRating ( int  $a_wiki_id)
static

Lookup whether rating is activated.

Definition at line 366 of file class.ilObjWiki.php.

366 : bool
367 {
368 return (bool) self::_lookup($a_wiki_id, "rating");
369 }

Referenced by ilWikiFunctionsBlockGUI\getLegacyContent().

+ Here is the caller graph for this function:

◆ _lookupRatingAsBlock()

static ilObjWiki::_lookupRatingAsBlock ( int  $a_wiki_id)
static

Lookup whether rating side block is activated.

Definition at line 382 of file class.ilObjWiki.php.

382 : bool
383 {
384 return (bool) self::_lookup($a_wiki_id, "rating_side");
385 }

◆ _lookupRatingCategories()

static ilObjWiki::_lookupRatingCategories ( int  $a_wiki_id)
static

Lookup whether rating categories are activated.

Definition at line 374 of file class.ilObjWiki.php.

374 : bool
375 {
376 return (bool) self::_lookup($a_wiki_id, "rating_ext");
377 }

◆ _lookupRatingOverall()

static ilObjWiki::_lookupRatingOverall ( int  $a_wiki_id)
static

Lookup whether rating is activated for whole object.

Definition at line 358 of file class.ilObjWiki.php.

358 : bool
359 {
360 return (bool) self::_lookup($a_wiki_id, "rating_overall");
361 }

◆ _lookupStartPage()

static ilObjWiki::_lookupStartPage ( int  $a_wiki_id)
static

Definition at line 420 of file class.ilObjWiki.php.

420 : string
421 {
422 return (string) self::_lookup($a_wiki_id, "startpage");
423 }

Referenced by ilObjWikiGUI\getGotoLink(), and ilWikiFunctionsBlockGUI\getLegacyContent().

+ Here is the caller graph for this function:

◆ _performSearch()

static ilObjWiki::_performSearch ( int  $a_wiki_id,
string  $a_searchterm 
)
static

Search in Wiki.

Definition at line 441 of file class.ilObjWiki.php.

444 : array {
445 // query parser
446 $query_parser = new ilQueryParser($a_searchterm);
447 $query_parser->setCombination("or");
448 $query_parser->parse();
449
450 $search_result = new ilSearchResult();
451 if ($query_parser->validate()) {
452 $wiki_search = ilObjectSearchFactory::_getWikiContentSearchInstance($query_parser);
453 $wiki_search->setFilter(array('wpg'));
454 $r = $wiki_search->performSearch();
455 $search_result->mergeEntries($r);
456 }
457
458 $entries = $search_result->getEntries();
459
460 $found_pages = array();
461 foreach ($entries as $entry) {
462 if ($entry["obj_id"] == $a_wiki_id && is_array($entry["child"])) {
463 foreach ($entry["child"] as $child) {
464 $found_pages[] = array("page_id" => $child);
465 }
466 }
467 }
468 return $found_pages;
469 }
static _getWikiContentSearchInstance(ilQueryParser $query_parser)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by ilObjWikiGUI\performSearchObject(), and ilWikiPageGUI\searchWikiLinkAC().

+ Here is the caller graph for this function:

◆ checkShortTitleAvailability()

static ilObjWiki::checkShortTitleAvailability ( string  $a_short_title)
static

Definition at line 334 of file class.ilObjWiki.php.

336 : bool {
337 global $DIC;
338 $ilDB = $DIC->database();
339
340 if ($a_short_title === "") {
341 return true;
342 }
343 $res = $ilDB->queryF(
344 "SELECT id FROM il_wiki_data WHERE short = %s",
345 array("text"),
346 array($a_short_title)
347 );
348 if ($ilDB->fetchAssoc($res)) {
349 return false;
350 }
351
352 return true;
353 }
$res
Definition: ltiservices.php:69

◆ cloneObject()

ilObjWiki::cloneObject ( int  $target_id,
int  $copy_id = 0,
bool  $omit_tree = false 
)

Definition at line 498 of file class.ilObjWiki.php.

498 : ?ilObject
499 {
500 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
501
502 // Custom meta data activation is stored in a container setting
504 $new_obj->getId(),
507 $this->getId(),
509 0
510 )
511 );
512
513 //copy online status if object is not the root copy object
514 $cp_options = ilCopyWizardOptions::_getInstance($copy_id);
515
516 if (!$cp_options->isRootNode($this->getRefId())) {
517 $new_obj->setOnline($this->getOnline());
518 }
519
520 //$new_obj->setTitle($this->getTitle()); // see #20074
521 $new_obj->setStartPage($this->getStartPage());
522 $new_obj->setShortTitle($this->getShortTitle());
523 $new_obj->setRatingOverall($this->getRatingOverall());
524 $new_obj->setRatingPages($this->getRatingPages());
525 $new_obj->setRatingAsBlock($this->getRatingAsBlock());
526 $new_obj->setRatingForNewPages($this->getRatingForNewPages());
527 $new_obj->setRatingCategories($this->getRatingCategories());
528 $new_obj->setPublicNotes($this->getPublicNotes());
529 $new_obj->setIntroduction($this->getIntroduction());
530 $new_obj->setPageToc($this->getPageToc());
531 $new_obj->update();
532 $this->content_style_service
533 ->styleForRefId($this->getRefId())
534 ->cloneTo($new_obj->getId());
535
536 // copy content
537 $pages = ilWikiPage::getAllWikiPages($this->getId());
538 if (count($pages) > 0) {
539 // if we have any pages, delete the start page first
540 $pg_id = ilWikiPage::getPageIdForTitle($new_obj->getId(), $new_obj->getStartPage());
541 $start_page = new ilWikiPage($pg_id);
542 $start_page->delete();
543 }
544 $map = array();
545 foreach ($pages as $p) {
546 $page = new ilWikiPage($p["id"]);
547 $page->setWikiRefId($this->getRefId());
548 $new_page = new ilWikiPage();
549 $new_page->setWikiRefId($new_obj->getRefId());
550 $new_page->setTitle($page->getTitle());
551 $new_page->setWikiId($new_obj->getId());
552 $new_page->setTitle($page->getTitle());
553 $new_page->setBlocked($page->getBlocked());
554 $new_page->setRating($page->getRating());
555 $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
556 $new_page->create();
557
558 $page->copy($new_page->getId(), "", 0, true);
559 //$new_page->setXMLContent($page->copyXMLContent(true));
560 //$new_page->buildDom(true);
561 //$new_page->update();
562 $map[$p["id"]] = $new_page->getId();
563
565 $copy_id,
566 $this->getId(),
567 $new_obj->getId(),
568 "wpg",
569 (int) $p["id"],
570 $new_page->getId(),
571 );
572 }
573
574 // copy important pages
575 $imp_pages_manager = $this->domain->importantPage($this->getRefId());
576 $imp_pages_manager->cloneTo($new_obj->getId(), $map);
577 $this->updateInternalLinksOnCopy($map);
578
579 // copy rating categories
580 foreach (ilRatingCategory::getAllForObject($this->getId()) as $rc) {
581 $new_rc = new ilRatingCategory();
582 $new_rc->setParentId($new_obj->getId());
583 $new_rc->setTitle((string) $rc["title"]);
584 $new_rc->setDescription((string) $rc["description"]);
585 $new_rc->save();
586 }
587
588 parent::cloneMetaData($new_obj);
589
590 return $new_obj;
591 }
static _cloneValues(int $copy_id, int $a_source_id, int $a_target_id, ?string $a_sub_type=null, ?int $a_source_sub_id=null, ?int $a_target_sub_id=null)
Clone Advanced Meta Data.
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static _getInstance(int $a_copy_id)
updateInternalLinksOnCopy(array $map)
Class ilObject Basic functions for all objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAllForObject(int $a_parent_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getPageIdForTitle(int $a_wiki_id, string $a_title, string $lang="-")
Get wiki page object for id and title.
static getAllWikiPages(int $a_wiki_id, string $lang="-")

References ilAdvancedMDValues\_cloneValues(), ilCopyWizardOptions\_getInstance(), ilContainer\_lookupContainerSetting(), ilContainer\_writeContainerSetting(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilRatingCategory\getAllForObject(), ilWikiPage\getAllWikiPages(), ILIAS\Survey\Mode\getId(), and ilWikiPage\getPageIdForTitle().

+ Here is the call graph for this function:

◆ create()

ilObjWiki::create ( bool  $a_prevent_start_page_creation = false)

Definition at line 203 of file class.ilObjWiki.php.

205 : int {
207
208 $id = parent::create();
209
210 $ilDB->insert("il_wiki_data", array(
211 "id" => array("integer", $this->getId()),
212 "is_online" => array("integer", (int) $this->getOnline()),
213 "startpage" => array("text", $this->getStartPage()),
214 "short" => array("text", $this->getShortTitle()),
215 "rating" => array("integer", (int) $this->getRatingPages()),
216 "public_notes" => array("integer", (int) $this->getPublicNotes()),
217 "introduction" => array("clob", $this->getIntroduction()),
218 "empty_page_templ" => array("integer", (int) $this->getEmptyPageTemplate()),
219 ));
220
221 // create start page
222 if ($this->getStartPage() !== "" && !$a_prevent_start_page_creation) {
223 $start_page = new ilWikiPage();
224 $start_page->setWikiId($this->getId());
225 $start_page->setTitle($this->getStartPage());
226 $start_page->create();
227 }
228
229 $this->notes->domain()->activateComments($this->getId(), $this->getPublicNotes());
230
231 parent::createMetaData();
232
233 return $id;
234 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
ilDBInterface $db

◆ createWikiPage()

ilObjWiki::createWikiPage ( string  $a_page_title,
int  $a_template_page = 0 
)

Create new wiki page.

Definition at line 633 of file class.ilObjWiki.php.

636 : ilWikiPage {
637 // check if template has to be used
638 if ($a_template_page === 0) {
639 if (!$this->getEmptyPageTemplate()) {
640 $wt = new ilWikiPageTemplate($this->getId());
641 $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
642 if (count($ts) === 1) {
643 $t = current($ts);
644 $a_template_page = $t["wpage_id"];
645 }
646 }
647 }
648
649 // create the page
650 $page = new ilWikiPage();
651 $page->setWikiId($this->getId());
652 $page->setTitle(ilWikiUtil::makeDbTitle($a_page_title));
653 if ($this->getRatingPages() && $this->getRatingForNewPages()) {
654 $page->setRating(true);
655 }
656
657 // needed for notification
658 $page->setWikiRefId($this->getRefId());
659 $page->create();
660
661 // copy template into new page
662 if ($a_template_page > 0) {
663 $orig = new ilWikiPage($a_template_page);
664 $orig->copy($page->getId());
665
666 // #15718
668 0,
669 $this->getId(),
670 $this->getId(),
671 "wpg",
672 $a_template_page,
673 $page->getId()
674 );
675 }
676
677 return $page;
678 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static makeDbTitle(string $a_par)

References ILIAS\Survey\Mode\getId(), and ilWikiPageTemplate\TYPE_NEW_PAGES.

+ Here is the call graph for this function:

◆ decorateAdvMDValue()

ilObjWiki::decorateAdvMDValue ( string  $a_value)

Decorate adv md value.

Parameters
string$a_valuevalue
Returns
string decorated value (includes HTML)

Definition at line 746 of file class.ilObjWiki.php.

746 : string
747 {
748 if (ilWikiPage::_wikiPageExists($this->getId(), $a_value)) {
749 $url = ilObjWikiGUI::getGotoLink($this->getRefId(), $a_value);
750 return "<a href='" . $url . "'>" . $a_value . "</a>";
751 }
752
753 return $a_value;
754 }
static getGotoLink(int $a_ref_id, string $a_page="", string $lang="-")
static _wikiPageExists(int $a_wiki_id, string $a_title, string $lang="-")
$url
Definition: shib_logout.php:68

References $url, ilWikiPage\_wikiPageExists(), ilObjWikiGUI\getGotoLink(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ delete()

ilObjWiki::delete ( )

delete object and all related data

Reimplemented from ilObject.

Definition at line 310 of file class.ilObjWiki.php.

310 : bool
311 {
313
314 // always call parent delete function first!!
315 if (!parent::delete()) {
316 return false;
317 }
318
319 // delete record of table il_wiki_data
320 $query = "DELETE FROM il_wiki_data" .
321 " WHERE id = " . $ilDB->quote($this->getId(), "integer");
322 $ilDB->manipulate($query);
323
324 // remove all notifications
326
328
329 parent::deleteMetaData();
330
331 return true;
332 }
static removeForObject(int $type, int $id)
Remove all notifications for given object.
static deleteAllPagesOfWiki(int $a_wiki_id)

References $ilDB, ilWikiPage\deleteAllPagesOfWiki(), ILIAS\Survey\Mode\getId(), ilNotification\removeForObject(), and ilNotification\TYPE_WIKI.

+ Here is the call graph for this function:

◆ deliverUserHTMLExport()

ilObjWiki::deliverUserHTMLExport ( bool  $with_comments = false)

Definition at line 730 of file class.ilObjWiki.php.

732 : void {
734 $ilUser = $this->user;
735
736 $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser, $with_comments);
737 $user_export->deliverFile();
738 }
ilObjUser $user
Class manages user html export.

◆ getAdvMDSubItemTitle()

static ilObjWiki::getAdvMDSubItemTitle ( int  $a_obj_id,
string  $a_sub_type,
int  $a_sub_id 
)
static

Implements ilAdvancedMetaDataSubItems.

Definition at line 680 of file class.ilObjWiki.php.

684 : string {
685 global $DIC;
686
687 $lng = $DIC->language();
688
689 if ($a_sub_type === "wpg") {
690 $lng->loadLanguageModule("wiki");
691 return $lng->txt("wiki_wpg") . ' "' . ilWikiPage::lookupTitle($a_sub_id) . '"';
692 }
693 return "";
694 }
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
static lookupTitle(int $a_page_id, string $lang="-")

References $lng, and ilWikiPage\lookupTitle().

+ Here is the call graph for this function:

◆ getEmptyPageTemplate()

ilObjWiki::getEmptyPageTemplate ( )

Definition at line 188 of file class.ilObjWiki.php.

188 : bool
189 {
191 }
bool $empty_page_templ

References $empty_page_templ.

◆ getIntroduction()

ilObjWiki::getIntroduction ( )

Definition at line 168 of file class.ilObjWiki.php.

168 : string
169 {
170 return $this->introduction;
171 }
string $introduction

References $introduction.

◆ getLinkMetadataValues()

ilObjWiki::getLinkMetadataValues ( )

Definition at line 198 of file class.ilObjWiki.php.

198 : bool
199 {
201 }
bool $link_md_values

References $link_md_values.

◆ getOnline()

ilObjWiki::getOnline ( )

Definition at line 71 of file class.ilObjWiki.php.

71 : bool
72 {
73 return $this->online;
74 }

References $online.

◆ getPageToc()

ilObjWiki::getPageToc ( )

Definition at line 178 of file class.ilObjWiki.php.

178 : bool
179 {
180 return $this->page_toc;
181 }

References $page_toc.

◆ getPublicNotes()

ilObjWiki::getPublicNotes ( )

Definition at line 138 of file class.ilObjWiki.php.

138 : bool
139 {
140 return $this->public_notes;
141 }
bool $public_notes

References $public_notes.

◆ getRatingAsBlock()

ilObjWiki::getRatingAsBlock ( )

Definition at line 108 of file class.ilObjWiki.php.

108 : bool
109 {
110 return $this->rating_block;
111 }
bool $rating_block

References $rating_block.

◆ getRatingCategories()

ilObjWiki::getRatingCategories ( )

Definition at line 128 of file class.ilObjWiki.php.

128 : bool
129 {
131 }
bool $rating_categories

References $rating_categories.

◆ getRatingForNewPages()

ilObjWiki::getRatingForNewPages ( )

Definition at line 118 of file class.ilObjWiki.php.

118 : bool
119 {
121 }
bool $rating_new_pages

References $rating_new_pages.

◆ getRatingOverall()

ilObjWiki::getRatingOverall ( )

Definition at line 87 of file class.ilObjWiki.php.

87 : bool
88 {
90 }
bool $rating_overall

References $rating_overall.

◆ getRatingPages()

ilObjWiki::getRatingPages ( )

Definition at line 98 of file class.ilObjWiki.php.

98 : bool
99 {
100 return $this->rating;
101 }

References $rating.

◆ getShortTitle()

ilObjWiki::getShortTitle ( )

Definition at line 158 of file class.ilObjWiki.php.

158 : string
159 {
160 return $this->shorttitle;
161 }
string $shorttitle

References $shorttitle.

◆ getStartPage()

ilObjWiki::getStartPage ( )

Definition at line 148 of file class.ilObjWiki.php.

148 : string
149 {
150 return $this->startpage;
151 }
string $startpage

References $startpage.

◆ getTemplateSelectionOnCreation()

ilObjWiki::getTemplateSelectionOnCreation ( string  $lang = "-")

Get template selection on creation? If more than one template (including empty page template) is activated -> return true.

Returns
bool true, if manual template selection needed

Definition at line 618 of file class.ilObjWiki.php.

618 : bool
619 {
620 $num = (int) $this->getEmptyPageTemplate();
621 $wt = new ilWikiPageTemplate($this->getId());
622 $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES, $lang);
623 $num += count($ts);
624 if ($num > 1) {
625 return true;
626 }
627 return false;
628 }
$lang
Definition: xapiexit.php:25

References $lang, ILIAS\Survey\Mode\getId(), ILIAS\Repository\int(), and ilWikiPageTemplate\TYPE_NEW_PAGES.

+ Here is the call graph for this function:

◆ getUserHTMLExportProgress()

ilObjWiki::getUserHTMLExportProgress ( bool  $with_comments = false)

Get user html export progress.

Returns
array progress info

Definition at line 720 of file class.ilObjWiki.php.

722 : array {
724 $ilUser = $this->user;
725
726 $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser, $with_comments);
727 return $user_export->getProgress();
728 }

◆ initUserHTMLExport()

ilObjWiki::initUserHTMLExport ( bool  $with_comments = false)

Definition at line 696 of file class.ilObjWiki.php.

698 : void {
700 $ilUser = $this->user;
701
702 $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser, $with_comments);
703 $user_export->initUserHTMLExport();
704 }

◆ isCommentsExportPossible()

ilObjWiki::isCommentsExportPossible ( )

Is export possible.

Definition at line 759 of file class.ilObjWiki.php.

759 : bool
760 {
763 if ($setting->get("disable_comments")) {
764 return false;
765 }
766
767 if (!$this->getPublicNotes()) {
768 return false;
769 }
770 if (!$privacy->enabledCommentsExport()) {
771 return false;
772 }
773 return true;
774 }
ilSetting $setting
get(string $a_keyword, ?string $a_default_value=null)
get setting

References ilSetting\get(), and ilPrivacySettings\getInstance().

+ Here is the call graph for this function:

◆ isImportantPage()

ilObjWiki::isImportantPage ( int  $a_page_id)

Definition at line 471 of file class.ilObjWiki.php.

473 : bool {
475
476 $set = $ilDB->query(
477 "SELECT * FROM il_wiki_imp_pages WHERE " .
478 " wiki_id = " . $ilDB->quote($this->getId(), "integer") . " AND " .
479 " page_id = " . $ilDB->quote($a_page_id, "integer")
480 );
481 if ($ilDB->fetchAssoc($set)) {
482 return true;
483 }
484 return false;
485 }

◆ read()

ilObjWiki::read ( )

Reimplemented from ilObject.

Definition at line 279 of file class.ilObjWiki.php.

279 : void
280 {
282
283 parent::read();
284
285 $query = "SELECT * FROM il_wiki_data WHERE id = " .
286 $ilDB->quote($this->getId(), "integer");
287 $set = $ilDB->query($query);
288 $rec = $ilDB->fetchAssoc($set);
289
290 $this->setOnline((bool) $rec["is_online"]);
291 $this->setStartPage((string) $rec["startpage"]);
292 $this->setShortTitle((string) $rec["short"]);
293 $this->setRatingOverall((bool) $rec["rating_overall"]);
294 $this->setRatingPages((bool) $rec["rating"]);
295 $this->setRatingAsBlock((bool) $rec["rating_side"]);
296 $this->setRatingForNewPages((bool) $rec["rating_new"]);
297 $this->setRatingCategories((bool) $rec["rating_ext"]);
298 //$this->setPublicNotes((bool) $rec["public_notes"]);
299 $this->setIntroduction((string) $rec["introduction"]);
300 $this->setPageToc((bool) $rec["page_toc"]);
301 $this->setEmptyPageTemplate((bool) $rec["empty_page_templ"]);
302 $this->setLinkMetadataValues((bool) $rec["link_md_values"]);
303 $this->setPublicNotes($this->notes->domain()->commentsActive($this->getId()));
304 }
setLinkMetadataValues(bool $a_val)
setRatingAsBlock(bool $a_rating)
setPageToc(bool $a_val)
setOnline(bool $a_online)
setRatingPages(bool $a_rating)
setStartPage(string $a_startpage)
setIntroduction(string $a_introduction)
setEmptyPageTemplate(bool $a_val)
setRatingForNewPages(bool $a_rating)
setPublicNotes(bool $a_val)
setShortTitle(string $a_shorttitle)
setRatingOverall(bool $a_rating)
setRatingCategories(bool $a_rating)

References $ilDB, and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ setEmptyPageTemplate()

ilObjWiki::setEmptyPageTemplate ( bool  $a_val)

Definition at line 183 of file class.ilObjWiki.php.

183 : void
184 {
185 $this->empty_page_templ = $a_val;
186 }

◆ setIntroduction()

ilObjWiki::setIntroduction ( string  $a_introduction)

Definition at line 163 of file class.ilObjWiki.php.

163 : void
164 {
165 $this->introduction = $a_introduction;
166 }

◆ setLinkMetadataValues()

ilObjWiki::setLinkMetadataValues ( bool  $a_val)

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

193 : void
194 {
195 $this->link_md_values = $a_val;
196 }

◆ setOnline()

ilObjWiki::setOnline ( bool  $a_online)

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

66 : void
67 {
68 $this->online = $a_online;
69 }

◆ setPageToc()

ilObjWiki::setPageToc ( bool  $a_val)

Definition at line 173 of file class.ilObjWiki.php.

173 : void
174 {
175 $this->page_toc = $a_val;
176 }

◆ setPublicNotes()

ilObjWiki::setPublicNotes ( bool  $a_val)

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

133 : void
134 {
135 $this->public_notes = $a_val;
136 }

◆ setRating()

ilObjWiki::setRating ( bool  $a_rating)

Definition at line 82 of file class.ilObjWiki.php.

82 : void // this is called by ilObject->handleAutoRating
83 {
84 $this->setRatingOverall($a_rating);
85 }

References setRatingOverall().

+ Here is the call graph for this function:

◆ setRatingAsBlock()

ilObjWiki::setRatingAsBlock ( bool  $a_rating)

Definition at line 103 of file class.ilObjWiki.php.

103 : void
104 {
105 $this->rating_block = $a_rating;
106 }

◆ setRatingCategories()

ilObjWiki::setRatingCategories ( bool  $a_rating)

Definition at line 123 of file class.ilObjWiki.php.

123 : void
124 {
125 $this->rating_categories = $a_rating;
126 }

◆ setRatingForNewPages()

ilObjWiki::setRatingForNewPages ( bool  $a_rating)

Definition at line 113 of file class.ilObjWiki.php.

113 : void
114 {
115 $this->rating_new_pages = $a_rating;
116 }

◆ setRatingOverall()

ilObjWiki::setRatingOverall ( bool  $a_rating)

Definition at line 77 of file class.ilObjWiki.php.

77 : void
78 {
79 $this->rating_overall = $a_rating;
80 }

Referenced by setRating().

+ Here is the caller graph for this function:

◆ setRatingPages()

ilObjWiki::setRatingPages ( bool  $a_rating)

Definition at line 93 of file class.ilObjWiki.php.

93 : void
94 {
95 $this->rating = $a_rating;
96 }

◆ setShortTitle()

ilObjWiki::setShortTitle ( string  $a_shorttitle)

Definition at line 153 of file class.ilObjWiki.php.

153 : void
154 {
155 $this->shorttitle = $a_shorttitle;
156 }

◆ setStartPage()

ilObjWiki::setStartPage ( string  $a_startpage)

Definition at line 143 of file class.ilObjWiki.php.

143 : void
144 {
145 $this->startpage = ilWikiUtil::makeDbTitle($a_startpage);
146 }

References ilWikiUtil\makeDbTitle().

+ Here is the call graph for this function:

◆ startUserHTMLExport()

ilObjWiki::startUserHTMLExport ( bool  $with_comments = false)

Definition at line 706 of file class.ilObjWiki.php.

708 : void {
710 $ilUser = $this->user;
711
712 $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser, $with_comments);
713 $user_export->startUserHTMLExport();
714 }

◆ update()

ilObjWiki::update ( bool  $a_prevent_start_page_creation = false)

Definition at line 236 of file class.ilObjWiki.php.

238 : bool {
240
241 if (!parent::update()) {
242 return false;
243 }
244
245 $ilDB->update("il_wiki_data", array(
246 "is_online" => array("integer", $this->getOnline()),
247 "startpage" => array("text", $this->getStartPage()),
248 "short" => array("text", $this->getShortTitle()),
249 "rating_overall" => array("integer", $this->getRatingOverall()),
250 "rating" => array("integer", $this->getRatingPages()),
251 "rating_side" => array("integer", $this->getRatingAsBlock()), // #13455
252 "rating_new" => array("integer", $this->getRatingForNewPages()),
253 "rating_ext" => array("integer", $this->getRatingCategories()),
254 "public_notes" => array("integer", $this->getPublicNotes()),
255 "introduction" => array("clob", $this->getIntroduction()),
256 "page_toc" => array("integer", $this->getPageToc()),
257 "link_md_values" => array("integer", $this->getLinkMetadataValues()),
258 "empty_page_templ" => array("integer", $this->getEmptyPageTemplate())
259 ), array(
260 "id" => array("integer", $this->getId())
261 ));
262
263 // check whether start page exists
264 if (!ilWikiPage::exists($this->getId(), $this->getStartPage())
265 && !$a_prevent_start_page_creation) {
266 $start_page = new ilWikiPage();
267 $start_page->setWikiId($this->getId());
268 $start_page->setTitle($this->getStartPage());
269 $start_page->setWikiRefId($this->getRefId());
270 $start_page->create();
271 }
272 $this->notes->domain()->activateComments($this->getId(), $this->getPublicNotes());
273
274 parent::updateMetaData();
275
276 return true;
277 }
static exists(int $a_wiki_id, string $a_title, string $lang="-")
Checks whether a page with given title exists.

◆ updateInternalLinksOnCopy()

ilObjWiki::updateInternalLinksOnCopy ( array  $map)
protected

Definition at line 593 of file class.ilObjWiki.php.

593 : void
594 {
595 foreach ($map as $old_page_id => $new_page_id) {
596 // get links with targets inside the wiki
598 "wpg:pg",
599 $old_page_id,
600 "-"
601 );
602 foreach ($targets as $t) {
603 if ((int) $t["inst"] === 0 && in_array($t["type"], ["wpag", "wpage"]) && isset($map[(int) $t["id"]])) {
604 $new_page = new ilWikiPage($new_page_id);
605 if ($new_page->moveIntLinks([$t["id"] => $map[(int) $t["id"]]])) {
606 $new_page->update(true, true);
607 }
608 }
609 }
610 }
611 }

References ilInternalLink\_getTargetsOfSource().

+ Here is the call graph for this function:

◆ writeStartPage()

static ilObjWiki::writeStartPage ( int  $a_id,
string  $a_name 
)
static

Definition at line 425 of file class.ilObjWiki.php.

425 : void
426 {
427 global $DIC;
428
429 $ilDB = $DIC->database();
430
431 $ilDB->manipulate(
432 "UPDATE il_wiki_data SET " .
433 " startpage = " . $ilDB->quote(ilWikiUtil::makeDbTitle($a_name), "text") .
434 " WHERE id = " . $ilDB->quote($a_id, "integer")
435 );
436 }

References $DIC, $ilDB, and ilWikiUtil\makeDbTitle().

+ Here is the call graph for this function:

Field Documentation

◆ $content_style_service

ILIAS Style Content DomainService ilObjWiki::$content_style_service
protected

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

◆ $domain

ILIAS Wiki InternalDomainService ilObjWiki::$domain
protected

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

◆ $empty_page_templ

bool ilObjWiki::$empty_page_templ = true
protected

Definition at line 41 of file class.ilObjWiki.php.

Referenced by getEmptyPageTemplate().

◆ $introduction

string ilObjWiki::$introduction = ""
protected

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

Referenced by getIntroduction().

◆ $link_md_values

bool ilObjWiki::$link_md_values = false
protected

Definition at line 42 of file class.ilObjWiki.php.

Referenced by getLinkMetadataValues().

◆ $notes

ILIAS Notes Service ilObjWiki::$notes
protected

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

◆ $online

bool ilObjWiki::$online = false
protected

Definition at line 39 of file class.ilObjWiki.php.

Referenced by getOnline().

◆ $page_toc

bool ilObjWiki::$page_toc = false
protected

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

Referenced by getPageToc().

◆ $public_notes

bool ilObjWiki::$public_notes = true
protected

Definition at line 40 of file class.ilObjWiki.php.

Referenced by getPublicNotes().

◆ $rating

bool ilObjWiki::$rating = false
protected

Definition at line 35 of file class.ilObjWiki.php.

Referenced by getRatingPages().

◆ $rating_block

bool ilObjWiki::$rating_block = false
protected

Definition at line 36 of file class.ilObjWiki.php.

Referenced by getRatingAsBlock().

◆ $rating_categories

bool ilObjWiki::$rating_categories = false
protected

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

Referenced by getRatingCategories().

◆ $rating_new_pages

bool ilObjWiki::$rating_new_pages = false
protected

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

Referenced by getRatingForNewPages().

◆ $rating_overall

bool ilObjWiki::$rating_overall = false
protected

Definition at line 37 of file class.ilObjWiki.php.

Referenced by getRatingOverall().

◆ $setting

ilSetting ilObjWiki::$setting
protected

Definition at line 43 of file class.ilObjWiki.php.

◆ $shorttitle

string ilObjWiki::$shorttitle = ""
protected

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

Referenced by getShortTitle().

◆ $startpage

string ilObjWiki::$startpage = ""
protected

Definition at line 32 of file class.ilObjWiki.php.

Referenced by getStartPage().

◆ $style_id

int ilObjWiki::$style_id = 0
protected

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

◆ $user

ilObjUser ilObjWiki::$user
protected

Definition at line 38 of file class.ilObjWiki.php.


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