ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPortfolioPage Class Reference

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

+ Inheritance diagram for ilPortfolioPage:
+ Collaboration diagram for ilPortfolioPage:

Public Member Functions

 getParentType ()
 
 setPortfolioId (int $a_val)
 
 getPortfolioId ()
 
 setType (int $a_val)
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOrderNr (int $a_val)
 
 getOrderNr ()
 
 create (bool $a_import=false)
 
 update (bool $a_validate=true, bool $a_no_history=false)
 
 read ()
 
 delete ()
 
 renameLinksOnTitleChange (array $a_title_changes)
 
- Public Member Functions inherited from ilPageObject
 __construct (int $a_id=0, int $a_old_nr=0, string $a_lang="-")
 
 afterConstructor ()
 
 getParentType ()
 
 initPageConfig ()
 
 setLanguage (string $a_val)
 Set language. More...
 
 getLanguage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 setConcreteLang (string $a_val)
 
 getConcreteLang ()
 
 getPageConfig ()
 
 setRenderMd5 (string $a_rendermd5)
 
 getRenderMd5 ()
 
 setRenderedContent (string $a_renderedcontent)
 
 getRenderedContent ()
 
 setRenderedTime (string $a_renderedtime)
 
 getRenderedTime ()
 
 setLastChange (string $a_lastchange)
 
 getLastChange ()
 
 setLastChangeUser (int $a_val)
 
 getLastChangeUser ()
 
 setShowActivationInfo (bool $a_val)
 
 getShowActivationInfo ()
 
 getCreationUserId ()
 
 read ()
 Read page data. More...
 
 buildDom (bool $a_force=false)
 
 freeDom ()
 
 getDom ()
 
 setId (int $a_id)
 
 getId ()
 
 setParentId (int $a_id)
 
 getParentId ()
 
 addUpdateListener (object $a_object, string $a_method, $a_parameters="")
 
 callUpdateListeners ()
 
 setActive (bool $a_active)
 
 getActive (bool $a_check_scheduled_activation=false)
 
 setActivationStart (?string $a_activationstart)
 
 getActivationStart ()
 
 setActivationEnd (?string $a_activationend)
 Set Activation End. More...
 
 getActivationEnd ()
 
 getContentObject (string $a_hier_id, string $a_pc_id="")
 Get a content object of the page. More...
 
 getContentObjectForPcId (string $pcid)
 Get content object for pc id. More...
 
 getParentContentObjectForPcId (string $pcid)
 Get parent content object for pc id. More...
 
 getContentNode (string $a_hier_id, string $a_pc_id="")
 
 checkForTag (string $a_content_tag, string $a_hier_id, string $a_pc_id="")
 Get content node from dom. More...
 
 getNode ()
 
 setXMLContent (string $a_xml, string $a_encoding="UTF-8")
 set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD, omit MetaData, use utf-8! More...
 
 appendXMLContent (string $a_xml)
 
   append xml content to page
   setXMLContent must be called before and the same encoding must be used

s More...

 
 getXMLContent (bool $a_incl_head=false)
 get xml content of page More...
 
 copyXmlContent (bool $a_clone_mobs=false, int $a_new_parent_id=0, int $obj_copy_id=0, bool $self_ass=true)
 Copy content of page; replace page components with copies where necessary (e.g. More...
 
 handleCopiedContent (php4DOMDocument $a_dom, bool $a_self_ass=true, bool $a_clone_mobs=false, int $new_parent_id=0, int $obj_copy_id=0)
 Handle copied content This function copies items, that must be copied, if page content is duplicated. More...
 
 newIIMCopies (php4DOMDocument $temp_dom)
 Replaces media objects in interactive images with copies of the interactive images. More...
 
 newMobCopies (php4DOMDocument $temp_dom)
 Replaces media objects with copies. More...
 
 newQuestionCopies (php4DOMDocument $temp_dom)
 Replaces existing question content elements with new copies. More...
 
 removeQuestions (php4DOMDocument $temp_dom)
 Remove questions from document. More...
 
 countPageContents ()
 
 getXMLFromDom (bool $a_incl_head=false, bool $a_append_mobs=false, bool $a_append_bib=false, string $a_append_str="", bool $a_omit_pageobject_tag=false, int $style_id=0)
 get xml content of page from dom (use this, if any changes are made to the document) More...
 
 getLanguageVariablesXML (int $style_id=0)
 Get language variables as XML. More...
 
 getFirstParagraphText ()
 
 getParagraphForPCID (string $pcid)
 
 setParagraphContent (string $a_hier_id, string $a_content)
 Set content of paragraph. More...
 
 setContainsIntLink (bool $a_contains_link)
 lm parser set this flag to true, if the page contains intern links (this method should only be called by the import parser) todo: move to ilLMPageObject !? More...
 
 containsIntLink ()
 returns true, if page was marked as containing an intern link (via setContainsIntLink) (this method should only be called by the import parser) More...
 
 setImportMode (bool $a_val)
 
 getImportMode ()
 
 needsImportParsing (?bool $a_parse=null)
 
 setContainsQuestion (bool $a_val)
 
 getContainsQuestion ()
 
 collectMediaObjects (bool $a_inline_only=true)
 get all media objects, that are referenced and used within the page More...
 
 getInternalLinks (bool $a_cnt_multiple=false)
 get all internal links that are used within the page More...
 
 getMultimediaXML ()
 get a xml string that contains all media object elements, that are referenced by any media alias in the page More...
 
 getMediaAliasElement (int $a_mob_id, int $a_nr=1)
 get complete media object (alias) element More...
 
 validateDom (bool $throw=false)
 Validate the page content agains page DTD. More...
 
 addHierIDs ()
 Add hierarchical ID (e.g. More...
 
 getHierIds ()
 get all hierarchical ids More...
 
 getFirstRowIds ()
 get ids of all first table rows More...
 
 getFirstColumnIds ()
 get ids of all first table columns More...
 
 getListItemIds ()
 get ids of all list items More...
 
 getFileItemIds ()
 get ids of all file items More...
 
 stripHierIDs ()
 strip all hierarchical id attributes out of the dom tree More...
 
 getHierIdsForPCIds (array $a_pc_ids)
 Get hier ids for a set of pc ids. More...
 
 getHierIdForPcId (string $pcid)
 
 getPCIdsForHierIds (array $hier_ids)
 Get hier ids for a set of pc ids. More...
 
 getPCIdForHierId (string $hier_id)
 
 addFileSizes ()
 add file sizes More...
 
 resolveIntLinks (array $a_link_map=null)
 Resolves all internal link targets of the page, if targets are available (after import) More...
 
 resolveMediaAliases (array $a_mapping, bool $a_reuse_existing_by_import=false)
 Resolve media aliases (after import) More...
 
 resolveIIMMediaAliases (array $a_mapping)
 Resolve iim media aliases (in ilContObjParse) More...
 
 resolveFileItems (array $a_mapping)
 Resolve file items (after import) More...
 
 resolveQuestionReferences (array $a_mapping)
 Resolve all quesiont references (after import) More...
 
 moveIntLinks (array $a_from_to)
 Move internal links from one destination to another. More...
 
 handleImportRepositoryLink (string $a_rep_import_id, string $a_rep_type, int $a_rep_ref_id)
 
 handleRepositoryLinksOnCopy (array $a_mapping, int $a_source_ref_id)
 Handle repository links on copy process. More...
 
 createFromXML ()
 Create new page object with current xml content. More...
 
 updateFromXML ()
 Updates page object with current xml content This function is currently (8 beta) called by: More...
 
 afterUpdate (DOMDocument $domdoc, string $xml)
 After update. More...
 
 update (bool $a_validate=true, bool $a_no_history=false)
 update complete page content in db (dom xml content is used) More...
 
 delete ()
 
 saveStyleUsage (DOMDocument $a_domdoc, int $a_old_nr=0)
 Save all style class/template usages. More...
 
 deleteStyleUsages (int $a_old_nr=0)
 Delete style usages. More...
 
 getLastUpdateOfIncludedElements ()
 Get last update of included elements (media objects and files). More...
 
 deleteInternalLinks ()
 Delete internal links. More...
 
 saveInternalLinks (DOMDocument $a_domdoc)
 save internal links of page More...
 
 create (bool $a_import=false)
 create new page (with current xml data) More...
 
 deleteContent (string $a_hid, bool $a_update=true, string $a_pcid="", bool $move_operation=false)
 delete content object with hierarchical id $a_hid More...
 
 deleteContents (array $a_hids, bool $a_update=true, bool $a_self_ass=false, bool $move_operation=false)
 Delete multiple content objects. More...
 
 cutContents (array $a_hids)
 Copy contents to clipboard and cut them from the page. More...
 
 copyContents (array $a_hids)
 Copy contents to clipboard. More...
 
 pasteContents (string $a_hier_id, bool $a_self_ass=false)
 Paste contents from pc clipboard. More...
 
 switchEnableMultiple (array $a_hids, bool $a_update=true, bool $a_self_ass=false)
 (De-)activate elements More...
 
 deleteContentFromHierId (string $a_hid, bool $a_update=true)
 delete content object with hierarchical id >= $a_hid as part of a split page operation More...
 
 deleteContentBeforeHierId (string $a_hid, bool $a_update=true)
 delete content object with hierarchical id < $a_hid as part of the split page operation More...
 
 insertContent (ilPageContent $a_cont_obj, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="", bool $remove_placeholder=true)
 insert a content node before/after a sibling or as first child of a parent More...
 
 insertContentNode (php4DOMElement $a_cont_node, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent More...
 
 moveContentBefore (string $a_source, string $a_target, string $a_spcid="", string $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 moveContentAfter (string $a_source, string $a_target, string $a_spcid="", string $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 bbCode2XML (string &$a_content)
 transforms bbCode to corresponding xml More...
 
 insertInstIntoIDs (string $a_inst, bool $a_res_ref_to_obj_id=true)
 inserts installation id into ids (e.g. More...
 
 checkPCIds ()
 Check, whether (all) page content hashes are set. More...
 
 getAllPCIds ()
 Get all pc ids. More...
 
 hasDuplicatePCIds ()
 
 getDuplicatePCIds ()
 Get all duplicate PC Ids. More...
 
 existsPCId (string $a_pc_id)
 
 generatePcId ()
 
 insertPCIds ()
 Insert Page Content IDs. More...
 
 getPageContentsHashes ()
 Get page contents hashes. More...
 
 getQuestionIds ()
 Get question ids. More...
 
 send_paragraph (string $par_id, string $filename)
 
 getFO ()
 get fo page content More...
 
 registerOfflineHandler (object $handler)
 
 getOfflineHandler ()
 
 containsDeactivatedElements (string $a_content)
 Check whether content contains deactivated elements. More...
 
 getHistoryEntries ()
 Get History Entries. More...
 
 getHistoryEntry (int $a_old_nr)
 Get History Entry. More...
 
 getHistoryInfo (int $a_nr)
 Get information about a history entry, its predecessor and its successor. More...
 
 addChangeDivClasses (array $a_hashes)
 
 compareVersion (int $a_left, int $a_right)
 Compares to revisions of the page. More...
 
 increaseViewCnt ()
 Increase view cnt. More...
 
 writeRenderedContent (string $a_content, string $a_md5)
 Write rendered content. More...
 
 containsIntLinks (string $a_content)
 Check whether content contains internal links. More...
 
 performAutomaticModifications ()
 Perform automatic modifications (may be overwritten by sub classes) More...
 
 saveInitialOpenedContent (string $a_type, int $a_id, string $a_target)
 Save initial opened content. More...
 
 getInitialOpenedContent ()
 Get initial opened content. More...
 
 beforePageContentUpdate (ilPageContent $a_page_content)
 Before page content update Note: This one is "work in progress", currently only text paragraphs call this hook It is called before the page content object invokes the update procedure of ilPageObject. More...
 
 copy (int $a_id, string $a_parent_type="", int $a_new_parent_id=0, bool $a_clone_mobs=false, int $obj_copy_id=0)
 Copy page. More...
 
 copyPageToTranslation (string $a_target_lang)
 Copy page to translation. More...
 
 getEditLock ()
 Get page lock. More...
 
 releasePageLock ()
 Release page lock. More...
 
 getEditLockInfo ()
 Get edit lock info. More...
 
 getContentTemplates ()
 Get content templates. More...
 
 getEffectiveEditLockTime ()
 
 getAllFileObjIds ()
 Get all file object ids. More...
 
 resolveResources (array $ref_mapping)
 Resolve resources. More...
 
 getRepoObjId ()
 Get object id of repository object that contains this page, return 0 if page does not belong to a repo object. More...
 
 getPCModel ()
 Get page component model. More...
 
 assignCharacteristic (array $targets, string $char_par, string $char_sec, string $char_med)
 Assign characteristic. More...
 

Static Public Member Functions

static lookupMaxOrderNr (int $a_portfolio_id)
 
static lookupTitle (int $a_page_id)
 
static lookupType ($a_page_id)
 
static getAllPortfolioPages (int $a_portfolio_id)
 Get pages of portfolio. More...
 
static fixOrdering (int $a_portfolio_id)
 
static findPortfolioForPage (int $a_page_id)
 Get portfolio id of page id. More...
 
static getGotoForPortfolioPageTarget (int $a_target, bool $a_offline=false)
 Get goto href for portfolio page id. More...
 
static updateInternalLinks (array $a_copied_nodes, ilObjPortfolioBase $a_target_obj)
 Update internal links, after multiple pages have been copied. More...
 
static getPagesForBlog (int $a_blog_id)
 Get portfolio pages for blog. More...
 
- Static Public Member Functions inherited from ilPageObject
static randomhash ()
 
static _exists (string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
 Checks whether page exists. More...
 
static _existsAndNotEmpty (string $a_parent_type, int $a_id, string $a_lang="-")
 Checks whether page exists and is not empty (may return true on some empty pages) More...
 
static preloadActivationDataByParentId (int $a_parent_id)
 Preload activation data by Parent Id. More...
 
static _lookupActive (int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
 lookup activation status More...
 
static _isScheduledActivation (int $a_id, string $a_parent_type, string $a_lang="-")
 Check whether page is activated by time schedule. More...
 
static _writeActive (int $a_id, string $a_parent_type, bool $a_active)
 write activation status More...
 
static _lookupActivationData (int $a_id, string $a_parent_type, string $a_lang="-")
 Lookup activation data. More...
 
static lookupParentId (int $a_id, string $a_type)
 
static _writeParentId (string $a_parent_type, int $a_pg_id, int $a_par_id)
 
static _handleImportRepositoryLinks (string $a_rep_import_id, string $a_rep_type, int $a_rep_ref_id)
 Change targest of repository links. More...
 
static _moveContentAfterHierId (ilPageObject $a_source_page, ilPageObject $a_target_page, string $a_hid)
 move content of hierarchical id >= $a_hid to other page More...
 
static _lookupContainsDeactivatedElements (int $a_id, string $a_parent_type, string $a_lang="-")
 lookup whether page contains deactivated elements More...
 
static getRecentChanges (string $a_parent_type, int $a_parent_id, int $a_period=30, string $a_lang="")
 Get recent pages changes for parent object. More...
 
static getAllPages (string $a_parent_type, int $a_parent_id, string $a_lang="-")
 Get all pages for parent object. More...
 
static getNewPages (string $a_parent_type, int $a_parent_id, string $a_lang="-")
 Get new pages. More...
 
static getParentObjectContributors (string $a_parent_type, int $a_parent_id, string $a_lang="-")
 Get all contributors for parent object. More...
 
static getPageContributors (string $a_parent_type, int $a_page_id, string $a_lang="-")
 Get all contributors for parent object. More...
 
static getPagesWithLinks (string $a_parent_type, int $a_parent_id, string $a_lang="-")
 Get all pages for parent object that contain internal links. More...
 
static lookupTranslations (string $a_parent_type, int $a_id)
 Lookup translations. More...
 
static truncateHTML (string $a_text, int $a_length=100, string $a_ending='...', bool $a_exact=false, bool $a_consider_html=true)
 Truncate (html) string. More...
 
static getLastChangeByParent (string $a_parent_type, int $a_parent_id, string $a_lang="")
 Get all pages for parent object. More...
 

Data Fields

const TYPE_PAGE = 1
 
const TYPE_BLOG = 2
 
- Data Fields inherited from ilPageObject
int $old_nr
 
php4DOMDocument $dom = null
 
string $xml = ""
 
string $encoding = ""
 
php4DOMElement $node
 
string $cur_dtd = "ilias_pg_8.dtd"
 
bool $contains_int_link = false
 
bool $needs_parsing = false
 
string $parent_type = ""
 
int $parent_id = 0
 
array $update_listeners = []
 
int $update_listener_cnt = 0
 
object $offline_handler = null
 
bool $dom_builded = false
 
bool $history_saved = false
 
int $last_change_user = 0
 

Protected Member Functions

 getPropertiesForDB ()
 
- Protected Member Functions inherited from ilPageObject
 getLangVarXML (string $var)
 
 __afterUpdate (DOMDocument $a_domdoc, string $a_xml, bool $a_creation=false, bool $a_empty=false)
 After update event handler (internal). More...
 
 __beforeDelete ()
 Before deletion handler (internal). More...
 
 __afterDelete ()
 
 afterDelete ()
 
 __afterHistoryEntry (DOMDocument $a_old_domdoc, string $a_old_content, int $a_old_nr)
 
 preparePageForCompare (ilPageObject $page)
 

Static Protected Member Functions

static lookupProperty (int $a_id, string $a_prop)
 

Protected Attributes

int $portfolio_id
 
int $type = 1
 
string $title
 
int $order_nr
 
- Protected Attributes inherited from ilPageObject
int $create_user = 0
 
array $id_elements
 
bool $page_not_found = false
 
bool $show_page_act_info = false
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilObjUser $user
 
ilLanguage $lng
 
ilTree $tree
 
int $id
 
string $language = "-"
 
bool $import_mode = false
 
ilLogger $log
 
array $page_record = array()
 
bool $active = false
 
ilPageConfig $page_config
 
string $rendermd5 = ""
 
string $renderedcontent = ""
 
string $renderedtime = ""
 
string $lastchange = ""
 
bool $contains_question = false
 
array $hier_ids = []
 
array $first_row_ids = []
 
array $first_col_ids = []
 
array $list_item_ids = []
 
array $file_item_ids = []
 
string $activationstart = null
 
string $activationend = null
 
ILIAS COPage ReadingTime ReadingTimeManager $reading_time_manager
 
 $concrete_lang = ""
 

Additional Inherited Members

- Static Public Attributes inherited from ilPageObject
static array $exists = array()
 
- Static Protected Attributes inherited from ilPageObject
static array $activation_data = array()
 

Detailed Description

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

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

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

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Member Function Documentation

◆ create()

ilPortfolioPage::create ( bool  $a_import = false)

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

References ilPageObject\$db, ilPageObject\$id, $ilDB, getPropertiesForDB(), ilPageObject\setId(), and setOrderNr().

114  : void
115  {
116  $ilDB = $this->db;
117 
118  if (!$a_import) {
119  $this->setOrderNr(self::lookupMaxOrderNr($this->portfolio_id) + 10);
120  }
121 
122  $id = $ilDB->nextId("usr_portfolio_page");
123  $this->setId($id);
124 
125  $fields = $this->getPropertiesForDB();
126  $fields["id"] = array("integer", $id);
127 
128  $ilDB->insert("usr_portfolio_page", $fields);
129 
130  if (!$a_import) {
131  parent::create($a_import);
132  // $this->saveInternalLinks($this->getDomDoc());
133  }
134  }
ilDBInterface $db
+ Here is the call graph for this function:

◆ delete()

ilPortfolioPage::delete ( )

Definition at line 174 of file class.ilPortfolioPage.php.

References ilPageObject\$db, ilPageObject\$id, $ilDB, $query, ilInternalLink\_deleteAllLinksToTarget(), and ilPageObject\getId().

174  : void
175  {
176  $ilDB = $this->db;
177 
178  $id = $this->getId();
179  if ($id) {
180  // delete internal links information to this page
182 
183  // delete record of table usr_portfolio_page
184  $query = "DELETE FROM usr_portfolio_page" .
185  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
186  $ilDB->manipulate($query);
187 
188  // delete co page
189  parent::delete();
190  }
191  }
$query
ilDBInterface $db
+ Here is the call graph for this function:

◆ findPortfolioForPage()

static ilPortfolioPage::findPortfolioForPage ( int  $a_page_id)
static

Get portfolio id of page id.

Definition at line 266 of file class.ilPortfolioPage.php.

Referenced by ilPortfolioImporter\finalProcessing(), ilPortfolioPageGUI\getPagePermaLink(), and ilObjMediaObject\getParentObjectIdForUsage().

266  : int
267  {
268  return (int) self::lookupProperty($a_page_id, "portfolio_id");
269  }
+ Here is the caller graph for this function:

◆ fixOrdering()

static ilPortfolioPage::fixOrdering ( int  $a_portfolio_id)
static

Definition at line 244 of file class.ilPortfolioPage.php.

References $DIC, and $ilDB.

Referenced by ilObjPortfolioBaseGUI\savePortfolioPagesOrdering().

246  : void {
247  global $DIC;
248 
249  $ilDB = $DIC->database();
250 
251  $pages = self::getAllPortfolioPages($a_portfolio_id);
252  $cnt = 10;
253  foreach ($pages as $p) {
254  $ilDB->manipulate(
255  "UPDATE usr_portfolio_page SET " .
256  " order_nr = " . $ilDB->quote($cnt, "integer") .
257  " WHERE id = " . $ilDB->quote($p["id"], "integer")
258  );
259  $cnt += 10;
260  }
261  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getAllPortfolioPages()

static ilPortfolioPage::getAllPortfolioPages ( int  $a_portfolio_id)
static

Get pages of portfolio.

Definition at line 221 of file class.ilPortfolioPage.php.

References $DIC, $ilDB, ilPageObject\$lng, and ilLanguage\txt().

Referenced by ilObjPortfolioBase\clonePagesAndSettings(), ilObjPortfolioGUI\createPortfolioFromAssignment(), ilObjPortfolioGUI\createPortfolioFromTemplateProcess(), ilObjPortfolioTemplate\deleteAllPages(), ilObjPortfolio\deleteAllPages(), ilObjPortfolioBaseGUI\deletePortfolioPages(), ilObjPortfolioTemplate\doCloneObject(), ILIAS\Portfolio\Export\PortfolioHtmlExport\exportHTMLPages(), ILIAS\Portfolio\Export\PortfolioHtmlExport\exportHTMLPagesPrint(), ilObjPortfolioBase\fixLinksOnTitleChange(), ilPortfolioPageTableGUI\getItems(), ILIAS\Portfolio\PortfolioPrintViewProviderGUI\getPages(), ILIAS\Portfolio\PortfolioPrintViewProviderGUI\getSelectionForm(), ilPortfolioExporter\getXmlExportTailDependencies(), ilObjPortfolioGUI\initCreatePortfolioFromTemplateForm(), and ilInternalLinkGUI\showLinkHelp().

223  : array {
224  global $DIC;
225 
226  $ilDB = $DIC->database();
227  $lng = $DIC->language();
228 
229  $set = $ilDB->query("SELECT * FROM usr_portfolio_page" .
230  " WHERE portfolio_id = " . $ilDB->quote($a_portfolio_id, "integer") .
231  " ORDER BY order_nr");
232  $pages = array();
233  while ($rec = $ilDB->fetchAssoc($set)) {
234  // because of migration of extended user profiles
235  if ($rec["title"] == "###-") {
236  $rec["title"] = $lng->txt("profile");
237  }
238 
239  $pages[] = $rec;
240  }
241  return $pages;
242  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGotoForPortfolioPageTarget()

static ilPortfolioPage::getGotoForPortfolioPageTarget ( int  $a_target,
bool  $a_offline = false 
)
static

Get goto href for portfolio page id.

Definition at line 274 of file class.ilPortfolioPage.php.

References $DIC, ilObject\_lookupType(), and CLIENT_ID.

Referenced by ilPageLinker\getLinkXML().

277  : string {
278  global $DIC;
279 
280  $pid = self::findPortfolioForPage($a_target);
282  if ($type === "prtt") {
283  $ctrl = $DIC->ctrl();
284  $ctrl->setParameterByClass("ilobjportfoliotemplategui", "user_page", $a_target);
285  $href = $ctrl->getLinkTargetByClass(array(
286  "ilRepositoryGUI",
287  "ilObjPortfolioTemplateGUI"
288  ), "preview", "", false, true);
289  } else {
290  if (!$a_offline) {
291  $href = "./goto.php?client_id=" . CLIENT_ID . "&amp;target=prtf_" . $pid . "_" . $a_target;
292  } else {
293  $href = "prtf_" . $a_target . ".html";
294  }
295  }
296  return $href;
297  }
global $DIC
Definition: feed.php:28
const CLIENT_ID
Definition: constants.php:41
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrderNr()

ilPortfolioPage::getOrderNr ( )

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

References $order_nr.

Referenced by getPropertiesForDB().

84  : int
85  {
86  return $this->order_nr;
87  }
+ Here is the caller graph for this function:

◆ getPagesForBlog()

static ilPortfolioPage::getPagesForBlog ( int  $a_blog_id)
static

Get portfolio pages for blog.

Parameters
int$a_blog_id
Returns
ilPortfolioPage[]

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

References $DIC, and $ilDB.

Referenced by ilPortfolioPageAction\deletePagesOfBlog().

402  : array {
403  global $DIC;
404 
405  $ilDB = $DIC->database();
406 
407  $set = $ilDB->query("SELECT * FROM usr_portfolio_page" .
408  " WHERE title = " . $ilDB->quote($a_blog_id, "text") .
409  " AND type = " . $ilDB->quote(self::TYPE_BLOG, "integer"));
410  $pages = array();
411  while ($rec = $ilDB->fetchAssoc($set)) {
412  $pages[] = new ilPortfolioPage($rec["id"]);
413  }
414  return $pages;
415  }
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getParentType()

ilPortfolioPage::getParentType ( )

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

34  : string
35  {
36  return "prtf";
37  }

◆ getPortfolioId()

ilPortfolioPage::getPortfolioId ( )

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

References $portfolio_id.

44  : int
45  {
46  return $this->portfolio_id;
47  }

◆ getPropertiesForDB()

ilPortfolioPage::getPropertiesForDB ( )
protected

Definition at line 102 of file class.ilPortfolioPage.php.

References getOrderNr(), getTitle(), and getType().

Referenced by create(), and update().

102  : array
103  {
104  $fields = array(
105  "portfolio_id" => array("integer", $this->portfolio_id),
106  "type" => array("integer", $this->getType()),
107  "title" => array("text", $this->getTitle()),
108  "order_nr" => array("integer", $this->getOrderNr())
109  );
110 
111  return $fields;
112  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitle()

ilPortfolioPage::getTitle ( )

Definition at line 67 of file class.ilPortfolioPage.php.

References ilPageObject\$lng, $title, and ilLanguage\txt().

Referenced by getPropertiesForDB().

67  : string
68  {
69  $lng = $this->lng;
70 
71  // because of migration of extended user profiles
72  if ($this->title === "###-") {
73  return $lng->txt("profile");
74  }
75 
76  return $this->title;
77  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilPortfolioPage::getType ( )

Definition at line 57 of file class.ilPortfolioPage.php.

References $type.

Referenced by getPropertiesForDB().

57  : int
58  {
59  return $this->type;
60  }
+ Here is the caller graph for this function:

◆ lookupMaxOrderNr()

static ilPortfolioPage::lookupMaxOrderNr ( int  $a_portfolio_id)
static

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

References $DIC, and $ilDB.

91  : int {
92  global $DIC;
93 
94  $ilDB = $DIC->database();
95 
96  $set = $ilDB->query("SELECT MAX(order_nr) m FROM usr_portfolio_page" .
97  " WHERE portfolio_id = " . $ilDB->quote($a_portfolio_id, "integer"));
98  $rec = $ilDB->fetchAssoc($set);
99  return (int) $rec["m"];
100  }
global $DIC
Definition: feed.php:28

◆ lookupProperty()

static ilPortfolioPage::lookupProperty ( int  $a_id,
string  $a_prop 
)
staticprotected

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

References $DIC, and $ilDB.

196  : string {
197  global $DIC;
198 
199  $ilDB = $DIC->database();
200 
201  $set = $ilDB->query("SELECT " . $a_prop .
202  " FROM usr_portfolio_page" .
203  " WHERE id = " . $ilDB->quote($a_id, "integer"));
204  $rec = $ilDB->fetchAssoc($set);
205  return (string) ($rec[$a_prop] ?? "");
206  }
global $DIC
Definition: feed.php:28

◆ lookupTitle()

static ilPortfolioPage::lookupTitle ( int  $a_page_id)
static

Definition at line 208 of file class.ilPortfolioPage.php.

208  : string
209  {
210  return self::lookupProperty($a_page_id, "title");
211  }

◆ lookupType()

static ilPortfolioPage::lookupType (   $a_page_id)
static

Definition at line 213 of file class.ilPortfolioPage.php.

Referenced by ilObjPortfolioBaseGUI\showEditButton().

213  : int
214  {
215  return (int) self::lookupProperty($a_page_id, "type");
216  }
+ Here is the caller graph for this function:

◆ read()

ilPortfolioPage::read ( )

Definition at line 156 of file class.ilPortfolioPage.php.

References ilPageObject\$db, $ilDB, $query, ilPageObject\getId(), setOrderNr(), setPortfolioId(), setTitle(), and setType().

156  : void
157  {
158  $ilDB = $this->db;
159 
160  $query = "SELECT * FROM usr_portfolio_page" .
161  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
162  $set = $ilDB->query($query);
163  $rec = $ilDB->fetchAssoc($set);
164 
165  $this->setPortfolioId($rec["portfolio_id"]);
166  $this->setType($rec["type"]);
167  $this->setTitle($rec["title"]);
168  $this->setOrderNr($rec["order_nr"]);
169 
170  // get co page
171  parent::read();
172  }
$query
ilDBInterface $db
setTitle(string $a_title)
+ Here is the call graph for this function:

◆ renameLinksOnTitleChange()

ilPortfolioPage::renameLinksOnTitleChange ( array  $a_title_changes)

Definition at line 365 of file class.ilPortfolioPage.php.

References $i, $path, $res, ilInternalLink\_extractObjIdOfTarget(), ilPageObject\buildDom(), xpath_eval(), and xpath_new_context().

367  : bool {
368  $this->buildDom();
369 
370  $changed = false;
371 
372  // resolve normal internal links
373  $xpc = xpath_new_context($this->dom);
374  $path = "//IntLink";
375  $res = xpath_eval($xpc, $path);
376  for ($i = 0, $iMax = count($res->nodeset); $i < $iMax; $i++) {
377  $target = $res->nodeset[$i]->get_attribute("Target");
378  $type = $res->nodeset[$i]->get_attribute("Type");
379  $obj_id = ilInternalLink::_extractObjIdOfTarget($target);
380  if (isset($a_title_changes[$obj_id]) && is_int(strpos($target, "__"))) {
381  if ($type == "PortfolioPage") {
382  if ($res->nodeset[$i]->get_content() == $a_title_changes[$obj_id]["old"]) {
383  $res->nodeset[$i]->set_content($a_title_changes[$obj_id]["new"]);
384  $changed = true;
385  }
386  }
387  }
388  }
389  unset($xpc);
390 
391  return $changed;
392  }
xpath_eval(php4DOMXPath $xpath_context, string $eval_str, $contextnode=null)
$res
Definition: ltiservices.php:69
buildDom(bool $a_force=false)
$path
Definition: ltiservices.php:32
xpath_new_context($dom_document)
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ setOrderNr()

ilPortfolioPage::setOrderNr ( int  $a_val)

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

Referenced by create(), and read().

79  : void
80  {
81  $this->order_nr = $a_val;
82  }
+ Here is the caller graph for this function:

◆ setPortfolioId()

ilPortfolioPage::setPortfolioId ( int  $a_val)

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

Referenced by read().

39  : void
40  {
41  $this->portfolio_id = $a_val;
42  }
+ Here is the caller graph for this function:

◆ setTitle()

ilPortfolioPage::setTitle ( string  $a_title)

Definition at line 62 of file class.ilPortfolioPage.php.

Referenced by read().

62  : void
63  {
64  $this->title = $a_title;
65  }
+ Here is the caller graph for this function:

◆ setType()

ilPortfolioPage::setType ( int  $a_val)
Parameters
int$a_valself::TYPE_PAGE|self::TYPE_BLOG

Definition at line 52 of file class.ilPortfolioPage.php.

Referenced by read().

52  : void
53  {
54  $this->type = $a_val;
55  }
+ Here is the caller graph for this function:

◆ update()

ilPortfolioPage::update ( bool  $a_validate = true,
bool  $a_no_history = false 
)

Definition at line 136 of file class.ilPortfolioPage.php.

References ilPageObject\$db, ilPageObject\$id, $ilDB, ilPageObject\getId(), and getPropertiesForDB().

139  {
140  $ilDB = $this->db;
141 
142  $id = $this->getId();
143  if ($id) {
144  $fields = $this->getPropertiesForDB();
145  $ilDB->update(
146  "usr_portfolio_page",
147  $fields,
148  array("id" => array("integer", $id))
149  );
150 
151  return parent::update($a_validate, $a_no_history);
152  }
153  return false;
154  }
ilDBInterface $db
+ Here is the call graph for this function:

◆ updateInternalLinks()

static ilPortfolioPage::updateInternalLinks ( array  $a_copied_nodes,
ilObjPortfolioBase  $a_target_obj 
)
static

Update internal links, after multiple pages have been copied.

Definition at line 302 of file class.ilPortfolioPage.php.

References ilInternalLink\_extractInstOfTarget(), ilInternalLink\_extractObjIdOfTarget(), ilInternalLink\_extractTypeOfTarget(), ilObject\_lookupType(), ilPageObjectFactory\getInstance(), ilObject\getType(), and IL_INST_ID.

Referenced by ilObjPortfolioBase\clonePagesAndSettings().

305  : void {
306  $all_fixes = array();
307  $tpg = null;
308 
309  foreach ($a_copied_nodes as $original_id => $copied_id) {
310  $pid = self::findPortfolioForPage((int) $copied_id);
311 
312  //
313  // 1. Outgoing links from the copied page.
314  //
315  //$targets = ilInternalLink::_getTargetsOfSource($a_parent_type.":pg", $copied_id);
316  if ($a_target_obj->getType() === "prtf") {
317  $tpg = new ilPortfolioPage($copied_id);
318  }
319  if ($a_target_obj->getType() === "prtt") {
320  $tpg = new ilPortfolioTemplatePage($copied_id);
321  }
322  $tpg->buildDom();
323  $il = $tpg->getInternalLinks();
324  // var_dump($il);
325  $targets = array();
326  foreach ($il as $l) {
327  $targets[] = array(
328  "type" => ilInternalLink::_extractTypeOfTarget($l["Target"]),
329  "id" => ilInternalLink::_extractObjIdOfTarget($l["Target"]),
330  "inst" => (int) ilInternalLink::_extractInstOfTarget($l["Target"])
331  );
332  }
333  $fix = array();
334  foreach ($targets as $target) {
335  if (($target["inst"] == 0 || $target["inst"] = IL_INST_ID) &&
336  ($target["type"] == "ppage")) {
337  // first check, whether target is also within the copied set
338  if ($a_copied_nodes[$target["id"]] > 0) {
339  $fix[$target["id"]] = $a_copied_nodes[$target["id"]];
340  }
341  }
342  }
343  // var_dump($fix);
344  // outgoing links to be fixed
345  if (count($fix) > 0) {
346  $t = ilObject::_lookupType($pid);
347  if (is_array($all_fixes[$t . ":" . $copied_id] ?? false)) {
348  $all_fixes[$t . ":" . $copied_id] += $fix;
349  } else {
350  $all_fixes[$t . ":" . $copied_id] = $fix;
351  }
352  }
353  }
354  // var_dump($all_fixes);
355  foreach ($all_fixes as $pg => $fixes) {
356  $pg = explode(":", $pg);
357  $page = ilPageObjectFactory::getInstance($pg[0], $pg[1]);
358  if ($page->moveIntLinks($fixes)) {
359  $page->update(true, true);
360  }
361  }
362  }
const IL_INST_ID
Definition: constants.php:40
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $order_nr

int ilPortfolioPage::$order_nr
protected

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

Referenced by getOrderNr().

◆ $portfolio_id

int ilPortfolioPage::$portfolio_id
protected

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

Referenced by getPortfolioId().

◆ $title

string ilPortfolioPage::$title
protected

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

Referenced by getTitle().

◆ $type

int ilPortfolioPage::$type = 1
protected

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

Referenced by getType().

◆ TYPE_BLOG

◆ TYPE_PAGE


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