ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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 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...
 
 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...
 
 initDefaultRoles ()
 init default roles settings 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...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor 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 public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 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 public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 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...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 createRoleFolder ()
 creates a local role folder 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 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 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 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...
 

Protected Attributes

 $online = false
 
 $public_notes = 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 19 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.

References $query.

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

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  }
+ 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.

References _lookup().

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

◆ _lookupImportantPagesList()

static ilObjWiki::_lookupImportantPagesList (   $a_wiki_id)
static

Get important pages list.

Parameters

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

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

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  }
+ Here is the caller graph for this function:

◆ _lookupMaxOrdNrImportantPages()

static ilObjWiki::_lookupMaxOrdNrImportantPages (   $a_wiki_id)
static

Get important pages list.

Parameters

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

Referenced by addImportantPage().

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  }
+ 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.

References _lookup().

Referenced by ilWikiPageConfig\configureByObjectId().

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

◆ _lookupPublicNotes()

static ilObjWiki::_lookupPublicNotes (   $a_wiki_id)
static

Lookup whether public notes are activated.

Parameters
int$a_wiki_idWiki ID
Returns
boolean public notes activated?

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

References _lookup().

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

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

◆ _lookupRating()

static ilObjWiki::_lookupRating (   $a_wiki_id)
static

Lookup whether rating is activated.

Parameters
int$a_wiki_idWiki ID
Returns
boolean Rating activated?

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

References _lookup().

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

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

◆ _lookupRatingAsBlock()

static ilObjWiki::_lookupRatingAsBlock (   $a_wiki_id)
static

Lookup whether rating side block is activated.

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

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

References _lookup().

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

◆ _lookupRatingCategories()

static ilObjWiki::_lookupRatingCategories (   $a_wiki_id)
static

Lookup whether rating categories are activated.

Parameters
int$a_wiki_idWiki ID
Returns
boolean Rating categories activated?

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

References _lookup().

Referenced by ilObjWikiGUI\renderSideBlock().

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

◆ _lookupRatingOverall()

static ilObjWiki::_lookupRatingOverall (   $a_wiki_id)
static

Lookup whether rating is activated for whole object.

Parameters
int$a_wiki_idWiki ID
Returns
boolean Rating activated?

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

References _lookup().

Referenced by ilWikiPageGUI\addHeaderAction().

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

◆ _lookupStartPage()

static ilObjWiki::_lookupStartPage (   $a_wiki_id)
static

Lookup start page.

Parameters
int$a_wiki_idWiki ID
Returns
boolean

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

References _lookup().

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

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

◆ _performSearch()

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

Search in Wiki.

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

References ilObjectSearchFactory\_getWikiContentSearchInstance().

Referenced by ilObjWikiGUI\performSearchObject().

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
+ 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.

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

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?
getId()
get object id public
static _lookupMaxOrdNrImportantPages($a_wiki_id)
Get important pages list.
+ Here is the call graph for this function:

◆ checkShortTitleAvailability()

static ilObjWiki::checkShortTitleAvailability (   $a_short_title)
static

Check availability of short title.

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

References $res.

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

455  {
456  global $ilDB;
457 
458  $res = $ilDB->queryF("SELECT id FROM il_wiki_data WHERE short = %s",
459  array("text"), array($a_short_title));
460  if ($ilDB->fetchAssoc($res))
461  {
462  return false;
463  }
464 
465  return true;
466  }
+ 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.

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

940  {
941  global $ilDB, $ilUser, $ilias;
942 
943  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
944 
945  $new_obj->setTitle($this->getTitle());
946  $new_obj->setStartPage($this->getStartPage());
947  $new_obj->setShortTitle($this->getShortTitle());
948  $new_obj->setRatingOverall($this->getRatingOverall());
949  $new_obj->setRating($this->getRating());
950  $new_obj->setRatingAsBlock($this->getRatingAsBlock());
951  $new_obj->setRatingForNewPages($this->getRatingForNewPages());
952  $new_obj->setRatingCategories($this->getRatingCategories());
953  $new_obj->setPublicNotes($this->getPublicNotes());
954  $new_obj->setIntroduction($this->getIntroduction());
955  $new_obj->setImportantPages($this->getImportantPages());
956  $new_obj->setPageToc($this->getPageToc());
957  $new_obj->update();
958 
959  // set/copy stylesheet
960  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
961  $style_id = $this->getStyleSheetId();
962  if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
963  {
964  $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
965  $new_id = $style_obj->ilClone();
966  $new_obj->setStyleSheetId($new_id);
967  $new_obj->update();
968  }
969 
970  // copy content
971  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
972  $pages = ilWikiPage::getAllPages($this->getId());
973  if (count($pages) > 0)
974  {
975  // if we have any pages, delete the start page first
976  $pg_id = ilWikiPage::getPageIdForTitle($new_obj->getId(), $new_obj->getStartPage());
977  $start_page = new ilWikiPage($pg_id);
978  $start_page->delete();
979  }
980  $map = array();
981  foreach ($pages as $p)
982  {
983  $page = new ilWikiPage($p["id"]);
984  $new_page = new ilWikiPage();
985  $new_page->setTitle($page->getTitle());
986  $new_page->setWikiId($new_obj->getId());
987  $new_page->setTitle($page->getTitle());
988  $new_page->setBlocked($page->getBlocked());
989  $new_page->setRating($page->getRating());
990  $new_page->create();
991 
992  $page->copy($new_page->getId(), "", 0, true);
993  //$new_page->setXMLContent($page->copyXMLContent(true));
994  //$new_page->buildDom(true);
995  //$new_page->update();
996  $map[$p["id"]] = $new_page->getId();
997  }
998 
999  // copy important pages
1000  foreach (ilObjWiki::_lookupImportantPagesList($this->getId()) as $ip)
1001  {
1002  $new_obj->addImportantPage($map[$ip["page_id"]], $ip["ord"], $ip["indent"]);
1003  }
1004 
1005  // copy rating categories
1006  include_once("./Services/Rating/classes/class.ilRatingCategory.php");
1007  foreach (ilRatingCategory::getAllForObject($this->getId()) as $rc)
1008  {
1009  $new_rc = new ilRatingCategory();
1010  $new_rc->setParentId($new_obj->getId());
1011  $new_rc->setTitle($rc["title"]);
1012  $new_rc->setDescription($rc["description"]);
1013  $new_rc->save();
1014  }
1015 
1016  return $new_obj;
1017  }
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
getRatingOverall()
Get Enable Rating For Object.
getStartPage()
Get Start Page.
getShortTitle()
Get ShortTitle.
getPublicNotes()
Get public notes.
getRatingForNewPages()
Get Enable Rating For New Pages.
getRatingCategories()
Get Enable Rating Categories.
static getAllForObject($a_parent_obj_id)
Get all categories for object.
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
getPageToc()
Get page toc.
getId()
get object id public
getRatingAsBlock()
Get Enable Rating Side Block.
getTitle()
get object title public
getStyleSheetId()
get ID of assigned style sheet object
Class ilWikiPage.
_lookupStandard($a_id)
Lookup standard flag.
global $ilUser
Definition: imgupload.php:15
getIntroduction()
Get Introduction.
Class ilRatingCategory.
getImportantPages()
Get important pages.
getRating()
Get Enable Rating.
static getAllPages($a_wiki_id)
Get all pages of wiki.
+ Here is the call graph for this function:

◆ create()

ilObjWiki::create (   $a_prevent_start_page_creation = false)

Create new wiki.

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

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

306  {
307  global $ilDB;
308 
309  parent::create();
310 
311  $ilDB->insert("il_wiki_data", array(
312  "id" => array("integer", $this->getId()),
313  "is_online" => array("integer", (int) $this->getOnline()),
314  "startpage" => array("text", $this->getStartPage()),
315  "short" => array("text", $this->getShortTitle()),
316  "rating" => array("integer", (int) $this->getRating()),
317  "public_notes" => array("integer", (int) $this->getPublicNotes()),
318  "introduction" => array("clob", $this->getIntroduction())
319  ));
320 
321  // create start page
322  if ($this->getStartPage() != "" && !$a_prevent_start_page_creation)
323  {
324  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
325  $start_page = new ilWikiPage();
326  $start_page->setWikiId($this->getId());
327  $start_page->setTitle($this->getStartPage());
328  $start_page->create();
329  }
330 
331  if (((int) $this->getStyleSheetId()) > 0)
332  {
333  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
335  }
336  }
getStartPage()
Get Start Page.
getShortTitle()
Get ShortTitle.
getPublicNotes()
Get public notes.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getId()
get object id public
getStyleSheetId()
get ID of assigned style sheet object
Class ilWikiPage.
getIntroduction()
Get Introduction.
getOnline()
Get Online.
getRating()
Get Enable Rating.
+ Here is the call graph for this function:

◆ delete()

ilObjWiki::delete ( )

delete object and all related data

public

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

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

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

427  {
428  global $ilDB;
429 
430  // always call parent delete function first!!
431  if (!parent::delete())
432  {
433  return false;
434  }
435 
436  // delete record of table il_wiki_data
437  $query = "DELETE FROM il_wiki_data".
438  " WHERE id = ".$ilDB->quote($this->getId(), "integer");
439  $ilDB->manipulate($query);
440 
441  // remove all notifications
442  include_once "./Services/Notification/classes/class.ilNotification.php";
444 
445  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
447 
448  return true;
449  }
static removeForObject($type, $id)
Remove all notifications for given object.
getId()
get object id public
static deleteAllPagesOfWiki($a_wiki_id)
delete wiki page and al related data
+ Here is the call graph for this function:

◆ fixImportantPagesNumbering()

ilObjWiki::fixImportantPagesNumbering ( )

Fix important pages numbering.

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

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

Referenced by removeImportantPage().

885  {
886  global $ilDB;
887 
888  $ipages = ilObjWiki::_lookupImportantPagesList($this->getId());
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  }
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImportantPages()

ilObjWiki::getImportantPages ( )

Get important pages.

Returns
boolean important pages

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

Referenced by cloneObject(), and update().

188  {
189  return $this->imp_pages;
190  }
+ Here is the caller graph for this function:

◆ getIntroduction()

ilObjWiki::getIntroduction ( )

Get Introduction.

Returns
string Introduction

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

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

248  {
249  return $this->introduction;
250  }
+ Here is the caller graph for this function:

◆ getOnline()

ilObjWiki::getOnline ( )

Get Online.

Returns
boolean Online

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

References $online.

Referenced by create(), and update().

52  {
53  return $this->online;
54  }
+ Here is the caller graph for this function:

◆ getPageToc()

ilObjWiki::getPageToc ( )

Get page toc.

Returns
boolean page toc

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

Referenced by cloneObject(), and update().

284  {
285  return $this->page_toc;
286  }
+ Here is the caller graph for this function:

◆ getPublicNotes()

ilObjWiki::getPublicNotes ( )

Get public notes.

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

References $public_notes.

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

168  {
169  return $this->public_notes;
170  }
+ Here is the caller graph for this function:

◆ getRating()

ilObjWiki::getRating ( )

Get Enable Rating.

Returns
boolean Enable Rating

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

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

92  {
93  return $this->rating;
94  }
+ Here is the caller graph for this function:

◆ getRatingAsBlock()

ilObjWiki::getRatingAsBlock ( )

Get Enable Rating Side Block.

Returns
boolean

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

Referenced by cloneObject(), and update().

112  {
113  return $this->rating_block;
114  }
+ Here is the caller graph for this function:

◆ getRatingCategories()

ilObjWiki::getRatingCategories ( )

Get Enable Rating Categories.

Returns
boolean

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

Referenced by cloneObject(), and update().

152  {
153  return $this->rating_categories;
154  }
+ Here is the caller graph for this function:

◆ getRatingForNewPages()

ilObjWiki::getRatingForNewPages ( )

Get Enable Rating For New Pages.

Returns
boolean

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

Referenced by cloneObject(), and update().

132  {
133  return $this->rating_new_pages;
134  }
+ Here is the caller graph for this function:

◆ getRatingOverall()

ilObjWiki::getRatingOverall ( )

Get Enable Rating For Object.

Returns
boolean Enable Rating

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

Referenced by cloneObject(), and update().

72  {
73  return $this->rating_overall;
74  }
+ Here is the caller graph for this function:

◆ getShortTitle()

ilObjWiki::getShortTitle ( )

Get ShortTitle.

Returns
string ShortTitle

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

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

228  {
229  return $this->shorttitle;
230  }
+ Here is the caller graph for this function:

◆ getStartPage()

ilObjWiki::getStartPage ( )

Get Start Page.

Returns
string Start Page

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

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

208  {
209  return $this->startpage;
210  }
+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjWiki::getStyleSheetId ( )

get ID of assigned style sheet object

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

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

256  {
257  return $this->style_id;
258  }
+ Here is the caller graph for this function:

◆ ilObjWiki()

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

Constructor public.

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

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

References ilObject\ilObject().

31  {
32  $this->type = "wiki";
33  $this->ilObject($a_id,$a_call_by_reference);
34  }
ilObject($a_id=0, $a_reference=true)
Constructor public.
+ Here is the call graph for this function:

◆ initDefaultRoles()

ilObjWiki::initDefaultRoles ( )

init default roles settings

If your module does not require any default roles, delete this method (For an example how this method is used, look at ilObjForum)

public

Returns
array object IDs of created local roles.

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

478  {
479  global $rbacadmin;
480 
481  // create a local role folder
482  //$rfoldObj = $this->createRoleFolder("Local roles","Role Folder of forum obj_no.".$this->getId());
483 
484  // create moderator role and assign role to rolefolder...
485  //$roleObj = $rfoldObj->createRole("Moderator","Moderator of forum obj_no.".$this->getId());
486  //$roles[] = $roleObj->getId();
487 
488  //unset($rfoldObj);
489  //unset($roleObj);
490 
491  return $roles ? $roles : array();
492  }

◆ isImportantPage()

ilObjWiki::isImportantPage (   $a_page_id)

Is page an important page?

Parameters

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

Referenced by addImportantPage().

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

Referenced by ilObjWikiGUI\isOnlineHelpWiki().

294  {
295  if ($a_ref_id > 0 && $a_ref_id == OH_REF_ID)
296  {
297 // return true;
298  }
299  return false;
300  }
+ 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)

public

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

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

References $_GET, and ilObject\getType().

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"]
redirection script todo: (a better solution should control the processing via a xml file) ...
getType()
get object type public
+ Here is the call graph for this function:

◆ read()

ilObjWiki::read ( )

Read wiki data.

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

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

391  {
392  global $ilDB;
393 
394  parent::read();
395 
396  $query = "SELECT * FROM il_wiki_data WHERE id = ".
397  $ilDB->quote($this->getId(), "integer");
398  $set = $ilDB->query($query);
399  $rec = $ilDB->fetchAssoc($set);
400 
401  $this->setOnline($rec["is_online"]);
402  $this->setStartPage($rec["startpage"]);
403  $this->setShortTitle($rec["short"]);
404  $this->setRatingOverall($rec["rating_overall"]);
405  $this->setRating($rec["rating"]);
406  $this->setRatingAsBlock($rec["rating_side"]);
407  $this->setRatingForNewPages($rec["rating_new"]);
408  $this->setRatingCategories($rec["rating_ext"]);
409  $this->setPublicNotes($rec["public_notes"]);
410  $this->setIntroduction($rec["introduction"]);
411  $this->setImportantPages($rec["imp_pages"]);
412  $this->setPageToc($rec["page_toc"]);
413 
414  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
416 
417  }
setImportantPages($a_val)
Set important pages.
setOnline($a_online)
Set Online.
setIntroduction($a_introduction)
Set Introduction.
setPublicNotes($a_val)
Set public notes.
static lookupObjectStyle($a_obj_id)
Lookup object style.
setRatingCategories($a_rating)
Set Enable Rating Categories.
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
setRatingAsBlock($a_rating)
Set Enable Rating Side Block.
getId()
get object id public
setShortTitle($a_shorttitle)
Set ShortTitle.
setStartPage($a_startpage)
Set Start Page.
setRating($a_rating)
Set Enable Rating.
setRatingForNewPages($a_rating)
Set Enable Rating For New Pages.
setRatingOverall($a_rating)
Set Enable Rating For Object.
setPageToc($a_val)
Set page toc.
+ Here is the call graph for this function:

◆ removeImportantPage()

ilObjWiki::removeImportantPage (   $a_id)

Remove important page.

Parameters
intpage id

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

References fixImportantPagesNumbering().

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.
+ Here is the call graph for this function:

◆ saveOrderingAndIndentation()

ilObjWiki::saveOrderingAndIndentation (   $a_ord,
  $a_indent 
)

Save ordering and indentation.

Parameters

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

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

834  {
835  global $ilDB;
836 
837  $ipages = ilObjWiki::_lookupImportantPagesList($this->getId());
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 _lookupImportantPagesList($a_wiki_id)
Get important pages list.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getId()
get object id public
+ Here is the call graph for this function:

◆ setImportantPages()

ilObjWiki::setImportantPages (   $a_val)

Set important pages.

Parameters
boolean$a_valimportant pages

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

Referenced by read().

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

◆ setIntroduction()

ilObjWiki::setIntroduction (   $a_introduction)

Set Introduction.

Parameters
string$a_introductionIntroduction

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

Referenced by read().

238  {
239  $this->introduction = $a_introduction;
240  }
+ Here is the caller graph for this function:

◆ setOnline()

ilObjWiki::setOnline (   $a_online)

Set Online.

Parameters
boolean$a_onlineOnline

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

Referenced by read().

42  {
43  $this->online = $a_online;
44  }
+ Here is the caller graph for this function:

◆ setPageToc()

ilObjWiki::setPageToc (   $a_val)

Set page toc.

Parameters
boolean$a_valpage toc

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

Referenced by read().

274  {
275  $this->page_toc = $a_val;
276  }
+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjWiki::setPublicNotes (   $a_val)

Set public notes.

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

Referenced by read().

160  {
161  $this->public_notes = $a_val;
162  }
+ Here is the caller graph for this function:

◆ setRating()

ilObjWiki::setRating (   $a_rating)

Set Enable Rating.

Parameters
boolean$a_ratingEnable Rating

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

Referenced by read().

82  {
83  $this->rating = (bool)$a_rating;
84  }
+ 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 101 of file class.ilObjWiki.php.

Referenced by read().

102  {
103  $this->rating_block = (bool)$a_rating;
104  }
+ Here is the caller graph for this function:

◆ setRatingCategories()

ilObjWiki::setRatingCategories (   $a_rating)

Set Enable Rating Categories.

Parameters
boolean$a_rating

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

Referenced by read().

142  {
143  $this->rating_categories = (bool)$a_rating;
144  }
+ 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 121 of file class.ilObjWiki.php.

Referenced by read().

122  {
123  $this->rating_new_pages = (bool)$a_rating;
124  }
+ 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 61 of file class.ilObjWiki.php.

Referenced by read().

62  {
63  $this->rating_overall = (bool)$a_rating;
64  }
+ Here is the caller graph for this function:

◆ setShortTitle()

ilObjWiki::setShortTitle (   $a_shorttitle)

Set ShortTitle.

Parameters
string$a_shorttitleShortTitle

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

Referenced by read().

218  {
219  $this->shorttitle = $a_shorttitle;
220  }
+ Here is the caller graph for this function:

◆ setStartPage()

ilObjWiki::setStartPage (   $a_startpage)

Set Start Page.

Parameters
string$a_startpageStart Page

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

References ilWikiUtil\makeDbTitle().

Referenced by read().

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

◆ setStyleSheetId()

ilObjWiki::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

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

Referenced by read().

264  {
265  $this->style_id = $a_style_id;
266  }
+ Here is the caller graph for this function:

◆ update()

ilObjWiki::update (   $a_prevent_start_page_creation = false)

update object data

public

Returns
boolean

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

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

345  {
346  global $ilDB;
347 
348  if (!parent::update())
349  {
350  return false;
351  }
352 
353  $ilDB->update("il_wiki_data", array(
354  "is_online" => array("integer", $this->getOnline()),
355  "startpage" => array("text", $this->getStartPage()),
356  "short" => array("text", $this->getShortTitle()),
357  "rating_overall" => array("integer", $this->getRatingOverall()),
358  "rating" => array("integer", $this->getRating()),
359  "rating_side" => array("integer", (bool)$this->getRatingAsBlock()), // #13455
360  "rating_new" => array("integer", $this->getRatingForNewPages()),
361  "rating_ext" => array("integer", $this->getRatingCategories()),
362  "public_notes" => array("integer", $this->getPublicNotes()),
363  "introduction" => array("clob", $this->getIntroduction()),
364  "imp_pages" => array("integer", $this->getImportantPages()),
365  "page_toc" => array("integer", $this->getPageToc())
366  ), array(
367  "id" => array("integer", $this->getId())
368  ));
369 
370  // check whether start page exists
371  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
372  if (!ilWikiPage::exists($this->getId(), $this->getStartPage())
373  && !$a_prevent_start_page_creation)
374  {
375  $start_page = new ilWikiPage();
376  $start_page->setWikiId($this->getId());
377  $start_page->setTitle($this->getStartPage());
378  $start_page->create();
379  }
380 
381  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
383 
384  return true;
385  }
getRatingOverall()
Get Enable Rating For Object.
getStartPage()
Get Start Page.
getShortTitle()
Get ShortTitle.
getPublicNotes()
Get public notes.
getRatingForNewPages()
Get Enable Rating For New Pages.
getRatingCategories()
Get Enable Rating Categories.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getPageToc()
Get page toc.
getId()
get object id public
getRatingAsBlock()
Get Enable Rating Side Block.
getStyleSheetId()
get ID of assigned style sheet object
Class ilWikiPage.
static exists($a_wiki_id, $a_title)
Checks whether a page with given title exists.
getIntroduction()
Get Introduction.
getImportantPages()
Get important pages.
getOnline()
Get Online.
getRating()
Get Enable Rating.
+ 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.

References ilWikiUtil\makeDbTitle().

Referenced by ilWikiPage\rename().

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  }
static makeDbTitle($a_par)
Handle page GET parameter.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $online

ilObjWiki::$online = false
protected

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

Referenced by getOnline().

◆ $public_notes

ilObjWiki::$public_notes = true
protected

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

Referenced by getPublicNotes().


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