ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 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...
 
- 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...
 

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 _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 _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 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
 

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

629 {
630 global $ilDB;
631
632 $query = "SELECT $a_field FROM il_wiki_data WHERE id = ".
633 $ilDB->quote($a_wiki_id, "integer");
634 $set = $ilDB->query($query);
635 $rec = $ilDB->fetchAssoc($set);
636 return $rec[$a_field];
637 }
global $ilDB

References $ilDB, and $query.

Referenced by _lookupImportantPages(), _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 716 of file class.ilObjWiki.php.

717 {
718 return ilObjWiki::_lookup($a_wiki_id, "imp_pages");
719 }
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 727 of file class.ilObjWiki.php.

728 {
729 global $ilDB;
730
731 $set = $ilDB->query("SELECT * FROM il_wiki_imp_pages WHERE ".
732 " wiki_id = ".$ilDB->quote($a_wiki_id, "integer")." ORDER BY ord ASC "
733 );
734
735 $imp_pages = array();
736
737 while ($rec = $ilDB->fetchAssoc($set))
738 {
739 $imp_pages[] = $rec;
740 }
741 return $imp_pages;
742 }

References $ilDB.

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

+ Here is the caller graph for this function:

◆ _lookupMaxOrdNrImportantPages()

static ilObjWiki::_lookupMaxOrdNrImportantPages (   $a_wiki_id)
static

Get important pages list.

Parameters

return

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

751 {
752 global $ilDB;
753
754 $set = $ilDB->query("SELECT MAX(ord) as m FROM il_wiki_imp_pages WHERE ".
755 " wiki_id = ".$ilDB->quote($a_wiki_id, "integer")
756 );
757
758 $rec = $ilDB->fetchAssoc($set);
759 return (int) $rec["m"];
760 }

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

929 {
930 return ilObjWiki::_lookup($a_wiki_id, "page_toc");
931 }

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

616 {
617 return ilObjWiki::_lookup($a_wiki_id, "public_notes");
618 }

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

580 {
581 return ilObjWiki::_lookup($a_wiki_id, "rating");
582 }

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

604 {
605 return ilObjWiki::_lookup($a_wiki_id, "rating_side");
606 }

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

592 {
593 return ilObjWiki::_lookup($a_wiki_id, "rating_ext");
594 }

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

568 {
569 return ilObjWiki::_lookup($a_wiki_id, "rating_overall");
570 }

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

647 {
648 return ilObjWiki::_lookup($a_wiki_id, "startpage");
649 }

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

669 {
670 // query parser
671 include_once 'Services/Search/classes/class.ilQueryParser.php';
672
673 $query_parser = new ilQueryParser($a_searchterm);
674 $query_parser->setCombination("or");
675 $query_parser->parse();
676
677 include_once 'Services/Search/classes/class.ilSearchResult.php';
678 $search_result = new ilSearchResult();
679 if($query_parser->validate())
680 {
681
682 include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
683 $wiki_search =& ilObjectSearchFactory::_getWikiContentSearchInstance($query_parser);
684 $wiki_search->setFilter(array('wpg'));
685 $search_result->mergeEntries($wiki_search->performSearch());
686 }
687
688 $entries = $search_result->getEntries();
689
690 $found_pages = array();
691 foreach($entries as $entry)
692 {
693 if ($entry["obj_id"] == $a_wiki_id && is_array($entry["child"]))
694 {
695 foreach($entry["child"] as $child)
696 {
697 $found_pages[] = array("page_id" => $child);
698 }
699 }
700 }
701
702 return $found_pages;
703 }
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 768 of file class.ilObjWiki.php.

769 {
770 global $ilDB;
771
772 if (!$this->isImportantPage($a_page_id))
773 {
774 if ($a_nr == 0)
775 {
776 $a_nr = ilObjWiki::_lookupMaxOrdNrImportantPages($this->getId()) + 10;
777 }
778
779 $ilDB->manipulate("INSERT INTO il_wiki_imp_pages ".
780 "(wiki_id, ord, indent, page_id) VALUES (".
781 $ilDB->quote($this->getId(), "integer").",".
782 $ilDB->quote($a_nr, "integer").",".
783 $ilDB->quote($a_indent, "integer").",".
784 $ilDB->quote($a_page_id, "integer").
785 ")");
786 }
787 }
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 479 of file class.ilObjWiki.php.

480 {
481 global $ilDB;
482
483 $res = $ilDB->queryF("SELECT id FROM il_wiki_data WHERE short = %s",
484 array("text"), array($a_short_title));
485 if ($ilDB->fetchAssoc($res))
486 {
487 return false;
488 }
489
490 return true;
491 }

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

940 {
941 global $ilDB, $ilUser, $ilias;
942
943 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
944
945 //copy online status if object is not the root copy object
946 $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
947
948 if(!$cp_options->isRootNode($this->getRefId()))
949 {
950 $new_obj->setOnline($this->getOnline());
951 }
952
953 $new_obj->setTitle($this->getTitle());
954 $new_obj->setStartPage($this->getStartPage());
955 $new_obj->setShortTitle($this->getShortTitle());
956 $new_obj->setRatingOverall($this->getRatingOverall());
957 $new_obj->setRating($this->getRating());
958 $new_obj->setRatingAsBlock($this->getRatingAsBlock());
959 $new_obj->setRatingForNewPages($this->getRatingForNewPages());
960 $new_obj->setRatingCategories($this->getRatingCategories());
961 $new_obj->setPublicNotes($this->getPublicNotes());
962 $new_obj->setIntroduction($this->getIntroduction());
963 $new_obj->setImportantPages($this->getImportantPages());
964 $new_obj->setPageToc($this->getPageToc());
965 $new_obj->update();
966
967 // set/copy stylesheet
968 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
969 $style_id = $this->getStyleSheetId();
970 if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
971 {
972 $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
973 $new_id = $style_obj->ilClone();
974 $new_obj->setStyleSheetId($new_id);
975 $new_obj->update();
976 }
977
978 // copy content
979 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
980 $pages = ilWikiPage::getAllPages($this->getId());
981 if (count($pages) > 0)
982 {
983 // if we have any pages, delete the start page first
984 $pg_id = ilWikiPage::getPageIdForTitle($new_obj->getId(), $new_obj->getStartPage());
985 $start_page = new ilWikiPage($pg_id);
986 $start_page->delete();
987 }
988 $map = array();
989 foreach ($pages as $p)
990 {
991 $page = new ilWikiPage($p["id"]);
992 $new_page = new ilWikiPage();
993 $new_page->setTitle($page->getTitle());
994 $new_page->setWikiId($new_obj->getId());
995 $new_page->setTitle($page->getTitle());
996 $new_page->setBlocked($page->getBlocked());
997 $new_page->setRating($page->getRating());
998 $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
999 $new_page->create();
1000
1001 $page->copy($new_page->getId(), "", 0, true);
1002 //$new_page->setXMLContent($page->copyXMLContent(true));
1003 //$new_page->buildDom(true);
1004 //$new_page->update();
1005 $map[$p["id"]] = $new_page->getId();
1006 }
1007
1008 // copy important pages
1009 foreach (ilObjWiki::_lookupImportantPagesList($this->getId()) as $ip)
1010 {
1011 $new_obj->addImportantPage($map[$ip["page_id"]], $ip["ord"], $ip["indent"]);
1012 }
1013
1014 // copy rating categories
1015 include_once("./Services/Rating/classes/class.ilRatingCategory.php");
1016 foreach (ilRatingCategory::getAllForObject($this->getId()) as $rc)
1017 {
1018 $new_rc = new ilRatingCategory();
1019 $new_rc->setParentId($new_obj->getId());
1020 $new_rc->setTitle($rc["title"]);
1021 $new_rc->setDescription($rc["description"]);
1022 $new_rc->save();
1023 }
1024
1025 return $new_obj;
1026 }
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.
getTitle()
get object title @access public
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(), getStyleSheetId(), and ilObject\getTitle().

+ Here is the call graph for this function:

◆ create()

ilObjWiki::create (   $a_prevent_start_page_creation = false)

Create new wiki.

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

328 {
329 global $ilDB;
330
331 parent::create();
332
333 $ilDB->insert("il_wiki_data", array(
334 "id" => array("integer", $this->getId()),
335 "is_online" => array("integer", (int) $this->getOnline()),
336 "startpage" => array("text", $this->getStartPage()),
337 "short" => array("text", $this->getShortTitle()),
338 "rating" => array("integer", (int) $this->getRating()),
339 "public_notes" => array("integer", (int) $this->getPublicNotes()),
340 "introduction" => array("clob", $this->getIntroduction()),
341 "empty_page_templ" => array("integer", (int) $this->getEmptyPageTemplate()),
342 ));
343
344 // create start page
345 if ($this->getStartPage() != "" && !$a_prevent_start_page_creation)
346 {
347 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
348 $start_page = new ilWikiPage();
349 $start_page->setWikiId($this->getId());
350 $start_page->setTitle($this->getStartPage());
351 $start_page->create();
352 }
353
354 if (((int) $this->getStyleSheetId()) > 0)
355 {
356 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
358 }
359 }
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 1055 of file class.ilObjWiki.php.

1056 {
1057 // check if template has to be used
1058 if ($a_template_page == 0)
1059 {
1060 if (!$this->getEmptyPageTemplate())
1061 {
1062 include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1063 $wt = new ilWikiPageTemplate($this->getId());
1064 $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1065 if (count($ts) == 1)
1066 {
1067 $t = current($ts);
1068 $a_template_page = $t["wpage_id"];
1069 }
1070 }
1071 }
1072
1073 // create the page
1074 $page = new ilWikiPage();
1075 $page->setWikiId($this->getId());
1076 $page->setTitle(ilWikiUtil::makeDbTitle($a_page_title));
1077 if($this->getRating() && $this->getRatingForNewPages())
1078 {
1079 $page->setRating(true);
1080 }
1081
1082 // needed for notification
1083 $page->setWikiRefId($this->getRefId());
1084 $page->create();
1085
1086 // copy template into new page
1087 if ($a_template_page > 0)
1088 {
1089 $orig = new ilWikiPage($a_template_page);
1090 $orig->copy($page->getId());
1091
1092 // #15718
1093 include_once "Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php";
1095 $this->getId(),
1096 $this->getId(),
1097 "wpg",
1098 $a_template_page,
1099 $page->getId()
1100 );
1101 }
1102
1103 return $page;
1104 }
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:

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

452 {
453 global $ilDB;
454
455 // always call parent delete function first!!
456 if (!parent::delete())
457 {
458 return false;
459 }
460
461 // delete record of table il_wiki_data
462 $query = "DELETE FROM il_wiki_data".
463 " WHERE id = ".$ilDB->quote($this->getId(), "integer");
464 $ilDB->manipulate($query);
465
466 // remove all notifications
467 include_once "./Services/Notification/classes/class.ilNotification.php";
469
470 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
472
473 return true;
474 }
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:

◆ fixImportantPagesNumbering()

ilObjWiki::fixImportantPagesNumbering ( )

Fix important pages numbering.

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

885 {
886 global $ilDB;
887
889
890 // fix indentation: no 2 is allowed after a 0
891 $c_indent = 0;
892 $fixed = false;
893 foreach ($ipages as $k => $v)
894 {
895 if ($ipages[$k]["indent"] == 2 && $c_indent == 0)
896 {
897 $ipages[$k]["indent"] = 1;
898 $fixed = true;
899 }
900 $c_indent = $ipages[$k]["indent"];
901 }
902
903 $ord = 10;
904 foreach ($ipages as $k => $v)
905 {
906 $ilDB->manipulate($q = "UPDATE il_wiki_imp_pages SET ".
907 " ord = ".$ilDB->quote($ord, "integer").
908 ", indent = ".$ilDB->quote($v["indent"], "integer").
909 " WHERE wiki_id = ".$ilDB->quote($v["wiki_id"], "integer").
910 " AND page_id = ".$ilDB->quote($v["page_id"], "integer")
911 );
912 $ord+=10;
913 }
914
915 }

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

1107 {
1108 global $lng;
1109
1110 if($a_sub_type == "wpg")
1111 {
1112 $lng->loadLanguageModule("wiki");
1113 include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
1114 return $lng->txt("wiki_wpg").' "'.ilWikiPage::lookupTitle($a_sub_id).'"';
1115 }
1116 }
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 305 of file class.ilObjWiki.php.

306 {
308 }

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

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

Referenced by cloneObject(), and update().

+ Here is the caller graph for this function:

◆ getIntroduction()

ilObjWiki::getIntroduction ( )

Get Introduction.

Returns
string Introduction

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

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

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

+ Here is the caller graph for this function:

◆ getOnline()

ilObjWiki::getOnline ( )

Get Online.

Returns
boolean Online

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

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

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

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

Referenced by cloneObject(), and update().

+ Here is the caller graph for this function:

◆ getPublicNotes()

ilObjWiki::getPublicNotes ( )

Get public notes.

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

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

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

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

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

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

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

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

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

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

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

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

Referenced by cloneObject(), and update().

+ Here is the caller graph for this function:

◆ getShortTitle()

ilObjWiki::getShortTitle ( )

Get ShortTitle.

Returns
string ShortTitle

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

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

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

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

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

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

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

1035 {
1036 $num = (int) $this->getEmptyPageTemplate();
1037 include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1038 $wt = new ilWikiPageTemplate($this->getId());
1039 $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1040 $num += count($ts);
1041 if ($num > 1)
1042 {
1043 return true;
1044 }
1045 return false;
1046 }

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

+ Here is the call graph for this function:

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

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

References ilObject\ilObject().

+ Here is the call graph for this function:

◆ isImportantPage()

ilObjWiki::isImportantPage (   $a_page_id)

Is page an important page?

Parameters

return

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

796 {
797 global $ilDB;
798
799 $set = $ilDB->query("SELECT * FROM il_wiki_imp_pages WHERE ".
800 " wiki_id = ".$ilDB->quote($this->getId(), "integer")." AND ".
801 " page_id = ".$ilDB->quote($a_page_id, "integer")
802 );
803 if ($rec = $ilDB->fetchAssoc($set))
804 {
805 return true;
806 }
807 return false;
808 }

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

316 {
317 if ($a_ref_id > 0 && $a_ref_id == OH_REF_ID)
318 {
319// return true;
320 }
321 return false;
322 }

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

508 {
509 global $tree;
510
511 switch ($a_event)
512 {
513 case "link":
514
515 //var_dump("<pre>",$a_params,"</pre>");
516 //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
517 //exit;
518 break;
519
520 case "cut":
521
522 //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
523 //exit;
524 break;
525
526 case "copy":
527
528 //var_dump("<pre>",$a_params,"</pre>");
529 //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
530 //exit;
531 break;
532
533 case "paste":
534
535 //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
536 //exit;
537 break;
538
539 case "new":
540
541 //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
542 //exit;
543 break;
544 }
545
546 // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
547 if ($a_node_id==$_GET["ref_id"])
548 {
549 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
550 $parent_type = $parent_obj->getType();
551 if($parent_type == $this->getType())
552 {
553 $a_node_id = (int) $tree->getParentId($a_node_id);
554 }
555 }
556
557 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
558 }
$_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 414 of file class.ilObjWiki.php.

415 {
416 global $ilDB;
417
418 parent::read();
419
420 $query = "SELECT * FROM il_wiki_data WHERE id = ".
421 $ilDB->quote($this->getId(), "integer");
422 $set = $ilDB->query($query);
423 $rec = $ilDB->fetchAssoc($set);
424
425 $this->setOnline($rec["is_online"]);
426 $this->setStartPage($rec["startpage"]);
427 $this->setShortTitle($rec["short"]);
428 $this->setRatingOverall($rec["rating_overall"]);
429 $this->setRating($rec["rating"]);
430 $this->setRatingAsBlock($rec["rating_side"]);
431 $this->setRatingForNewPages($rec["rating_new"]);
432 $this->setRatingCategories($rec["rating_ext"]);
433 $this->setPublicNotes($rec["public_notes"]);
434 $this->setIntroduction($rec["introduction"]);
435 $this->setImportantPages($rec["imp_pages"]);
436 $this->setPageToc($rec["page_toc"]);
437 $this->setEmptyPageTemplate($rec["empty_page_templ"]);
438
439 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
441
442 }
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.
setRating($a_rating)
Set Enable Rating.
setPublicNotes($a_val)
Set public notes.

References $ilDB, $query, ilObject\getId(), ilObjStyleSheet\lookupObjectStyle(), setEmptyPageTemplate(), setImportantPages(), setIntroduction(), 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 815 of file class.ilObjWiki.php.

816 {
817 global $ilDB;
818
819 $ilDB->manipulate("DELETE FROM il_wiki_imp_pages WHERE "
820 ." wiki_id = ".$ilDB->quote($this->getId(), "integer")
821 ." AND page_id = ".$ilDB->quote($a_id, "integer")
822 );
823
825 }
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 833 of file class.ilObjWiki.php.

834 {
835 global $ilDB;
836
838
839 foreach ($ipages as $k => $v)
840 {
841 if (isset($a_ord[$v["page_id"]]))
842 {
843 $ipages[$k]["ord"] = (int) $a_ord[$v["page_id"]];
844 }
845 if (isset($a_indent[$v["page_id"]]))
846 {
847 $ipages[$k]["indent"] = (int) $a_indent[$v["page_id"]];
848 }
849 }
850 $ipages = ilUtil::sortArray($ipages, "ord", "asc", true);
851
852 // fix indentation: no 2 is allowed after a 0
853 $c_indent = 0;
854 $fixed = false;
855 foreach ($ipages as $k => $v)
856 {
857 if ($ipages[$k]["indent"] == 2 && $c_indent == 0)
858 {
859 $ipages[$k]["indent"] = 1;
860 $fixed = true;
861 }
862 $c_indent = $ipages[$k]["indent"];
863 }
864
865 $ord = 10;
866 reset($ipages);
867 foreach ($ipages as $k => $v)
868 {
869 $ilDB->manipulate($q = "UPDATE il_wiki_imp_pages SET ".
870 " ord = ".$ilDB->quote($ord, "integer").",".
871 " indent = ".$ilDB->quote($v["indent"], "integer").
872 " WHERE wiki_id = ".$ilDB->quote($v["wiki_id"], "integer").
873 " AND page_id = ".$ilDB->quote($v["page_id"], "integer")
874 );
875 $ord+=10;
876 }
877
878 return $fixed;
879 }
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 295 of file class.ilObjWiki.php.

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

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

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

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

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

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

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

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjWiki::setPublicNotes (   $a_val)

Set public notes.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilObjWiki::update (   $a_prevent_start_page_creation = false)

update object data

@access public

Returns
boolean

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

368 {
369 global $ilDB;
370
371 if (!parent::update())
372 {
373 return false;
374 }
375
376 $ilDB->update("il_wiki_data", array(
377 "is_online" => array("integer", $this->getOnline()),
378 "startpage" => array("text", $this->getStartPage()),
379 "short" => array("text", $this->getShortTitle()),
380 "rating_overall" => array("integer", $this->getRatingOverall()),
381 "rating" => array("integer", $this->getRating()),
382 "rating_side" => array("integer", (bool)$this->getRatingAsBlock()), // #13455
383 "rating_new" => array("integer", $this->getRatingForNewPages()),
384 "rating_ext" => array("integer", $this->getRatingCategories()),
385 "public_notes" => array("integer", $this->getPublicNotes()),
386 "introduction" => array("clob", $this->getIntroduction()),
387 "imp_pages" => array("integer", $this->getImportantPages()),
388 "page_toc" => array("integer", $this->getPageToc()),
389 "empty_page_templ" => array("integer", $this->getEmptyPageTemplate())
390 ), array(
391 "id" => array("integer", $this->getId())
392 ));
393
394 // check whether start page exists
395 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
396 if (!ilWikiPage::exists($this->getId(), $this->getStartPage())
397 && !$a_prevent_start_page_creation)
398 {
399 $start_page = new ilWikiPage();
400 $start_page->setWikiId($this->getId());
401 $start_page->setTitle($this->getStartPage());
402 $start_page->create();
403 }
404
405 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
407
408 return true;
409 }
static exists($a_wiki_id, $a_title)
Checks whether a page with given title exists.

References $ilDB, ilWikiPage\exists(), getEmptyPageTemplate(), ilObject\getId(), getImportantPages(), getIntroduction(), 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 654 of file class.ilObjWiki.php.

655 {
656 global $ilDB;
657
658 include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
659 $ilDB->manipulate("UPDATE il_wiki_data SET ".
660 " startpage = ".$ilDB->quote(ilWikiUtil::makeDbTitle($a_name), "text").
661 " WHERE id = ".$ilDB->quote($a_id, "integer")
662 );
663 }

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().

◆ $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: