ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjWiki Class Reference

Class ilObjWiki. More...

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

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 setOnline ($a_online)
 Set Online. More...
 
 getOnline ()
 Get Online. More...
 
 setRatingOverall ($a_rating)
 Set Enable Rating For Object. More...
 
 getRatingOverall ()
 Get Enable Rating For Object. More...
 
 setRating ($a_rating)
 Set Enable Rating. More...
 
 getRating ()
 Get Enable Rating. More...
 
 setRatingAsBlock ($a_rating)
 Set Enable Rating Side Block. More...
 
 getRatingAsBlock ()
 Get Enable Rating Side Block. More...
 
 setRatingForNewPages ($a_rating)
 Set Enable Rating For New Pages. More...
 
 getRatingForNewPages ()
 Get Enable Rating For New Pages. More...
 
 setRatingCategories ($a_rating)
 Set Enable Rating Categories. More...
 
 getRatingCategories ()
 Get Enable Rating Categories. More...
 
 setPublicNotes ($a_val)
 Set public notes. More...
 
 getPublicNotes ()
 Get public notes. More...
 
 setImportantPages ($a_val)
 Set important pages. More...
 
 getImportantPages ()
 Get important pages. More...
 
 setStartPage ($a_startpage)
 Set Start Page. More...
 
 getStartPage ()
 Get Start Page. More...
 
 setShortTitle ($a_shorttitle)
 Set ShortTitle. More...
 
 getShortTitle ()
 Get ShortTitle. More...
 
 setIntroduction ($a_introduction)
 Set Introduction. More...
 
 getIntroduction ()
 Get Introduction. More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 setPageToc ($a_val)
 Set page toc. More...
 
 getPageToc ()
 Get page toc. More...
 
 setEmptyPageTemplate ($a_val)
 Set empty page template. More...
 
 getEmptyPageTemplate ()
 Get empty page template. More...
 
 setLinkMetadataValues ($a_val)
 Set link md values. More...
 
 getLinkMetadataValues ()
 Get link md values. More...
 
 create ($a_prevent_start_page_creation=false)
 Create new wiki. More...
 
 update ($a_prevent_start_page_creation=false)
 update object data More...
 
 read ()
 Read wiki data. More...
 
 delete ()
 delete object and all related data More...
 
 addImportantPage ($a_page_id, $a_nr=0, $a_indent=0)
 Add important page. More...
 
 isImportantPage ($a_page_id)
 Is page an important page? More...
 
 removeImportantPage ($a_id)
 Remove important page. More...
 
 saveOrderingAndIndentation ($a_ord, $a_indent)
 Save ordering and indentation. More...
 
 fixImportantPagesNumbering ()
 Fix important pages numbering. More...
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone wiki. More...
 
 getTemplateSelectionOnCreation ()
 Get template selection on creation? If more than one template (including empty page template) is activated -> return true. More...
 
 createWikiPage ($a_page_title, $a_template_page=0)
 Create new wiki page. More...
 
 initUserHTMLExport ($with_comments=false)
 Init user html export. More...
 
 startUserHTMLExport ($with_comments=false)
 Start user html export. More...
 
 getUserHTMLExportProgress ($with_comments=false)
 Get user html export progress. More...
 
 deliverUserHTMLExport ($with_comments=false)
 Send user html export file. More...
 
 decorateAdvMDValue ($a_value)
 Decorate adv md value. More...
 
 isCommentsExportPossible ()
 Is export possible. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 setOfflineStatus ($a_status)
 Set offline status. More...
 
 getOfflineStatus ()
 Get offline status. More...
 
 supportsOfflineHandling ()
 Check whether object supports offline handling. More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 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 If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static isOnlineHelpWiki ($a_ref_id)
 Is wiki an online help wiki? More...
 
static checkShortTitleAvailability ($a_short_title)
 Check availability of short title. More...
 
static _lookupRatingOverall ($a_wiki_id)
 Lookup whether rating is activated for whole object. More...
 
static _lookupRating ($a_wiki_id)
 Lookup whether rating is activated. More...
 
static _lookupRatingCategories ($a_wiki_id)
 Lookup whether rating categories are activated. More...
 
static _lookupRatingAsBlock ($a_wiki_id)
 Lookup whether rating side block is activated. More...
 
static _lookupPublicNotes ($a_wiki_id)
 Lookup whether public notes are activated. More...
 
static _lookupLinkMetadataValues ($a_wiki_id)
 Lookup whether metadata should be auto linked. More...
 
static _lookupStartPage ($a_wiki_id)
 Lookup start page. More...
 
static writeStartPage ($a_id, $a_name)
 Write start page. More...
 
static _performSearch ($a_wiki_id, $a_searchterm)
 Search in Wiki. More...
 
static _lookupImportantPages ($a_wiki_id)
 Lookup whether important pages are activated. More...
 
static _lookupImportantPagesList ($a_wiki_id)
 Get important pages list. More...
 
static _lookupMaxOrdNrImportantPages ($a_wiki_id)
 Get important pages list. More...
 
static _lookupPageToc ($a_wiki_id)
 Lookup whether important pages are activated. More...
 
static getAdvMDSubItemTitle ($a_obj_id, $a_sub_type, $a_sub_id)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static lookupOfflineStatus ($a_obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id, $a_deleted_by)
 
static setDeletedDates ($a_ref_ids, $a_user_id)
 Set deleted date. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Protected Member Functions

 updateInternalLinksOnCopy (array $map)
 

Protected Attributes

 $user
 
 $online = false
 
 $public_notes = true
 
 $empty_page_templ = true
 
 $link_md_values = false
 
 $setting
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Static Private Member Functions

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

Additional Inherited Members

- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Detailed Description

Class ilObjWiki.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

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

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

44  {
45  global $DIC;
46 
47  $this->db = $DIC->database();
48  $this->user = $DIC->user();
49  $this->type = "wiki";
50  $this->setting = $DIC->settings();
51  parent::__construct($a_id, $a_call_by_reference);
52  }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _lookup()

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

Lookup a data field.

Parameters
int$a_wiki_idWiki ID
string$a_fieldField Name
Returns
mixed field value

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

References $DIC, $ilDB, and $query.

Referenced by _lookupImportantPages(), _lookupLinkMetadataValues(), _lookupPageToc(), _lookupPublicNotes(), _lookupRating(), _lookupRatingAsBlock(), _lookupRatingCategories(), _lookupRatingOverall(), and _lookupStartPage().

609  {
610  global $DIC;
611 
612  $ilDB = $DIC->database();
613 
614  $query = "SELECT $a_field FROM il_wiki_data WHERE id = " .
615  $ilDB->quote($a_wiki_id, "integer");
616  $set = $ilDB->query($query);
617  $rec = $ilDB->fetchAssoc($set);
618  return $rec[$a_field];
619  }
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupImportantPages()

static ilObjWiki::_lookupImportantPages (   $a_wiki_id)
static

Lookup whether important pages are activated.

Parameters
int$a_wiki_idWiki ID
Returns
boolean Important pages activated?

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

References _lookup().

697  {
698  return ilObjWiki::_lookup($a_wiki_id, "imp_pages");
699  }
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
+ Here is the call graph for this function:

◆ _lookupImportantPagesList()

static ilObjWiki::_lookupImportantPagesList (   $a_wiki_id)
static

Get important pages list.

Parameters

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

References $DIC, and $ilDB.

Referenced by ilImportantPagesTableGUI\__construct(), cloneObject(), ilObjWikiGUI\editImportantPagesObject(), fixImportantPagesNumbering(), ilWikiImportantPagesBlockGUI\getLegacyContent(), and saveOrderingAndIndentation().

708  {
709  global $DIC;
710 
711  $ilDB = $DIC->database();
712 
713  $set = $ilDB->query(
714  "SELECT * FROM il_wiki_imp_pages WHERE " .
715  " wiki_id = " . $ilDB->quote($a_wiki_id, "integer") . " ORDER BY ord ASC "
716  );
717 
718  $imp_pages = array();
719 
720  while ($rec = $ilDB->fetchAssoc($set)) {
721  $imp_pages[] = $rec;
722  }
723  return $imp_pages;
724  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupLinkMetadataValues()

static ilObjWiki::_lookupLinkMetadataValues (   $a_wiki_id)
static

Lookup whether metadata should be auto linked.

Parameters
int$a_wiki_idWiki ID
Returns
boolean auto linking activated?

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

References _lookup().

596  {
597  return ilObjWiki::_lookup($a_wiki_id, "link_md_values");
598  }
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
+ Here is the call graph for this function:

◆ _lookupMaxOrdNrImportantPages()

static ilObjWiki::_lookupMaxOrdNrImportantPages (   $a_wiki_id)
static

Get important pages list.

Parameters

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

References $DIC, and $ilDB.

Referenced by addImportantPage().

733  {
734  global $DIC;
735 
736  $ilDB = $DIC->database();
737 
738  $set = $ilDB->query(
739  "SELECT MAX(ord) as m FROM il_wiki_imp_pages WHERE " .
740  " wiki_id = " . $ilDB->quote($a_wiki_id, "integer")
741  );
742 
743  $rec = $ilDB->fetchAssoc($set);
744  return (int) $rec["m"];
745  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupPageToc()

static ilObjWiki::_lookupPageToc (   $a_wiki_id)
static

Lookup whether important pages are activated.

Parameters
int$a_wiki_idWiki ID
Returns
boolean Important pages activated?

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

References _lookup().

Referenced by ilWikiPageConfig\configureByObjectId().

905  {
906  return ilObjWiki::_lookup($a_wiki_id, "page_toc");
907  }
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupPublicNotes()

static ilObjWiki::_lookupPublicNotes (   $a_wiki_id)
static

Lookup whether public notes are activated.

Parameters
int$a_wiki_idWiki ID
Returns
boolean public notes activated?

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

References _lookup().

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

584  {
585  return ilObjWiki::_lookup($a_wiki_id, "public_notes");
586  }
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupRating()

static ilObjWiki::_lookupRating (   $a_wiki_id)
static

Lookup whether rating is activated.

Parameters
int$a_wiki_idWiki ID
Returns
boolean Rating activated?

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

References _lookup().

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

548  {
549  return ilObjWiki::_lookup($a_wiki_id, "rating");
550  }
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupRatingAsBlock()

static ilObjWiki::_lookupRatingAsBlock (   $a_wiki_id)
static

Lookup whether rating side block is activated.

Parameters
int$a_wiki_idWiki ID
Returns
boolean Rating side block activated?

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

References _lookup().

572  {
573  return ilObjWiki::_lookup($a_wiki_id, "rating_side");
574  }
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
+ Here is the call graph for this function:

◆ _lookupRatingCategories()

static ilObjWiki::_lookupRatingCategories (   $a_wiki_id)
static

Lookup whether rating categories are activated.

Parameters
int$a_wiki_idWiki ID
Returns
boolean Rating categories activated?

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

References _lookup().

Referenced by ilObjWikiGUI\renderSideBlock().

560  {
561  return ilObjWiki::_lookup($a_wiki_id, "rating_ext");
562  }
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupRatingOverall()

static ilObjWiki::_lookupRatingOverall (   $a_wiki_id)
static

Lookup whether rating is activated for whole object.

Parameters
int$a_wiki_idWiki ID
Returns
boolean Rating activated?

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

References _lookup().

Referenced by ilWikiPageGUI\addHeaderAction().

536  {
537  return ilObjWiki::_lookup($a_wiki_id, "rating_overall");
538  }
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupStartPage()

static ilObjWiki::_lookupStartPage (   $a_wiki_id)
static

Lookup start page.

Parameters
int$a_wiki_idWiki ID
Returns
boolean

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

References _lookup().

Referenced by ilWikiHandlerGUI\executeCommand(), ilObjWikiGUI\getGotoLink(), ilWikiImportantPagesBlockGUI\getLegacyContent(), ilWikiFunctionsBlockGUI\getLegacyContent(), ilWikiPage\getOrphanedPages(), and ilWikiPage\rename().

629  {
630  return ilObjWiki::_lookup($a_wiki_id, "startpage");
631  }
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _performSearch()

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

Search in Wiki.

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

References ilObjectSearchFactory\_getWikiContentSearchInstance().

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

654  {
655  // query parser
656  include_once 'Services/Search/classes/class.ilQueryParser.php';
657 
658  $query_parser = new ilQueryParser($a_searchterm);
659  $query_parser->setCombination("or");
660  $query_parser->parse();
661 
662  include_once 'Services/Search/classes/class.ilSearchResult.php';
663  $search_result = new ilSearchResult();
664  if ($query_parser->validate()) {
665  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
666  $wiki_search = ilObjectSearchFactory::_getWikiContentSearchInstance($query_parser);
667  $wiki_search->setFilter(array('wpg'));
668  $search_result->mergeEntries($wiki_search->performSearch());
669  }
670 
671  $entries = $search_result->getEntries();
672 
673  $found_pages = array();
674  foreach ($entries as $entry) {
675  if ($entry["obj_id"] == $a_wiki_id && is_array($entry["child"])) {
676  foreach ($entry["child"] as $child) {
677  $found_pages[] = array("page_id" => $child);
678  }
679  }
680  }
681 
682  return $found_pages;
683  }
static _getWikiContentSearchInstance($query_parser)
get reference of ilFulltextWikiContentSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addImportantPage()

ilObjWiki::addImportantPage (   $a_page_id,
  $a_nr = 0,
  $a_indent = 0 
)

Add important page.

Parameters
intpage id

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

References ilObject\$db, $ilDB, _lookupMaxOrdNrImportantPages(), ilObject\getId(), and isImportantPage().

754  {
755  $ilDB = $this->db;
756 
757  if (!$this->isImportantPage($a_page_id)) {
758  if ($a_nr == 0) {
759  $a_nr = ilObjWiki::_lookupMaxOrdNrImportantPages($this->getId()) + 10;
760  }
761 
762  $ilDB->manipulate("INSERT INTO il_wiki_imp_pages " .
763  "(wiki_id, ord, indent, page_id) VALUES (" .
764  $ilDB->quote($this->getId(), "integer") . "," .
765  $ilDB->quote($a_nr, "integer") . "," .
766  $ilDB->quote($a_indent, "integer") . "," .
767  $ilDB->quote($a_page_id, "integer") .
768  ")");
769  }
770  }
isImportantPage($a_page_id)
Is page an important page?
getId()
get object id public
static _lookupMaxOrdNrImportantPages($a_wiki_id)
Get important pages list.
global $ilDB
+ Here is the call graph for this function:

◆ checkShortTitleAvailability()

static ilObjWiki::checkShortTitleAvailability (   $a_short_title)
static

Check availability of short title.

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

References $DIC, $ilDB, and $res.

Referenced by ilObjWikiGUI\saveObject(), and ilObjWikiGUI\saveSettingsObject().

511  {
512  global $DIC;
513 
514  $ilDB = $DIC->database();
515 
516  $res = $ilDB->queryF(
517  "SELECT id FROM il_wiki_data WHERE short = %s",
518  array("text"),
519  array($a_short_title)
520  );
521  if ($ilDB->fetchAssoc($res)) {
522  return false;
523  }
524 
525  return true;
526  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ cloneObject()

ilObjWiki::cloneObject (   $a_target_id,
  $a_copy_id = 0,
  $a_omit_tree = false 
)

Clone wiki.

Parameters
inttarget ref_id
intcopy id

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

References ilAdvancedMDValues\_cloneValues(), ilCopyWizardOptions\_getInstance(), ilContainer\_lookupContainerSetting(), _lookupImportantPagesList(), ilObjStyleSheet\_lookupStandard(), ilContainer\_writeContainerSetting(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilRatingCategory\getAllForObject(), ilWikiPage\getAllWikiPages(), ilObject\getId(), getImportantPages(), ilObjectFactory\getInstanceByObjId(), getIntroduction(), getOnline(), ilWikiPage\getPageIdForTitle(), getPageToc(), getPublicNotes(), getRating(), getRatingAsBlock(), getRatingCategories(), getRatingForNewPages(), getRatingOverall(), getShortTitle(), getStartPage(), getStyleSheetId(), and updateInternalLinksOnCopy().

916  {
917  $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
918 
919  // Custom meta data activation is stored in a container setting
921  $new_obj->getId(),
924  $this->getId(),
926  0
927  )
928  );
929 
930  //copy online status if object is not the root copy object
931  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
932 
933  if (!$cp_options->isRootNode($this->getRefId())) {
934  $new_obj->setOnline($this->getOnline());
935  }
936 
937  //$new_obj->setTitle($this->getTitle()); // see #20074
938  $new_obj->setStartPage($this->getStartPage());
939  $new_obj->setShortTitle($this->getShortTitle());
940  $new_obj->setRatingOverall($this->getRatingOverall());
941  $new_obj->setRating($this->getRating());
942  $new_obj->setRatingAsBlock($this->getRatingAsBlock());
943  $new_obj->setRatingForNewPages($this->getRatingForNewPages());
944  $new_obj->setRatingCategories($this->getRatingCategories());
945  $new_obj->setPublicNotes($this->getPublicNotes());
946  $new_obj->setIntroduction($this->getIntroduction());
947  $new_obj->setImportantPages($this->getImportantPages());
948  $new_obj->setPageToc($this->getPageToc());
949  $new_obj->update();
950 
951  // set/copy stylesheet
952  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
953  $style_id = $this->getStyleSheetId();
954  if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id)) {
955  $style_obj = ilObjectFactory::getInstanceByObjId($style_id);
956  $new_id = $style_obj->ilClone();
957  $new_obj->setStyleSheetId($new_id);
958  $new_obj->update();
959  }
960 
961  // copy content
962  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
963  $pages = ilWikiPage::getAllWikiPages($this->getId());
964  if (count($pages) > 0) {
965  // if we have any pages, delete the start page first
966  $pg_id = ilWikiPage::getPageIdForTitle($new_obj->getId(), $new_obj->getStartPage());
967  $start_page = new ilWikiPage($pg_id);
968  $start_page->delete();
969  }
970  $map = array();
971  foreach ($pages as $p) {
972  $page = new ilWikiPage($p["id"]);
973  $new_page = new ilWikiPage();
974  $new_page->setTitle($page->getTitle());
975  $new_page->setWikiId($new_obj->getId());
976  $new_page->setTitle($page->getTitle());
977  $new_page->setBlocked($page->getBlocked());
978  $new_page->setRating($page->getRating());
979  $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
980  $new_page->create();
981 
982  $page->copy($new_page->getId(), "", 0, true);
983  //$new_page->setXMLContent($page->copyXMLContent(true));
984  //$new_page->buildDom(true);
985  //$new_page->update();
986  $map[$p["id"]] = $new_page->getId();
987 
989  $this->getId(),
990  $new_obj->getId(),
991  "wpg",
992  $p["id"],
993  $new_page->getId(),
994  true
995  );
996  }
997 
998  // copy important pages
999  foreach (ilObjWiki::_lookupImportantPagesList($this->getId()) as $ip) {
1000  $new_obj->addImportantPage($map[$ip["page_id"]], $ip["ord"], $ip["indent"]);
1001  }
1002  $this->updateInternalLinksOnCopy($map);
1003 
1004  // copy rating categories
1005  include_once("./Services/Rating/classes/class.ilRatingCategory.php");
1006  foreach (ilRatingCategory::getAllForObject($this->getId()) as $rc) {
1007  $new_rc = new ilRatingCategory();
1008  $new_rc->setParentId($new_obj->getId());
1009  $new_rc->setTitle($rc["title"]);
1010  $new_rc->setDescription($rc["description"]);
1011  $new_rc->save();
1012  }
1013 
1014  return $new_obj;
1015  }
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
getRatingOverall()
Get Enable Rating For Object.
getStartPage()
Get Start Page.
getShortTitle()
Get ShortTitle.
getPublicNotes()
Get public notes.
getRatingForNewPages()
Get Enable Rating For New Pages.
getRatingCategories()
Get Enable Rating Categories.
static getAllForObject($a_parent_obj_id)
Get all categories for object.
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
updateInternalLinksOnCopy(array $map)
static _lookupStandard($a_id)
Lookup standard flag.
getPageToc()
Get page toc.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getId()
get object id public
getRatingAsBlock()
Get Enable Rating Side Block.
getStyleSheetId()
get ID of assigned style sheet object
Class ilWikiPage.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getAllWikiPages($a_wiki_id)
Get all pages of wiki.
static _cloneValues($a_source_id, $a_target_id, $a_sub_type=null, $a_source_sub_id=null, $a_target_sub_id=null, $use_stored_record_map=false)
Clone Advanced Meta Data.
getIntroduction()
Get Introduction.
Class ilRatingCategory.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
getImportantPages()
Get important pages.
getOnline()
Get Online.
getRating()
Get Enable Rating.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:

◆ create()

ilObjWiki::create (   $a_prevent_start_page_creation = false)

Create new wiki.

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

References ilObject\$db, $ilDB, getEmptyPageTemplate(), ilObject\getId(), getIntroduction(), getOnline(), getPublicNotes(), getRating(), getShortTitle(), getStartPage(), getStyleSheetId(), and ilObjStyleSheet\writeStyleUsage().

363  {
364  $ilDB = $this->db;
365 
366  parent::create();
367 
368  $ilDB->insert("il_wiki_data", array(
369  "id" => array("integer", $this->getId()),
370  "is_online" => array("integer", (int) $this->getOnline()),
371  "startpage" => array("text", $this->getStartPage()),
372  "short" => array("text", $this->getShortTitle()),
373  "rating" => array("integer", (int) $this->getRating()),
374  "public_notes" => array("integer", (int) $this->getPublicNotes()),
375  "introduction" => array("clob", $this->getIntroduction()),
376  "empty_page_templ" => array("integer", (int) $this->getEmptyPageTemplate()),
377  ));
378 
379  // create start page
380  if ($this->getStartPage() != "" && !$a_prevent_start_page_creation) {
381  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
382  $start_page = new ilWikiPage();
383  $start_page->setWikiId($this->getId());
384  $start_page->setTitle($this->getStartPage());
385  $start_page->create();
386  }
387 
388  if (((int) $this->getStyleSheetId()) > 0) {
389  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
391  }
392  }
getStartPage()
Get Start Page.
getShortTitle()
Get ShortTitle.
getPublicNotes()
Get public notes.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getEmptyPageTemplate()
Get empty page template.
getId()
get object id public
getStyleSheetId()
get ID of assigned style sheet object
Class ilWikiPage.
getIntroduction()
Get Introduction.
global $ilDB
getOnline()
Get Online.
getRating()
Get Enable Rating.
+ Here is the call graph for this function:

◆ createWikiPage()

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

Create new wiki page.

Parameters
string$a_page_titlepage title
int$a_template_pagetemplate page id
Returns
ilWikiPage new wiki page

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

References ilAdvancedMDValues\_cloneValues(), getEmptyPageTemplate(), ilObject\getId(), getRating(), getRatingForNewPages(), ilObject\getRefId(), ilWikiUtil\makeDbTitle(), and ilWikiPageTemplate\TYPE_NEW_PAGES.

1064  {
1065  // check if template has to be used
1066  if ($a_template_page == 0) {
1067  if (!$this->getEmptyPageTemplate()) {
1068  include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1069  $wt = new ilWikiPageTemplate($this->getId());
1070  $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1071  if (count($ts) == 1) {
1072  $t = current($ts);
1073  $a_template_page = $t["wpage_id"];
1074  }
1075  }
1076  }
1077 
1078  // create the page
1079  $page = new ilWikiPage();
1080  $page->setWikiId($this->getId());
1081  $page->setTitle(ilWikiUtil::makeDbTitle($a_page_title));
1082  if ($this->getRating() && $this->getRatingForNewPages()) {
1083  $page->setRating(true);
1084  }
1085 
1086  // needed for notification
1087  $page->setWikiRefId($this->getRefId());
1088  $page->create();
1089 
1090  // copy template into new page
1091  if ($a_template_page > 0) {
1092  $orig = new ilWikiPage($a_template_page);
1093  $orig->copy($page->getId());
1094 
1095  // #15718
1096  include_once "Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php";
1098  $this->getId(),
1099  $this->getId(),
1100  "wpg",
1101  $a_template_page,
1102  $page->getId()
1103  );
1104  }
1105 
1106  return $page;
1107  }
getRatingForNewPages()
Get Enable Rating For New Pages.
getEmptyPageTemplate()
Get empty page template.
getId()
get object id public
Class ilWikiPage.
static makeDbTitle($a_par)
Handle page GET parameter.
static _cloneValues($a_source_id, $a_target_id, $a_sub_type=null, $a_source_sub_id=null, $a_target_sub_id=null, $use_stored_record_map=false)
Clone Advanced Meta Data.
getRefId()
get reference id public
getRating()
Get Enable Rating.
+ Here is the call graph for this function:

◆ decorateAdvMDValue()

ilObjWiki::decorateAdvMDValue (   $a_value)

Decorate adv md value.

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

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

References $url, ilWikiPage\_wikiPageExists(), ilObjWikiGUI\getGotoLink(), ilObject\getId(), and ilObject\getRefId().

1194  {
1195  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1196  if (ilWikiPage::_wikiPageExists($this->getId(), $a_value)) {
1197  $url = ilObjWikiGUI::getGotoLink($this->getRefId(), $a_value);
1198  return "<a href='" . $url . "'>" . $a_value . "</a>";
1199  }
1200 
1201  return $a_value;
1202  }
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
getId()
get object id public
static _wikiPageExists($a_wiki_id, $a_title)
Check whether page exists for wiki or not.
getRefId()
get reference id public
$url
+ Here is the call graph for this function:

◆ delete()

ilObjWiki::delete ( )

delete object and all related data

public

Returns
boolean true if all object data were removed; false if only a references were removed

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

References ilObject\$db, $ilDB, $query, ilWikiPage\deleteAllPagesOfWiki(), ilObject\getId(), ilNotification\removeForObject(), and ilNotification\TYPE_WIKI.

484  {
485  $ilDB = $this->db;
486 
487  // always call parent delete function first!!
488  if (!parent::delete()) {
489  return false;
490  }
491 
492  // delete record of table il_wiki_data
493  $query = "DELETE FROM il_wiki_data" .
494  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
495  $ilDB->manipulate($query);
496 
497  // remove all notifications
498  include_once "./Services/Notification/classes/class.ilNotification.php";
500 
501  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
503 
504  return true;
505  }
static removeForObject($type, $id)
Remove all notifications for given object.
getId()
get object id public
$query
global $ilDB
static deleteAllPagesOfWiki($a_wiki_id)
delete wiki page and al related data
+ Here is the call graph for this function:

◆ deliverUserHTMLExport()

ilObjWiki::deliverUserHTMLExport (   $with_comments = false)

Send user html export file.

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

References ilObject\$db, $ilDB, $ilUser, and $user.

1176  {
1177  $ilDB = $this->db;
1178  $ilUser = $this->user;
1179 
1180  include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1181 
1182  $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser, $with_comments);
1183  $user_export->deliverFile();
1184  }
Class manages user html export.
global $ilDB
$ilUser
Definition: imgupload.php:18

◆ fixImportantPagesNumbering()

ilObjWiki::fixImportantPagesNumbering ( )

Fix important pages numbering.

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

References ilObject\$db, $ilDB, _lookupImportantPagesList(), and ilObject\getId().

Referenced by removeImportantPage().

864  {
865  $ilDB = $this->db;
866 
867  $ipages = ilObjWiki::_lookupImportantPagesList($this->getId());
868 
869  // fix indentation: no 2 is allowed after a 0
870  $c_indent = 0;
871  $fixed = false;
872  foreach ($ipages as $k => $v) {
873  if ($ipages[$k]["indent"] == 2 && $c_indent == 0) {
874  $ipages[$k]["indent"] = 1;
875  $fixed = true;
876  }
877  $c_indent = $ipages[$k]["indent"];
878  }
879 
880  $ord = 10;
881  foreach ($ipages as $k => $v) {
882  $ilDB->manipulate(
883  $q = "UPDATE il_wiki_imp_pages SET " .
884  " ord = " . $ilDB->quote($ord, "integer") .
885  ", indent = " . $ilDB->quote($v["indent"], "integer") .
886  " WHERE wiki_id = " . $ilDB->quote($v["wiki_id"], "integer") .
887  " AND page_id = " . $ilDB->quote($v["page_id"], "integer")
888  );
889  $ord += 10;
890  }
891  }
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAdvMDSubItemTitle()

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

Implements ilAdvancedMetaDataSubItems.

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

References $DIC, ilObject\$lng, and ilWikiPage\lookupTitle().

1110  {
1111  global $DIC;
1112 
1113  $lng = $DIC->language();
1114 
1115  if ($a_sub_type == "wpg") {
1116  $lng->loadLanguageModule("wiki");
1117  include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
1118  return $lng->txt("wiki_wpg") . ' "' . ilWikiPage::lookupTitle($a_sub_id) . '"';
1119  }
1120  }
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ getEmptyPageTemplate()

ilObjWiki::getEmptyPageTemplate ( )

Get empty page template.

Returns
boolean empty page template

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

References $empty_page_templ.

Referenced by create(), createWikiPage(), getTemplateSelectionOnCreation(), and update().

322  {
324  }
+ Here is the caller graph for this function:

◆ getImportantPages()

ilObjWiki::getImportantPages ( )

Get important pages.

Returns
boolean important pages

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

Referenced by cloneObject(), and update().

206  {
207  return $this->imp_pages;
208  }
+ Here is the caller graph for this function:

◆ getIntroduction()

ilObjWiki::getIntroduction ( )

Get Introduction.

Returns
string Introduction

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

Referenced by cloneObject(), create(), and update().

266  {
267  return $this->introduction;
268  }
+ Here is the caller graph for this function:

◆ getLinkMetadataValues()

ilObjWiki::getLinkMetadataValues ( )

Get link md values.

Returns
bool link metadata values

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

References $link_md_values.

Referenced by update().

342  {
343  return $this->link_md_values;
344  }
+ Here is the caller graph for this function:

◆ getOnline()

ilObjWiki::getOnline ( )

Get Online.

Returns
boolean Online

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

References $online.

Referenced by cloneObject(), create(), and update().

70  {
71  return $this->online;
72  }
+ Here is the caller graph for this function:

◆ getPageToc()

ilObjWiki::getPageToc ( )

Get page toc.

Returns
boolean page toc

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

Referenced by cloneObject(), and update().

302  {
303  return $this->page_toc;
304  }
+ Here is the caller graph for this function:

◆ getPublicNotes()

ilObjWiki::getPublicNotes ( )

Get public notes.

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

References $public_notes.

Referenced by cloneObject(), create(), isCommentsExportPossible(), and update().

186  {
187  return $this->public_notes;
188  }
+ Here is the caller graph for this function:

◆ getRating()

ilObjWiki::getRating ( )

Get Enable Rating.

Returns
boolean Enable Rating

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

Referenced by cloneObject(), create(), createWikiPage(), and update().

110  {
111  return $this->rating;
112  }
+ Here is the caller graph for this function:

◆ getRatingAsBlock()

ilObjWiki::getRatingAsBlock ( )

Get Enable Rating Side Block.

Returns
boolean

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

Referenced by cloneObject(), and update().

130  {
131  return $this->rating_block;
132  }
+ Here is the caller graph for this function:

◆ getRatingCategories()

ilObjWiki::getRatingCategories ( )

Get Enable Rating Categories.

Returns
boolean

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

Referenced by cloneObject(), and update().

170  {
171  return $this->rating_categories;
172  }
+ Here is the caller graph for this function:

◆ getRatingForNewPages()

ilObjWiki::getRatingForNewPages ( )

Get Enable Rating For New Pages.

Returns
boolean

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

Referenced by cloneObject(), createWikiPage(), and update().

150  {
151  return $this->rating_new_pages;
152  }
+ Here is the caller graph for this function:

◆ getRatingOverall()

ilObjWiki::getRatingOverall ( )

Get Enable Rating For Object.

Returns
boolean Enable Rating

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

Referenced by cloneObject(), and update().

90  {
91  return $this->rating_overall;
92  }
+ Here is the caller graph for this function:

◆ getShortTitle()

ilObjWiki::getShortTitle ( )

Get ShortTitle.

Returns
string ShortTitle

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

Referenced by cloneObject(), create(), and update().

246  {
247  return $this->shorttitle;
248  }
+ Here is the caller graph for this function:

◆ getStartPage()

ilObjWiki::getStartPage ( )

Get Start Page.

Returns
string Start Page

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

Referenced by cloneObject(), create(), and update().

226  {
227  return $this->startpage;
228  }
+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjWiki::getStyleSheetId ( )

get ID of assigned style sheet object

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

Referenced by cloneObject(), create(), and update().

274  {
275  return $this->style_id;
276  }
+ Here is the caller graph for this function:

◆ getTemplateSelectionOnCreation()

ilObjWiki::getTemplateSelectionOnCreation ( )

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

Returns
boolean true, if manual template selection needed

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

References getEmptyPageTemplate(), ilObject\getId(), and ilWikiPageTemplate\TYPE_NEW_PAGES.

1044  {
1045  $num = (int) $this->getEmptyPageTemplate();
1046  include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1047  $wt = new ilWikiPageTemplate($this->getId());
1048  $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1049  $num += count($ts);
1050  if ($num > 1) {
1051  return true;
1052  }
1053  return false;
1054  }
getEmptyPageTemplate()
Get empty page template.
getId()
get object id public
+ Here is the call graph for this function:

◆ getUserHTMLExportProgress()

ilObjWiki::getUserHTMLExportProgress (   $with_comments = false)

Get user html export progress.

Returns
array progress info

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

References ilObject\$db, $ilDB, $ilUser, and $user.

1162  {
1163  $ilDB = $this->db;
1164  $ilUser = $this->user;
1165 
1166  include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1167 
1168  $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser, $with_comments);
1169  return $user_export->getProgress();
1170  }
Class manages user html export.
global $ilDB
$ilUser
Definition: imgupload.php:18

◆ initUserHTMLExport()

ilObjWiki::initUserHTMLExport (   $with_comments = false)

Init user html export.

Parameters

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

References ilObject\$db, $ilDB, $ilUser, and $user.

1129  {
1130  $ilDB = $this->db;
1131  $ilUser = $this->user;
1132 
1133  include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1134 
1135  $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser, $with_comments);
1136  $user_export->initUserHTMLExport();
1137  }
Class manages user html export.
global $ilDB
$ilUser
Definition: imgupload.php:18

◆ isCommentsExportPossible()

ilObjWiki::isCommentsExportPossible ( )

Is export possible.

Returns
bool

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

References $setting, ilPrivacySettings\_getInstance(), and getPublicNotes().

1209  {
1211  $privacy = ilPrivacySettings::_getInstance();
1212  if ($setting->get("disable_comments")) {
1213  return false;
1214  }
1215 
1216  if (!$this->getPublicNotes()) {
1217  return false;
1218  }
1219  if (!$privacy->enabledCommentsExport()) {
1220  return false;
1221  }
1222  return true;
1223  }
getPublicNotes()
Get public notes.
static _getInstance()
Get instance of ilPrivacySettings.
+ Here is the call graph for this function:

◆ isImportantPage()

ilObjWiki::isImportantPage (   $a_page_id)

Is page an important page?

Parameters

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

References ilObject\$db, and $ilDB.

Referenced by addImportantPage().

779  {
780  $ilDB = $this->db;
781 
782  $set = $ilDB->query(
783  "SELECT * FROM il_wiki_imp_pages WHERE " .
784  " wiki_id = " . $ilDB->quote($this->getId(), "integer") . " AND " .
785  " page_id = " . $ilDB->quote($a_page_id, "integer")
786  );
787  if ($rec = $ilDB->fetchAssoc($set)) {
788  return true;
789  }
790  return false;
791  }
global $ilDB
+ Here is the caller graph for this function:

◆ isOnlineHelpWiki()

static ilObjWiki::isOnlineHelpWiki (   $a_ref_id)
static

Is wiki an online help wiki?

Returns
boolean true, if current wiki is an online help wiki

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

Referenced by ilObjWikiGUI\isOnlineHelpWiki().

352  {
353  if ($a_ref_id > 0 && $a_ref_id == OH_REF_ID) {
354  // return true;
355  }
356  return false;
357  }
+ Here is the caller graph for this function:

◆ read()

ilObjWiki::read ( )

Read wiki data.

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

References ilObject\$db, $ilDB, $query, ilObject\getId(), ilObjStyleSheet\lookupObjectStyle(), setEmptyPageTemplate(), setImportantPages(), setIntroduction(), setLinkMetadataValues(), setOnline(), setPageToc(), setPublicNotes(), setRating(), setRatingAsBlock(), setRatingCategories(), setRatingForNewPages(), setRatingOverall(), setShortTitle(), setStartPage(), and setStyleSheetId().

447  {
448  $ilDB = $this->db;
449 
450  parent::read();
451 
452  $query = "SELECT * FROM il_wiki_data WHERE id = " .
453  $ilDB->quote($this->getId(), "integer");
454  $set = $ilDB->query($query);
455  $rec = $ilDB->fetchAssoc($set);
456 
457  $this->setOnline($rec["is_online"]);
458  $this->setStartPage($rec["startpage"]);
459  $this->setShortTitle($rec["short"]);
460  $this->setRatingOverall($rec["rating_overall"]);
461  $this->setRating($rec["rating"]);
462  $this->setRatingAsBlock($rec["rating_side"]);
463  $this->setRatingForNewPages($rec["rating_new"]);
464  $this->setRatingCategories($rec["rating_ext"]);
465  $this->setPublicNotes($rec["public_notes"]);
466  $this->setIntroduction($rec["introduction"]);
467  $this->setImportantPages($rec["imp_pages"]);
468  $this->setPageToc($rec["page_toc"]);
469  $this->setEmptyPageTemplate($rec["empty_page_templ"]);
470  $this->setLinkMetadataValues($rec["link_md_values"]);
471 
472  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
474  }
setImportantPages($a_val)
Set important pages.
setOnline($a_online)
Set Online.
setIntroduction($a_introduction)
Set Introduction.
setPublicNotes($a_val)
Set public notes.
static lookupObjectStyle($a_obj_id)
Lookup object style.
setRatingCategories($a_rating)
Set Enable Rating Categories.
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
setRatingAsBlock($a_rating)
Set Enable Rating Side Block.
setEmptyPageTemplate($a_val)
Set empty page template.
getId()
get object id public
$query
setShortTitle($a_shorttitle)
Set ShortTitle.
setStartPage($a_startpage)
Set Start Page.
setLinkMetadataValues($a_val)
Set link md values.
setRating($a_rating)
Set Enable Rating.
setRatingForNewPages($a_rating)
Set Enable Rating For New Pages.
global $ilDB
setRatingOverall($a_rating)
Set Enable Rating For Object.
setPageToc($a_val)
Set page toc.
+ Here is the call graph for this function:

◆ removeImportantPage()

ilObjWiki::removeImportantPage (   $a_id)

Remove important page.

Parameters
intpage id

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

References ilObject\$db, $ilDB, and fixImportantPagesNumbering().

799  {
800  $ilDB = $this->db;
801 
802  $ilDB->manipulate(
803  "DELETE FROM il_wiki_imp_pages WHERE "
804  . " wiki_id = " . $ilDB->quote($this->getId(), "integer")
805  . " AND page_id = " . $ilDB->quote($a_id, "integer")
806  );
807 
809  }
fixImportantPagesNumbering()
Fix important pages numbering.
global $ilDB
+ Here is the call graph for this function:

◆ saveOrderingAndIndentation()

ilObjWiki::saveOrderingAndIndentation (   $a_ord,
  $a_indent 
)

Save ordering and indentation.

Parameters

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

References ilObject\$db, $ilDB, _lookupImportantPagesList(), ilObject\getId(), and ilUtil\sortArray().

818  {
819  $ilDB = $this->db;
820 
821  $ipages = ilObjWiki::_lookupImportantPagesList($this->getId());
822 
823  foreach ($ipages as $k => $v) {
824  if (isset($a_ord[$v["page_id"]])) {
825  $ipages[$k]["ord"] = (int) $a_ord[$v["page_id"]];
826  }
827  if (isset($a_indent[$v["page_id"]])) {
828  $ipages[$k]["indent"] = (int) $a_indent[$v["page_id"]];
829  }
830  }
831  $ipages = ilUtil::sortArray($ipages, "ord", "asc", true);
832 
833  // fix indentation: no 2 is allowed after a 0
834  $c_indent = 0;
835  $fixed = false;
836  foreach ($ipages as $k => $v) {
837  if ($ipages[$k]["indent"] == 2 && $c_indent == 0) {
838  $ipages[$k]["indent"] = 1;
839  $fixed = true;
840  }
841  $c_indent = $ipages[$k]["indent"];
842  }
843 
844  $ord = 10;
845  reset($ipages);
846  foreach ($ipages as $k => $v) {
847  $ilDB->manipulate(
848  $q = "UPDATE il_wiki_imp_pages SET " .
849  " ord = " . $ilDB->quote($ord, "integer") . "," .
850  " indent = " . $ilDB->quote($v["indent"], "integer") .
851  " WHERE wiki_id = " . $ilDB->quote($v["wiki_id"], "integer") .
852  " AND page_id = " . $ilDB->quote($v["page_id"], "integer")
853  );
854  $ord += 10;
855  }
856 
857  return $fixed;
858  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:

◆ setEmptyPageTemplate()

ilObjWiki::setEmptyPageTemplate (   $a_val)

Set empty page template.

Parameters
boolean$a_valempty page template

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

Referenced by read().

312  {
313  $this->empty_page_templ = $a_val;
314  }
+ Here is the caller graph for this function:

◆ setImportantPages()

ilObjWiki::setImportantPages (   $a_val)

Set important pages.

Parameters
boolean$a_valimportant pages

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

Referenced by read().

196  {
197  $this->imp_pages = $a_val;
198  }
+ Here is the caller graph for this function:

◆ setIntroduction()

ilObjWiki::setIntroduction (   $a_introduction)

Set Introduction.

Parameters
string$a_introductionIntroduction

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

Referenced by read().

256  {
257  $this->introduction = $a_introduction;
258  }
+ Here is the caller graph for this function:

◆ setLinkMetadataValues()

ilObjWiki::setLinkMetadataValues (   $a_val)

Set link md values.

Parameters
bool$a_vallink metadata values

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

Referenced by read().

332  {
333  $this->link_md_values = $a_val;
334  }
+ Here is the caller graph for this function:

◆ setOnline()

ilObjWiki::setOnline (   $a_online)

Set Online.

Parameters
boolean$a_onlineOnline

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

Referenced by read().

60  {
61  $this->online = $a_online;
62  }
+ Here is the caller graph for this function:

◆ setPageToc()

ilObjWiki::setPageToc (   $a_val)

Set page toc.

Parameters
boolean$a_valpage toc

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

Referenced by read().

292  {
293  $this->page_toc = $a_val;
294  }
+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjWiki::setPublicNotes (   $a_val)

Set public notes.

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

Referenced by read().

178  {
179  $this->public_notes = $a_val;
180  }
+ Here is the caller graph for this function:

◆ setRating()

ilObjWiki::setRating (   $a_rating)

Set Enable Rating.

Parameters
boolean$a_ratingEnable Rating

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

Referenced by read().

100  {
101  $this->rating = (bool) $a_rating;
102  }
+ Here is the caller graph for this function:

◆ setRatingAsBlock()

ilObjWiki::setRatingAsBlock (   $a_rating)

Set Enable Rating Side Block.

Parameters
boolean$a_rating

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

Referenced by read().

120  {
121  $this->rating_block = (bool) $a_rating;
122  }
+ Here is the caller graph for this function:

◆ setRatingCategories()

ilObjWiki::setRatingCategories (   $a_rating)

Set Enable Rating Categories.

Parameters
boolean$a_rating

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

Referenced by read().

160  {
161  $this->rating_categories = (bool) $a_rating;
162  }
+ Here is the caller graph for this function:

◆ setRatingForNewPages()

ilObjWiki::setRatingForNewPages (   $a_rating)

Set Enable Rating For New Pages.

Parameters
boolean$a_rating

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

Referenced by read().

140  {
141  $this->rating_new_pages = (bool) $a_rating;
142  }
+ Here is the caller graph for this function:

◆ setRatingOverall()

ilObjWiki::setRatingOverall (   $a_rating)

Set Enable Rating For Object.

Parameters
boolean$a_ratingEnable Rating

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

Referenced by read().

80  {
81  $this->rating_overall = (bool) $a_rating;
82  }
+ Here is the caller graph for this function:

◆ setShortTitle()

ilObjWiki::setShortTitle (   $a_shorttitle)

Set ShortTitle.

Parameters
string$a_shorttitleShortTitle

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

Referenced by read().

236  {
237  $this->shorttitle = $a_shorttitle;
238  }
+ Here is the caller graph for this function:

◆ setStartPage()

ilObjWiki::setStartPage (   $a_startpage)

Set Start Page.

Parameters
string$a_startpageStart Page

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

References ilWikiUtil\makeDbTitle().

Referenced by read().

216  {
217  $this->startpage = ilWikiUtil::makeDbTitle($a_startpage);
218  }
static makeDbTitle($a_par)
Handle page GET parameter.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilObjWiki::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

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

Referenced by read().

282  {
283  $this->style_id = $a_style_id;
284  }
+ Here is the caller graph for this function:

◆ startUserHTMLExport()

ilObjWiki::startUserHTMLExport (   $with_comments = false)

Start user html export.

Parameters

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

References ilObject\$db, $ilDB, $ilUser, and $user.

1146  {
1147  $ilDB = $this->db;
1148  $ilUser = $this->user;
1149 
1150  include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1151 
1152  $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser, $with_comments);
1153  $user_export->startUserHTMLExport();
1154  }
Class manages user html export.
global $ilDB
$ilUser
Definition: imgupload.php:18

◆ update()

ilObjWiki::update (   $a_prevent_start_page_creation = false)

update object data

public

Returns
boolean

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

References ilObject\$db, $ilDB, ilWikiPage\exists(), getEmptyPageTemplate(), ilObject\getId(), getImportantPages(), getIntroduction(), getLinkMetadataValues(), getOnline(), getPageToc(), getPublicNotes(), getRating(), getRatingAsBlock(), getRatingCategories(), getRatingForNewPages(), getRatingOverall(), getShortTitle(), getStartPage(), getStyleSheetId(), and ilObjStyleSheet\writeStyleUsage().

401  {
402  $ilDB = $this->db;
403 
404  if (!parent::update()) {
405  return false;
406  }
407 
408  $ilDB->update("il_wiki_data", array(
409  "is_online" => array("integer", $this->getOnline()),
410  "startpage" => array("text", $this->getStartPage()),
411  "short" => array("text", $this->getShortTitle()),
412  "rating_overall" => array("integer", $this->getRatingOverall()),
413  "rating" => array("integer", $this->getRating()),
414  "rating_side" => array("integer", (bool) $this->getRatingAsBlock()), // #13455
415  "rating_new" => array("integer", $this->getRatingForNewPages()),
416  "rating_ext" => array("integer", $this->getRatingCategories()),
417  "public_notes" => array("integer", $this->getPublicNotes()),
418  "introduction" => array("clob", $this->getIntroduction()),
419  "imp_pages" => array("integer", $this->getImportantPages()),
420  "page_toc" => array("integer", $this->getPageToc()),
421  "link_md_values" => array("integer", $this->getLinkMetadataValues()),
422  "empty_page_templ" => array("integer", $this->getEmptyPageTemplate())
423  ), array(
424  "id" => array("integer", $this->getId())
425  ));
426 
427  // check whether start page exists
428  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
429  if (!ilWikiPage::exists($this->getId(), $this->getStartPage())
430  && !$a_prevent_start_page_creation) {
431  $start_page = new ilWikiPage();
432  $start_page->setWikiId($this->getId());
433  $start_page->setTitle($this->getStartPage());
434  $start_page->create();
435  }
436 
437  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
439 
440  return true;
441  }
getRatingOverall()
Get Enable Rating For Object.
getStartPage()
Get Start Page.
getLinkMetadataValues()
Get link md values.
getShortTitle()
Get ShortTitle.
getPublicNotes()
Get public notes.
getRatingForNewPages()
Get Enable Rating For New Pages.
getRatingCategories()
Get Enable Rating Categories.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getPageToc()
Get page toc.
getEmptyPageTemplate()
Get empty page template.
getId()
get object id public
getRatingAsBlock()
Get Enable Rating Side Block.
getStyleSheetId()
get ID of assigned style sheet object
Class ilWikiPage.
static exists($a_wiki_id, $a_title)
Checks whether a page with given title exists.
getIntroduction()
Get Introduction.
global $ilDB
getImportantPages()
Get important pages.
getOnline()
Get Online.
getRating()
Get Enable Rating.
+ Here is the call graph for this function:

◆ updateInternalLinksOnCopy()

ilObjWiki::updateInternalLinksOnCopy ( array  $map)
protected

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

References ilInternalLink\_getTargetsOfSource().

Referenced by cloneObject().

1017  : void
1018  {
1019  foreach ($map as $old_page_id => $new_page_id) {
1020  // get links with targets inside the wiki
1022  "wpg:pg",
1023  $old_page_id,
1024  "-"
1025  );
1026  foreach ($targets as $t) {
1027  if ((int) $t["inst"] === 0 && $t["type"] === "wpag" && isset($map[(int) $t["id"]])) {
1028  $new_page = new ilWikiPage($new_page_id);
1029  if ($new_page->moveIntLinks([$t["id"] => $map[(int) $t["id"]]])) {
1030  $new_page->update(true, true);
1031  }
1032  }
1033  }
1034  }
1035  }
Class ilWikiPage.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeStartPage()

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

Write start page.

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

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

Referenced by ilWikiPage\rename().

637  {
638  global $DIC;
639 
640  $ilDB = $DIC->database();
641 
642  include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
643  $ilDB->manipulate(
644  "UPDATE il_wiki_data SET " .
645  " startpage = " . $ilDB->quote(ilWikiUtil::makeDbTitle($a_name), "text") .
646  " WHERE id = " . $ilDB->quote($a_id, "integer")
647  );
648  }
global $DIC
Definition: goto.php:24
static makeDbTitle($a_par)
Handle page GET parameter.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $empty_page_templ

ilObjWiki::$empty_page_templ = true
protected

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

Referenced by getEmptyPageTemplate().

◆ $link_md_values

ilObjWiki::$link_md_values = false
protected

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

Referenced by getLinkMetadataValues().

◆ $online

ilObjWiki::$online = false
protected

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

Referenced by getOnline().

◆ $public_notes

ilObjWiki::$public_notes = true
protected

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

Referenced by getPublicNotes().

◆ $setting

ilObjWiki::$setting
protected

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

Referenced by isCommentsExportPossible().

◆ $user

ilObjWiki::$user
protected

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