ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjWiki Class Reference

Class ilObjWiki. More...

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

Public Member Functions

 ilObjWiki ($a_id=0, $a_call_by_reference=true)
 Constructor @access 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...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event happend, each object may decide how it reacts. 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)
 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 ()
 Init user html export. More...
 
 startUserHTMLExport ()
 Start user html export. More...
 
 getUserHTMLExportProgress ()
 Get user html export progress. More...
 
 deliverUserHTMLExport ()
 Send user html export file. More...
 
 decorateAdvMDValue ($a_value)
 Decorate adv md value. More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access 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...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) 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...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type 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) @access public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 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...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. 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 _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date @global type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data@access public 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 hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 
static getAdvMDSubItemTitle ($a_obj_id, $a_sub_type, $a_sub_id)
 

Protected Attributes

 $online = false
 
 $public_notes = true
 
 $empty_page_templ = true
 
 $link_md_values = false
 

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
 
 $ilias
 
 $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
 
 $obj_data_record
 object_data record More...
 

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.

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 663 of file class.ilObjWiki.php.

664 {
665 global $ilDB;
666
667 $query = "SELECT $a_field FROM il_wiki_data WHERE id = ".
668 $ilDB->quote($a_wiki_id, "integer");
669 $set = $ilDB->query($query);
670 $rec = $ilDB->fetchAssoc($set);
671 return $rec[$a_field];
672 }
global $ilDB

References $ilDB, and $query.

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

+ 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 751 of file class.ilObjWiki.php.

752 {
753 return ilObjWiki::_lookup($a_wiki_id, "imp_pages");
754 }
static _lookup($a_wiki_id, $a_field)
Lookup a data field.

References _lookup().

+ Here is the call graph for this function:

◆ _lookupImportantPagesList()

static ilObjWiki::_lookupImportantPagesList (   $a_wiki_id)
static

Get important pages list.

Parameters

return

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

763 {
764 global $ilDB;
765
766 $set = $ilDB->query("SELECT * FROM il_wiki_imp_pages WHERE ".
767 " wiki_id = ".$ilDB->quote($a_wiki_id, "integer")." ORDER BY ord ASC "
768 );
769
770 $imp_pages = array();
771
772 while ($rec = $ilDB->fetchAssoc($set))
773 {
774 $imp_pages[] = $rec;
775 }
776 return $imp_pages;
777 }

References $ilDB.

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

+ 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 650 of file class.ilObjWiki.php.

651 {
652 return ilObjWiki::_lookup($a_wiki_id, "link_md_values");
653 }

References _lookup().

+ Here is the call graph for this function:

◆ _lookupMaxOrdNrImportantPages()

static ilObjWiki::_lookupMaxOrdNrImportantPages (   $a_wiki_id)
static

Get important pages list.

Parameters

return

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

786 {
787 global $ilDB;
788
789 $set = $ilDB->query("SELECT MAX(ord) as m FROM il_wiki_imp_pages WHERE ".
790 " wiki_id = ".$ilDB->quote($a_wiki_id, "integer")
791 );
792
793 $rec = $ilDB->fetchAssoc($set);
794 return (int) $rec["m"];
795 }

References $ilDB.

Referenced by addImportantPage().

+ 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 963 of file class.ilObjWiki.php.

964 {
965 return ilObjWiki::_lookup($a_wiki_id, "page_toc");
966 }

References _lookup().

Referenced by ilWikiPageConfig\configureByObjectId().

+ 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 638 of file class.ilObjWiki.php.

639 {
640 return ilObjWiki::_lookup($a_wiki_id, "public_notes");
641 }

References _lookup().

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

+ 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 602 of file class.ilObjWiki.php.

603 {
604 return ilObjWiki::_lookup($a_wiki_id, "rating");
605 }

References _lookup().

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

+ 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 626 of file class.ilObjWiki.php.

627 {
628 return ilObjWiki::_lookup($a_wiki_id, "rating_side");
629 }

References _lookup().

+ 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 614 of file class.ilObjWiki.php.

615 {
616 return ilObjWiki::_lookup($a_wiki_id, "rating_ext");
617 }

References _lookup().

Referenced by ilObjWikiGUI\renderSideBlock().

+ 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 590 of file class.ilObjWiki.php.

591 {
592 return ilObjWiki::_lookup($a_wiki_id, "rating_overall");
593 }

References _lookup().

Referenced by ilWikiPageGUI\addHeaderAction().

+ 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 681 of file class.ilObjWiki.php.

682 {
683 return ilObjWiki::_lookup($a_wiki_id, "startpage");
684 }

References _lookup().

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

+ 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 703 of file class.ilObjWiki.php.

704 {
705 // query parser
706 include_once 'Services/Search/classes/class.ilQueryParser.php';
707
708 $query_parser = new ilQueryParser($a_searchterm);
709 $query_parser->setCombination("or");
710 $query_parser->parse();
711
712 include_once 'Services/Search/classes/class.ilSearchResult.php';
713 $search_result = new ilSearchResult();
714 if($query_parser->validate())
715 {
716
717 include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
718 $wiki_search =& ilObjectSearchFactory::_getWikiContentSearchInstance($query_parser);
719 $wiki_search->setFilter(array('wpg'));
720 $search_result->mergeEntries($wiki_search->performSearch());
721 }
722
723 $entries = $search_result->getEntries();
724
725 $found_pages = array();
726 foreach($entries as $entry)
727 {
728 if ($entry["obj_id"] == $a_wiki_id && is_array($entry["child"]))
729 {
730 foreach($entry["child"] as $child)
731 {
732 $found_pages[] = array("page_id" => $child);
733 }
734 }
735 }
736
737 return $found_pages;
738 }
static _getWikiContentSearchInstance($query_parser)
get reference of ilFulltextWikiContentSearch

References ilObjectSearchFactory\_getWikiContentSearchInstance().

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

+ 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 803 of file class.ilObjWiki.php.

804 {
805 global $ilDB;
806
807 if (!$this->isImportantPage($a_page_id))
808 {
809 if ($a_nr == 0)
810 {
811 $a_nr = ilObjWiki::_lookupMaxOrdNrImportantPages($this->getId()) + 10;
812 }
813
814 $ilDB->manipulate("INSERT INTO il_wiki_imp_pages ".
815 "(wiki_id, ord, indent, page_id) VALUES (".
816 $ilDB->quote($this->getId(), "integer").",".
817 $ilDB->quote($a_nr, "integer").",".
818 $ilDB->quote($a_indent, "integer").",".
819 $ilDB->quote($a_page_id, "integer").
820 ")");
821 }
822 }
isImportantPage($a_page_id)
Is page an important page?
static _lookupMaxOrdNrImportantPages($a_wiki_id)
Get important pages list.
getId()
get object id @access public

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

+ Here is the call graph for this function:

◆ checkShortTitleAvailability()

static ilObjWiki::checkShortTitleAvailability (   $a_short_title)
static

Check availability of short title.

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

503 {
504 global $ilDB;
505
506 $res = $ilDB->queryF("SELECT id FROM il_wiki_data WHERE short = %s",
507 array("text"), array($a_short_title));
508 if ($ilDB->fetchAssoc($res))
509 {
510 return false;
511 }
512
513 return true;
514 }

References $ilDB, and $res.

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

+ Here is the caller graph for this function:

◆ cloneObject()

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

Clone wiki.

Parameters
inttarget ref_id
intcopy id

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

975 {
976 global $ilDB, $ilUser, $ilias;
977
978 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
979
980 //copy online status if object is not the root copy object
981 $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
982
983 if(!$cp_options->isRootNode($this->getRefId()))
984 {
985 $new_obj->setOnline($this->getOnline());
986 }
987
988 //$new_obj->setTitle($this->getTitle()); // see #20074
989 $new_obj->setStartPage($this->getStartPage());
990 $new_obj->setShortTitle($this->getShortTitle());
991 $new_obj->setRatingOverall($this->getRatingOverall());
992 $new_obj->setRating($this->getRating());
993 $new_obj->setRatingAsBlock($this->getRatingAsBlock());
994 $new_obj->setRatingForNewPages($this->getRatingForNewPages());
995 $new_obj->setRatingCategories($this->getRatingCategories());
996 $new_obj->setPublicNotes($this->getPublicNotes());
997 $new_obj->setIntroduction($this->getIntroduction());
998 $new_obj->setImportantPages($this->getImportantPages());
999 $new_obj->setPageToc($this->getPageToc());
1000 $new_obj->update();
1001
1002 // set/copy stylesheet
1003 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1004 $style_id = $this->getStyleSheetId();
1005 if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
1006 {
1007 $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
1008 $new_id = $style_obj->ilClone();
1009 $new_obj->setStyleSheetId($new_id);
1010 $new_obj->update();
1011 }
1012
1013 // copy content
1014 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1015 $pages = ilWikiPage::getAllPages($this->getId());
1016 if (count($pages) > 0)
1017 {
1018 // if we have any pages, delete the start page first
1019 $pg_id = ilWikiPage::getPageIdForTitle($new_obj->getId(), $new_obj->getStartPage());
1020 $start_page = new ilWikiPage($pg_id);
1021 $start_page->delete();
1022 }
1023 $map = array();
1024 foreach ($pages as $p)
1025 {
1026 $page = new ilWikiPage($p["id"]);
1027 $new_page = new ilWikiPage();
1028 $new_page->setTitle($page->getTitle());
1029 $new_page->setWikiId($new_obj->getId());
1030 $new_page->setTitle($page->getTitle());
1031 $new_page->setBlocked($page->getBlocked());
1032 $new_page->setRating($page->getRating());
1033 $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
1034 $new_page->create();
1035
1036 $page->copy($new_page->getId(), "", 0, true);
1037 //$new_page->setXMLContent($page->copyXMLContent(true));
1038 //$new_page->buildDom(true);
1039 //$new_page->update();
1040 $map[$p["id"]] = $new_page->getId();
1041 }
1042
1043 // copy important pages
1044 foreach (ilObjWiki::_lookupImportantPagesList($this->getId()) as $ip)
1045 {
1046 $new_obj->addImportantPage($map[$ip["page_id"]], $ip["ord"], $ip["indent"]);
1047 }
1048
1049 // copy rating categories
1050 include_once("./Services/Rating/classes/class.ilRatingCategory.php");
1051 foreach (ilRatingCategory::getAllForObject($this->getId()) as $rc)
1052 {
1053 $new_rc = new ilRatingCategory();
1054 $new_rc->setParentId($new_obj->getId());
1055 $new_rc->setTitle($rc["title"]);
1056 $new_rc->setDescription($rc["description"]);
1057 $new_rc->save();
1058 }
1059
1060 return $new_obj;
1061 }
static _getInstance($a_copy_id)
Get instance of copy wizard options.
_lookupStandard($a_id)
Lookup standard flag.
getRating()
Get Enable Rating.
getRatingAsBlock()
Get Enable Rating Side Block.
getStartPage()
Get Start Page.
getPublicNotes()
Get public notes.
getShortTitle()
Get ShortTitle.
getOnline()
Get Online.
getIntroduction()
Get Introduction.
getStyleSheetId()
get ID of assigned style sheet object
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
getRatingOverall()
Get Enable Rating For Object.
getRatingForNewPages()
Get Enable Rating For New Pages.
getImportantPages()
Get important pages.
getPageToc()
Get page toc.
getRatingCategories()
Get Enable Rating Categories.
Class ilRatingCategory.
static getAllForObject($a_parent_obj_id)
Get all categories for object.
Class ilWikiPage.
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
static getAllPages($a_wiki_id)
Get all pages of wiki
global $ilUser
Definition: imgupload.php:15

References $ilDB, ilObject\$ilias, $ilUser, ilCopyWizardOptions\_getInstance(), _lookupImportantPagesList(), ilObjStyleSheet\_lookupStandard(), ilRatingCategory\getAllForObject(), ilWikiPage\getAllPages(), ilObject\getId(), getImportantPages(), getIntroduction(), getOnline(), ilWikiPage\getPageIdForTitle(), getPageToc(), getPublicNotes(), getRating(), getRatingAsBlock(), getRatingCategories(), getRatingForNewPages(), getRatingOverall(), getShortTitle(), getStartPage(), and getStyleSheetId().

+ Here is the call graph for this function:

◆ create()

ilObjWiki::create (   $a_prevent_start_page_creation = false)

Create new wiki.

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

349 {
350 global $ilDB;
351
352 parent::create();
353
354 $ilDB->insert("il_wiki_data", array(
355 "id" => array("integer", $this->getId()),
356 "is_online" => array("integer", (int) $this->getOnline()),
357 "startpage" => array("text", $this->getStartPage()),
358 "short" => array("text", $this->getShortTitle()),
359 "rating" => array("integer", (int) $this->getRating()),
360 "public_notes" => array("integer", (int) $this->getPublicNotes()),
361 "introduction" => array("clob", $this->getIntroduction()),
362 "empty_page_templ" => array("integer", (int) $this->getEmptyPageTemplate()),
363 ));
364
365 // create start page
366 if ($this->getStartPage() != "" && !$a_prevent_start_page_creation)
367 {
368 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
369 $start_page = new ilWikiPage();
370 $start_page->setWikiId($this->getId());
371 $start_page->setTitle($this->getStartPage());
372 $start_page->create();
373 }
374
375 if (((int) $this->getStyleSheetId()) > 0)
376 {
377 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
379 }
380 }
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getEmptyPageTemplate()
Get empty page template.

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

+ 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 1090 of file class.ilObjWiki.php.

1091 {
1092 // check if template has to be used
1093 if ($a_template_page == 0)
1094 {
1095 if (!$this->getEmptyPageTemplate())
1096 {
1097 include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1098 $wt = new ilWikiPageTemplate($this->getId());
1099 $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1100 if (count($ts) == 1)
1101 {
1102 $t = current($ts);
1103 $a_template_page = $t["wpage_id"];
1104 }
1105 }
1106 }
1107
1108 // create the page
1109 $page = new ilWikiPage();
1110 $page->setWikiId($this->getId());
1111 $page->setTitle(ilWikiUtil::makeDbTitle($a_page_title));
1112 if($this->getRating() && $this->getRatingForNewPages())
1113 {
1114 $page->setRating(true);
1115 }
1116
1117 // needed for notification
1118 $page->setWikiRefId($this->getRefId());
1119 $page->create();
1120
1121 // copy template into new page
1122 if ($a_template_page > 0)
1123 {
1124 $orig = new ilWikiPage($a_template_page);
1125 $orig->copy($page->getId());
1126
1127 // #15718
1128 include_once "Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php";
1130 $this->getId(),
1131 $this->getId(),
1132 "wpg",
1133 $a_template_page,
1134 $page->getId()
1135 );
1136 }
1137
1138 return $page;
1139 }
static _cloneValues($a_source_id, $a_target_id, $a_sub_type=null, $a_source_sub_id=null, $a_target_sub_id=null)
Clone Advanced Meta Data.
getRefId()
get reference id @access public
static makeDbTitle($a_par)
Handle page GET parameter.

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

+ 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 1220 of file class.ilObjWiki.php.

1221 {
1222 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1223 if (ilWikiPage::_wikiPageExists($this->getId(), $a_value))
1224 {
1225 $url = ilObjWikiGUI::getGotoLink($this->getRefId(), $a_value);
1226 return "<a href='".$url."'>".$a_value."</a>";
1227 }
1228
1229 return $a_value;
1230 }
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
static _wikiPageExists($a_wiki_id, $a_title)
Check whether page exists for wiki or not
$url
Definition: shib_logout.php:72

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

+ Here is the call graph for this function:

◆ delete()

ilObjWiki::delete ( )

delete object and all related data

@access public

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

Reimplemented from ilObject.

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

475 {
476 global $ilDB;
477
478 // always call parent delete function first!!
479 if (!parent::delete())
480 {
481 return false;
482 }
483
484 // delete record of table il_wiki_data
485 $query = "DELETE FROM il_wiki_data".
486 " WHERE id = ".$ilDB->quote($this->getId(), "integer");
487 $ilDB->manipulate($query);
488
489 // remove all notifications
490 include_once "./Services/Notification/classes/class.ilNotification.php";
492
493 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
495
496 return true;
497 }
static removeForObject($type, $id)
Remove all notifications for given object.
static deleteAllPagesOfWiki($a_wiki_id)
delete wiki page and al related data

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

+ Here is the call graph for this function:

◆ deliverUserHTMLExport()

ilObjWiki::deliverUserHTMLExport ( )

Send user html export file.

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

1204 {
1205 global $ilDB, $ilUser;
1206
1207 include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1208
1209 $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser);
1210 return $user_export->deliverFile();
1211 }
Class manages user html export.

References $ilDB, and $ilUser.

◆ fixImportantPagesNumbering()

ilObjWiki::fixImportantPagesNumbering ( )

Fix important pages numbering.

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

920 {
921 global $ilDB;
922
924
925 // fix indentation: no 2 is allowed after a 0
926 $c_indent = 0;
927 $fixed = false;
928 foreach ($ipages as $k => $v)
929 {
930 if ($ipages[$k]["indent"] == 2 && $c_indent == 0)
931 {
932 $ipages[$k]["indent"] = 1;
933 $fixed = true;
934 }
935 $c_indent = $ipages[$k]["indent"];
936 }
937
938 $ord = 10;
939 foreach ($ipages as $k => $v)
940 {
941 $ilDB->manipulate($q = "UPDATE il_wiki_imp_pages SET ".
942 " ord = ".$ilDB->quote($ord, "integer").
943 ", indent = ".$ilDB->quote($v["indent"], "integer").
944 " WHERE wiki_id = ".$ilDB->quote($v["wiki_id"], "integer").
945 " AND page_id = ".$ilDB->quote($v["page_id"], "integer")
946 );
947 $ord+=10;
948 }
949
950 }

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

Referenced by removeImportantPage().

+ 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 1141 of file class.ilObjWiki.php.

1142 {
1143 global $lng;
1144
1145 if($a_sub_type == "wpg")
1146 {
1147 $lng->loadLanguageModule("wiki");
1148 include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
1149 return $lng->txt("wiki_wpg").' "'.ilWikiPage::lookupTitle($a_sub_id).'"';
1150 }
1151 }
static lookupTitle($a_page_id)
Checks whether a page with given title exists.

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

+ Here is the call graph for this function:

◆ getEmptyPageTemplate()

ilObjWiki::getEmptyPageTemplate ( )

Get empty page template.

Returns
boolean empty page template

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

307 {
309 }

References $empty_page_templ.

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

+ Here is the caller graph for this function:

◆ getImportantPages()

ilObjWiki::getImportantPages ( )

Get important pages.

Returns
boolean important pages

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

191 {
192 return $this->imp_pages;
193 }

Referenced by cloneObject(), and update().

+ Here is the caller graph for this function:

◆ getIntroduction()

ilObjWiki::getIntroduction ( )

Get Introduction.

Returns
string Introduction

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

251 {
252 return $this->introduction;
253 }

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

+ Here is the caller graph for this function:

◆ getLinkMetadataValues()

ilObjWiki::getLinkMetadataValues ( )

Get link md values.

Returns
bool link metadata values

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

327 {
329 }

References $link_md_values.

Referenced by update().

+ Here is the caller graph for this function:

◆ getOnline()

ilObjWiki::getOnline ( )

Get Online.

Returns
boolean Online

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

55 {
56 return $this->online;
57 }

References $online.

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

+ Here is the caller graph for this function:

◆ getPageToc()

ilObjWiki::getPageToc ( )

Get page toc.

Returns
boolean page toc

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

287 {
288 return $this->page_toc;
289 }

Referenced by cloneObject(), and update().

+ Here is the caller graph for this function:

◆ getPublicNotes()

ilObjWiki::getPublicNotes ( )

Get public notes.

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

171 {
172 return $this->public_notes;
173 }

References $public_notes.

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

+ Here is the caller graph for this function:

◆ getRating()

ilObjWiki::getRating ( )

Get Enable Rating.

Returns
boolean Enable Rating

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

95 {
96 return $this->rating;
97 }

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

+ Here is the caller graph for this function:

◆ getRatingAsBlock()

ilObjWiki::getRatingAsBlock ( )

Get Enable Rating Side Block.

Returns
boolean

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

115 {
116 return $this->rating_block;
117 }

Referenced by cloneObject(), and update().

+ Here is the caller graph for this function:

◆ getRatingCategories()

ilObjWiki::getRatingCategories ( )

Get Enable Rating Categories.

Returns
boolean

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

155 {
156 return $this->rating_categories;
157 }

Referenced by cloneObject(), and update().

+ Here is the caller graph for this function:

◆ getRatingForNewPages()

ilObjWiki::getRatingForNewPages ( )

Get Enable Rating For New Pages.

Returns
boolean

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

135 {
136 return $this->rating_new_pages;
137 }

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

+ Here is the caller graph for this function:

◆ getRatingOverall()

ilObjWiki::getRatingOverall ( )

Get Enable Rating For Object.

Returns
boolean Enable Rating

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

75 {
76 return $this->rating_overall;
77 }

Referenced by cloneObject(), and update().

+ Here is the caller graph for this function:

◆ getShortTitle()

ilObjWiki::getShortTitle ( )

Get ShortTitle.

Returns
string ShortTitle

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

231 {
232 return $this->shorttitle;
233 }

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

+ Here is the caller graph for this function:

◆ getStartPage()

ilObjWiki::getStartPage ( )

Get Start Page.

Returns
string Start Page

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

211 {
212 return $this->startpage;
213 }

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

+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjWiki::getStyleSheetId ( )

get ID of assigned style sheet object

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

259 {
260 return $this->style_id;
261 }

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

+ 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 1069 of file class.ilObjWiki.php.

1070 {
1071 $num = (int) $this->getEmptyPageTemplate();
1072 include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1073 $wt = new ilWikiPageTemplate($this->getId());
1074 $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1075 $num += count($ts);
1076 if ($num > 1)
1077 {
1078 return true;
1079 }
1080 return false;
1081 }

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

+ Here is the call graph for this function:

◆ getUserHTMLExportProgress()

ilObjWiki::getUserHTMLExportProgress ( )

Get user html export progress.

Returns
array progress info

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

1191 {
1192 global $ilDB, $ilUser;
1193
1194 include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1195
1196 $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser);
1197 return $user_export->getProgress();
1198 }

References $ilDB, and $ilUser.

◆ ilObjWiki()

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

Constructor @access public.

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

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

34 {
35 $this->type = "wiki";
36 $this->ilObject($a_id,$a_call_by_reference);
37 }
ilObject($a_id=0, $a_reference=true)
Constructor @access public.

References ilObject\ilObject().

+ Here is the call graph for this function:

◆ initUserHTMLExport()

ilObjWiki::initUserHTMLExport ( )

Init user html export.

Parameters

return

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

1160 {
1161 global $ilDB, $ilUser;
1162
1163 include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1164
1165 $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser);
1166 $user_export->initUserHTMLExport();
1167 }

References $ilDB, and $ilUser.

◆ isImportantPage()

ilObjWiki::isImportantPage (   $a_page_id)

Is page an important page?

Parameters

return

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

831 {
832 global $ilDB;
833
834 $set = $ilDB->query("SELECT * FROM il_wiki_imp_pages WHERE ".
835 " wiki_id = ".$ilDB->quote($this->getId(), "integer")." AND ".
836 " page_id = ".$ilDB->quote($a_page_id, "integer")
837 );
838 if ($rec = $ilDB->fetchAssoc($set))
839 {
840 return true;
841 }
842 return false;
843 }

References $ilDB.

Referenced by addImportantPage().

+ 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 336 of file class.ilObjWiki.php.

337 {
338 if ($a_ref_id > 0 && $a_ref_id == OH_REF_ID)
339 {
340// return true;
341 }
342 return false;
343 }

Referenced by ilObjWikiGUI\isOnlineHelpWiki().

+ Here is the caller graph for this function:

◆ notify()

ilObjWiki::notify (   $a_event,
  $a_ref_id,
  $a_parent_non_rbac_id,
  $a_node_id,
  $a_params = 0 
)

notifys an object about an event occured Based on the event happend, each object may decide how it reacts.

If you are not required to handle any events related to your module, just delete this method. (For an example how this method is used, look at ilObjGroup)

@access public

Parameters
stringevent
integerreference id of object where the event occured
arraypasses optional parameters if required
Returns
boolean

Reimplemented from ilObject.

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

531 {
532 global $tree;
533
534 switch ($a_event)
535 {
536 case "link":
537
538 //var_dump("<pre>",$a_params,"</pre>");
539 //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
540 //exit;
541 break;
542
543 case "cut":
544
545 //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
546 //exit;
547 break;
548
549 case "copy":
550
551 //var_dump("<pre>",$a_params,"</pre>");
552 //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
553 //exit;
554 break;
555
556 case "paste":
557
558 //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
559 //exit;
560 break;
561
562 case "new":
563
564 //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
565 //exit;
566 break;
567 }
568
569 // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
570 if ($a_node_id==$_GET["ref_id"])
571 {
572 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
573 $parent_type = $parent_obj->getType();
574 if($parent_type == $this->getType())
575 {
576 $a_node_id = (int) $tree->getParentId($a_node_id);
577 }
578 }
579
580 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
581 }
$_GET["client_id"]
getType()
get object type @access public
redirection script todo: (a better solution should control the processing via a xml file)

References $_GET, and ilObject\getType().

+ Here is the call graph for this function:

◆ read()

ilObjWiki::read ( )

Read wiki data.

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

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

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

+ Here is the call graph for this function:

◆ removeImportantPage()

ilObjWiki::removeImportantPage (   $a_id)

Remove important page.

Parameters
intpage id

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

851 {
852 global $ilDB;
853
854 $ilDB->manipulate("DELETE FROM il_wiki_imp_pages WHERE "
855 ." wiki_id = ".$ilDB->quote($this->getId(), "integer")
856 ." AND page_id = ".$ilDB->quote($a_id, "integer")
857 );
858
860 }
fixImportantPagesNumbering()
Fix important pages numbering.

References $ilDB, and fixImportantPagesNumbering().

+ Here is the call graph for this function:

◆ saveOrderingAndIndentation()

ilObjWiki::saveOrderingAndIndentation (   $a_ord,
  $a_indent 
)

Save ordering and indentation.

Parameters

return

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

869 {
870 global $ilDB;
871
873
874 foreach ($ipages as $k => $v)
875 {
876 if (isset($a_ord[$v["page_id"]]))
877 {
878 $ipages[$k]["ord"] = (int) $a_ord[$v["page_id"]];
879 }
880 if (isset($a_indent[$v["page_id"]]))
881 {
882 $ipages[$k]["indent"] = (int) $a_indent[$v["page_id"]];
883 }
884 }
885 $ipages = ilUtil::sortArray($ipages, "ord", "asc", true);
886
887 // fix indentation: no 2 is allowed after a 0
888 $c_indent = 0;
889 $fixed = false;
890 foreach ($ipages as $k => $v)
891 {
892 if ($ipages[$k]["indent"] == 2 && $c_indent == 0)
893 {
894 $ipages[$k]["indent"] = 1;
895 $fixed = true;
896 }
897 $c_indent = $ipages[$k]["indent"];
898 }
899
900 $ord = 10;
901 reset($ipages);
902 foreach ($ipages as $k => $v)
903 {
904 $ilDB->manipulate($q = "UPDATE il_wiki_imp_pages SET ".
905 " ord = ".$ilDB->quote($ord, "integer").",".
906 " indent = ".$ilDB->quote($v["indent"], "integer").
907 " WHERE wiki_id = ".$ilDB->quote($v["wiki_id"], "integer").
908 " AND page_id = ".$ilDB->quote($v["page_id"], "integer")
909 );
910 $ord+=10;
911 }
912
913 return $fixed;
914 }
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray

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

+ 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 296 of file class.ilObjWiki.php.

297 {
298 $this->empty_page_templ = $a_val;
299 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setImportantPages()

ilObjWiki::setImportantPages (   $a_val)

Set important pages.

Parameters
boolean$a_valimportant pages

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

181 {
182 $this->imp_pages = $a_val;
183 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setIntroduction()

ilObjWiki::setIntroduction (   $a_introduction)

Set Introduction.

Parameters
string$a_introductionIntroduction

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

241 {
242 $this->introduction = $a_introduction;
243 }

Referenced by read().

+ 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 316 of file class.ilObjWiki.php.

317 {
318 $this->link_md_values = $a_val;
319 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setOnline()

ilObjWiki::setOnline (   $a_online)

Set Online.

Parameters
boolean$a_onlineOnline

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

45 {
46 $this->online = $a_online;
47 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPageToc()

ilObjWiki::setPageToc (   $a_val)

Set page toc.

Parameters
boolean$a_valpage toc

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

277 {
278 $this->page_toc = $a_val;
279 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjWiki::setPublicNotes (   $a_val)

Set public notes.

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

163 {
164 $this->public_notes = $a_val;
165 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRating()

ilObjWiki::setRating (   $a_rating)

Set Enable Rating.

Parameters
boolean$a_ratingEnable Rating

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

85 {
86 $this->rating = (bool)$a_rating;
87 }

Referenced by read().

+ 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 104 of file class.ilObjWiki.php.

105 {
106 $this->rating_block = (bool)$a_rating;
107 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRatingCategories()

ilObjWiki::setRatingCategories (   $a_rating)

Set Enable Rating Categories.

Parameters
boolean$a_rating

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

145 {
146 $this->rating_categories = (bool)$a_rating;
147 }

Referenced by read().

+ 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 124 of file class.ilObjWiki.php.

125 {
126 $this->rating_new_pages = (bool)$a_rating;
127 }

Referenced by read().

+ 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 64 of file class.ilObjWiki.php.

65 {
66 $this->rating_overall = (bool)$a_rating;
67 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setShortTitle()

ilObjWiki::setShortTitle (   $a_shorttitle)

Set ShortTitle.

Parameters
string$a_shorttitleShortTitle

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

221 {
222 $this->shorttitle = $a_shorttitle;
223 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setStartPage()

ilObjWiki::setStartPage (   $a_startpage)

Set Start Page.

Parameters
string$a_startpageStart Page

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

201 {
202 $this->startpage = ilWikiUtil::makeDbTitle($a_startpage);
203 }

References ilWikiUtil\makeDbTitle().

Referenced by read().

+ 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 266 of file class.ilObjWiki.php.

267 {
268 $this->style_id = $a_style_id;
269 }

Referenced by read().

+ Here is the caller graph for this function:

◆ startUserHTMLExport()

ilObjWiki::startUserHTMLExport ( )

Start user html export.

Parameters

return

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

1176 {
1177 global $ilDB, $ilUser;
1178
1179 include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1180
1181 $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser);
1182 $user_export->startUserHTMLExport();
1183 }

References $ilDB, and $ilUser.

◆ update()

ilObjWiki::update (   $a_prevent_start_page_creation = false)

update object data

@access public

Returns
boolean

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

389 {
390 global $ilDB;
391
392 if (!parent::update())
393 {
394 return false;
395 }
396
397 $ilDB->update("il_wiki_data", array(
398 "is_online" => array("integer", $this->getOnline()),
399 "startpage" => array("text", $this->getStartPage()),
400 "short" => array("text", $this->getShortTitle()),
401 "rating_overall" => array("integer", $this->getRatingOverall()),
402 "rating" => array("integer", $this->getRating()),
403 "rating_side" => array("integer", (bool)$this->getRatingAsBlock()), // #13455
404 "rating_new" => array("integer", $this->getRatingForNewPages()),
405 "rating_ext" => array("integer", $this->getRatingCategories()),
406 "public_notes" => array("integer", $this->getPublicNotes()),
407 "introduction" => array("clob", $this->getIntroduction()),
408 "imp_pages" => array("integer", $this->getImportantPages()),
409 "page_toc" => array("integer", $this->getPageToc()),
410 "link_md_values" => array("integer", $this->getLinkMetadataValues()),
411 "empty_page_templ" => array("integer", $this->getEmptyPageTemplate())
412 ), array(
413 "id" => array("integer", $this->getId())
414 ));
415
416 // check whether start page exists
417 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
418 if (!ilWikiPage::exists($this->getId(), $this->getStartPage())
419 && !$a_prevent_start_page_creation)
420 {
421 $start_page = new ilWikiPage();
422 $start_page->setWikiId($this->getId());
423 $start_page->setTitle($this->getStartPage());
424 $start_page->create();
425 }
426
427 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
429
430 return true;
431 }
getLinkMetadataValues()
Get link md values.
static exists($a_wiki_id, $a_title)
Checks whether a page with given title exists.

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

+ Here is the call graph for this function:

◆ writeStartPage()

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

Write start page.

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

690 {
691 global $ilDB;
692
693 include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
694 $ilDB->manipulate("UPDATE il_wiki_data SET ".
695 " startpage = ".$ilDB->quote(ilWikiUtil::makeDbTitle($a_name), "text").
696 " WHERE id = ".$ilDB->quote($a_id, "integer")
697 );
698 }

References $ilDB, and ilWikiUtil\makeDbTitle().

Referenced by ilWikiPage\rename().

+ 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 24 of file class.ilObjWiki.php.

Referenced by getEmptyPageTemplate().

◆ $link_md_values

ilObjWiki::$link_md_values = false
protected

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

Referenced by getLinkMetadataValues().

◆ $online

ilObjWiki::$online = false
protected

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

Referenced by getOnline().

◆ $public_notes

ilObjWiki::$public_notes = true
protected

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

Referenced by getPublicNotes().


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