ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPortfolioPage Class Reference

Page for user portfolio. More...

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

Public Member Functions

 getParentType ()
 Get parent type. More...
 
 setPortfolioId ($a_val)
 Set portfolio id. More...
 
 getPortfolioId ()
 Get portfolio id. More...
 
 setType ($a_val)
 Set type. More...
 
 getType ()
 Get type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setOrderNr ($a_val)
 Set order nr. More...
 
 getOrderNr ()
 Get order nr. More...
 
 create ($a_import=false)
 Create new portfolio page. More...
 
 update ($a_validate=true, $a_no_history=false)
 Update page. More...
 
 read ()
 Read page data. More...
 
 delete ()
 delete portfolio page and all related data More...
 
 renameLinksOnTitleChange ($a_title_changes)
 
- Public Member Functions inherited from ilPageObject
 __construct ($a_id=0, $a_old_nr=0, $a_lang="-")
 Constructor public. More...
 
 afterConstructor ()
 After constructor. More...
 
 getParentType ()
 Get parent type. More...
 
 initPageConfig ()
 Init page config. More...
 
 setLanguage ($a_val)
 Set language. More...
 
 getLanguage ()
 Get language. More...
 
 setPageConfig ($a_val)
 Set page config object. More...
 
 getPageConfig ()
 Get page config object. More...
 
 setRenderMd5 ($a_rendermd5)
 Set Render MD5. More...
 
 getRenderMd5 ()
 Get Render MD5. More...
 
 setRenderedContent ($a_renderedcontent)
 Set Rendered Content. More...
 
 getRenderedContent ()
 Get Rendered Content. More...
 
 setRenderedTime ($a_renderedtime)
 Set Rendered Time. More...
 
 getRenderedTime ()
 Get Rendered Time. More...
 
 setLastChange ($a_lastchange)
 Set Last Change. More...
 
 getLastChange ()
 Get Last Change. More...
 
 setLastChangeUser ($a_val)
 Set last change user. More...
 
 getLastChangeUser ()
 Get last change user. More...
 
 setShowActivationInfo ($a_val)
 Set show page activation info. More...
 
 getShowActivationInfo ()
 Get show page activation info. More...
 
 read ()
 Read page data. More...
 
 buildDom ($a_force=false)
 
 freeDom ()
 
 getDom ()
 Deprecated php4DomDocument. More...
 
 getDomDoc ()
 Get dom doc (php5 dom document) More...
 
 setId ($a_id)
 set id More...
 
 getId ()
 
 setParentId ($a_id)
 
 getParentId ()
 
 addUpdateListener (&$a_object, $a_method, $a_parameters="")
 
 callUpdateListeners ()
 
 setActive ($a_active)
 set activation More...
 
 getActive ($a_check_scheduled_activation=false)
 get activation More...
 
 setActivationStart ($a_activationstart)
 Set Activation Start. More...
 
 getActivationStart ()
 Get Activation Start. More...
 
 setActivationEnd ($a_activationend)
 Set Activation End. More...
 
 getActivationEnd ()
 Get Activation End. More...
 
 getContentObject ($a_hier_id, $a_pc_id="")
 Get a content object of the page. More...
 
getContentNode ($a_hier_id, $a_pc_id="")
 Get content node from dom. More...
 
 checkForTag ($a_content_tag, $a_hier_id, $a_pc_id="")
 Get content node from dom. More...
 
 lookforhier ($a_hier_id)
 
getNode ()
 
 setXMLContent ($a_xml, $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 ($a_xml)
 append xml content to page setXMLContent must be called before and the same encoding must be used More...
 
 getXMLContent ($a_incl_head=false)
 get xml content of page More...
 
 copyXmlContent ($a_clone_mobs=false)
 Copy content of page; replace page components with copies where necessary (e.g. More...
 
 handleCopiedContent ($a_dom, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content. More...
 
 newIIMCopies ($temp_dom)
 Replaces media objects in interactive images with copies of the interactive images. More...
 
 newMobCopies ($temp_dom)
 Replaces media objects with copies. More...
 
 newQuestionCopies (&$temp_dom)
 Replaces existing question content elements with new copies. More...
 
 removeQuestions (&$temp_dom)
 Remove questions from document. More...
 
 countPageContents ()
 Remove questions from document. More...
 
 getXMLFromDom ( $a_incl_head=false, $a_append_mobs=false, $a_append_bib=false, $a_append_str="", $a_omit_pageobject_tag=false)
 get xml content of page from dom (use this, if any changes are made to the document) More...
 
 getLanguageVariablesXML ()
 Get language variables as XML. More...
 
 appendLangVarXML (&$xml, $var)
 
 getFirstParagraphText ()
 
 setParagraphContent ($a_hier_id, $a_content)
 Set content of paragraph. More...
 
 setContainsIntLink ($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) 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 ($a_val)
 Set import mode. More...
 
 getImportMode ()
 Get import mode. More...
 
 needsImportParsing ($a_parse="")
 
 setContainsQuestion ($a_val)
 Set contains question. More...
 
 getContainsQuestion ()
 Get contains question. More...
 
 collectMediaObjects ($a_inline_only=true)
 get all media objects, that are referenced and used within the page More...
 
 getInternalLinks ($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 ($a_mob_id, $a_nr=1)
 get complete media object (alias) element More...
 
 validateDom ()
 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 ($a_pc_ids)
 Get hier ids for a set of pc ids. More...
 
 addFileSizes ()
 add file sizes More...
 
 resolveIntLinks ($a_link_map=null)
 Resolves all internal link targets of the page, if targets are available (after import) More...
 
 resolveMediaAliases ($a_mapping, $a_reuse_existing_by_import=false)
 Resolve media aliases (after import) More...
 
 resolveIIMMediaAliases ($a_mapping)
 Resolve iim media aliases (in ilContObjParse) More...
 
 resolveFileItems ($a_mapping)
 Resolve file items (after import) More...
 
 resolveQuestionReferences ($a_mapping)
 Resolve all quesion references (after import) More...
 
 moveIntLinks ($a_from_to)
 Move internal links from one destination to another. More...
 
 handleImportRepositoryLink ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 
 handleRepositoryLinksOnCopy ($a_mapping, $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. More...
 
 afterUpdate ()
 After update. More...
 
 update ($a_validate=true, $a_no_history=false)
 update complete page content in db (dom xml content is used) More...
 
 delete ()
 delete page object More...
 
 saveStyleUsage ($a_domdoc, $a_old_nr=0)
 Save all style class/template usages. More...
 
 deleteStyleUsages ($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 ($a_domdoc)
 save internal links of page More...
 
 create ()
 create new page (with current xml data) More...
 
 deleteContent ($a_hid, $a_update=true, $a_pcid="")
 delete content object with hierarchical id $a_hid More...
 
 deleteContents ($a_hids, $a_update=true, $a_self_ass=false)
 Delete multiple content objects. More...
 
 cutContents ($a_hids)
 Copy contents to clipboard and cut them from the page. More...
 
 copyContents ($a_hids)
 Copy contents to clipboard. More...
 
 pasteContents ($a_hier_id, $a_self_ass=false)
 Paste contents from pc clipboard. More...
 
 switchEnableMultiple ($a_hids, $a_update=true, $a_self_ass=false)
 (De-)activate elements More...
 
 deleteContentFromHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id >= $a_hid More...
 
 deleteContentBeforeHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id < $a_hid More...
 
 insertContent (&$a_cont_obj, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent More...
 
 insertContentNode (&$a_cont_node, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent More...
 
 moveContentBefore ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 moveContentAfter ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 bbCode2XML (&$a_content)
 transforms bbCode to corresponding xml More...
 
 insertInstIntoIDs ($a_inst, $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...
 
 existsPCId ($a_pc_id)
 existsPCId More...
 
 generatePcId ($a_pc_ids=false)
 Generate new pc id. More...
 
 insertPCIds ()
 Insert Page Content IDs. More...
 
 getPageContentsHashes ()
 Get page contents hashes. More...
 
 getQuestionIds ()
 Get question ids. More...
 
 send_paragraph ($par_id, $filename)
 
 getFO ()
 get fo page content More...
 
 registerOfflineHandler ($handler)
 
 getOfflineHandler ()
 Get offline handler. More...
 
 containsDeactivatedElements ($a_content)
 Check whether content contains deactivated elements. More...
 
 getHistoryEntries ()
 Get History Entries. More...
 
 getHistoryEntry ($a_old_nr)
 Get History Entry. More...
 
 getHistoryInfo ($a_nr)
 Get information about a history entry, its predecessor and its successor. More...
 
 addChangeDivClasses ($a_hashes)
 
 compareVersion ($a_left, $a_right)
 Compares to revisions of the page. More...
 
 increaseViewCnt ()
 Increase view cnt. More...
 
 writeRenderedContent ($a_content, $a_md5)
 Write rendered content. More...
 
 containsIntLinks ($a_content)
 Check whether content contains internal links. More...
 
 performAutomaticModifications ()
 Perform automatic modifications (may be overwritten by sub classes) More...
 
 saveInitialOpenedContent ($a_type, $a_id, $a_target)
 Save initial opened content. More...
 
 getInitialOpenedContent ()
 Get initial opened content. More...
 
 beforePageContentUpdate ($a_page_content)
 Before page content update. More...
 
 copy ($a_id, $a_parent_type="", $a_parent_id=0, $a_clone_mobs=false)
 Copy page. More...
 
 copyPageToTranslation ($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 ($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...
 

Static Public Member Functions

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

Data Fields

const TYPE_PAGE = 1
 
const TYPE_BLOG = 2
 
- Data Fields inherited from ilPageObject
 $dom
 
 $xml
 
 $encoding
 
 $node
 
 $cur_dtd = "ilias_pg_5_4.dtd"
 
 $contains_int_link
 
 $needs_parsing
 
 $parent_type
 
 $parent_id
 
 $update_listeners
 
 $update_listener_cnt
 
 $offline_handler
 
 $dom_builded
 
 $history_saved
 

Protected Member Functions

 getPropertiesForDB ()
 Get properties for insert/update statements. More...
 
- Protected Member Functions inherited from ilPageObject
 __afterUpdate ($a_domdoc, $a_xml, $a_creation=false, $a_empty=false)
 After update event handler (internal). More...
 
 __beforeDelete ()
 Before deletion handler (internal). More...
 
 __afterHistoryEntry ($a_old_domdoc, $a_old_content, $a_old_nr)
 Before deletion handler (internal). More...
 

Static Protected Member Functions

static lookupProperty ($a_id, $a_prop)
 Lookup portfolio page property. More...
 

Protected Attributes

 $portfolio_id
 
 $type = 1
 
 $title
 
 $order_nr
 
- Protected Attributes inherited from ilPageObject
 $obj_definition
 
 $db
 
 $user
 
 $lng
 
 $tree
 
 $id
 
 $language = "-"
 
 $import_mode = false
 
 $log
 
 $page_record = array()
 
 $active = false
 
 $page_config
 

Additional Inherited Members

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

Detailed Description

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
Version
$Id$

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

Member Function Documentation

◆ create()

ilPortfolioPage::create (   $a_import = false)

Create new portfolio page.

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

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

159  {
160  $ilDB = $this->db;
161 
162  if (!$a_import) {
163  $this->setOrderNr(self::lookupMaxOrderNr($this->portfolio_id) + 10);
164  }
165 
166  $id = $ilDB->nextId("usr_portfolio_page");
167  $this->setId($id);
168 
169  $fields = $this->getPropertiesForDB();
170  $fields["id"] = array("integer", $id);
171 
172  $ilDB->insert("usr_portfolio_page", $fields);
173 
174  if (!$a_import) {
175  parent::create();
176  // $this->saveInternalLinks($this->getDomDoc());
177  }
178  }
getPropertiesForDB()
Get properties for insert/update statements.
setId($a_id)
set id
global $ilDB
setOrderNr($a_val)
Set order nr.
+ Here is the call graph for this function:

◆ delete()

ilPortfolioPage::delete ( )

delete portfolio page and all related data

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

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

229  {
230  $ilDB = $this->db;
231 
232  $id = $this->getId();
233  if ($id) {
234  // delete internal links information to this page
235  include_once("./Services/Link/classes/class.ilInternalLink.php");
237 
238  // delete record of table usr_portfolio_page
239  $query = "DELETE FROM usr_portfolio_page" .
240  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
241  $ilDB->manipulate($query);
242 
243  // delete co page
244  parent::delete();
245  }
246  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ findPortfolioForPage()

static ilPortfolioPage::findPortfolioForPage (   $a_page_id)
static

Get portfolio id of page id.

Parameters
int$a_page_id
Returns
int

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

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

336  {
337  return self::lookupProperty($a_page_id, "portfolio_id");
338  }
+ Here is the caller graph for this function:

◆ fixOrdering()

static ilPortfolioPage::fixOrdering (   $a_portfolio_id)
static

Fix ordering.

Parameters
int$a_portfolio_id

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

References $DIC, and $ilDB.

Referenced by ilObjPortfolioBaseGUI\savePortfolioPagesOrdering().

312  {
313  global $DIC;
314 
315  $ilDB = $DIC->database();
316 
317  $pages = self::getAllPortfolioPages($a_portfolio_id);
318  $cnt = 10;
319  foreach ($pages as $p) {
320  $ilDB->manipulate(
321  "UPDATE usr_portfolio_page SET " .
322  " order_nr = " . $ilDB->quote($cnt, "integer") .
323  " WHERE id = " . $ilDB->quote($p["id"], "integer")
324  );
325  $cnt += 10;
326  }
327  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ getAllPortfolioPages()

static ilPortfolioPage::getAllPortfolioPages (   $a_portfolio_id)
static

Get pages of portfolio.

Parameters
int$a_portfolio_id
Returns
array

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

References $DIC, $ilDB, and ilPageObject\$lng.

Referenced by ilObjPortfolioBase\clonePagesAndSettings(), ilObjPortfolioGUI\createPortfolioFromAssignment(), ilObjPortfolioGUI\createPortfolioFromTemplateProcess(), ilObjPortfolioTemplate\deleteAllPages(), ilObjPortfolio\deleteAllPages(), ilObjPortfolioTemplate\doCloneObject(), ilPortfolioHTMLExport\exportHTMLPages(), ilObjPortfolioBase\fixLinksOnTitleChange(), ilPortfolioPageTableGUI\getItems(), ilPortfolioExporter\getXmlExportTailDependencies(), ilObjPortfolioGUI\initCreatePortfolioFromTemplateForm(), ilObjPortfolioGUI\initPDFSelectionForm(), ilObjPortfolioBaseGUI\preview(), ilObjPortfolioGUI\printView(), and ilInternalLinkGUI\showLinkHelp().

285  {
286  global $DIC;
287 
288  $ilDB = $DIC->database();
289  $lng = $DIC->language();
290 
291  $set = $ilDB->query("SELECT * FROM usr_portfolio_page" .
292  " WHERE portfolio_id = " . $ilDB->quote($a_portfolio_id, "integer") .
293  " ORDER BY order_nr");
294  $pages = array();
295  while ($rec = $ilDB->fetchAssoc($set)) {
296  // because of migration of extended user profiles
297  if ($rec["title"] == "###-") {
298  $rec["title"] = $lng->txt("profile");
299  }
300 
301  $pages[] = $rec;
302  }
303  return $pages;
304  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ getGotoForPortfolioPageTarget()

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

Get goto href for internal wiki page link target.

Parameters

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

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

Referenced by ilPageObjectGUI\setDefaultLinkXml().

347  {
348  global $DIC;
349 
350  $pid = self::findPortfolioForPage((int) $a_target);
352  if ($type == "prtt") {
353  $ctrl = $DIC->ctrl();
354  $ctrl->setParameterByClass("ilobjportfoliotemplategui", "user_page", $a_target);
355  $href = $ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjPortfolioTemplateGUI", "ilobjportfoliotemplategui"), "preview");
356  } else {
357  if (!$a_offline) {
358  $href = "./goto.php?client_id=" . CLIENT_ID . "&amp;target=prtf_" . $pid . "_" . $a_target;
359  } else {
360  $href = "prtf_" . $a_target . ".html";
361  }
362  }
363  return $href;
364  }
global $DIC
Definition: saml.php:7
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrderNr()

ilPortfolioPage::getOrderNr ( )

Get order nr.

Returns
int order nr

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

References $order_nr.

Referenced by getPropertiesForDB().

118  {
119  return $this->order_nr;
120  }
+ Here is the caller graph for this function:

◆ getPagesForBlog()

static ilPortfolioPage::getPagesForBlog (   $a_blog_id)
static

Get portfolio pages for blog.

Parameters
int$a_blog_id
Returns
ilPortfolioPage[]

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

References $DIC, and $ilDB.

Referenced by ilPortfolioPageAction\deletePagesOfBlog().

466  {
467  global $DIC;
468 
469  $ilDB = $DIC->database();
470 
471  $set = $ilDB->query("SELECT * FROM usr_portfolio_page" .
472  " WHERE title = " . $ilDB->quote($a_blog_id, "text") .
473  " AND type = " . $ilDB->quote(self::TYPE_BLOG, "integer"));
474  $pages = array();
475  while ($rec = $ilDB->fetchAssoc($set)) {
476  $pages[] = new ilPortfolioPage($rec["id"]);
477  }
478  return $pages;
479  }
global $DIC
Definition: saml.php:7
Page for user portfolio.
global $ilDB
+ Here is the caller graph for this function:

◆ getParentType()

ilPortfolioPage::getParentType ( )

Get parent type.

Returns
string parent type

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

31  {
32  return "prtf";
33  }

◆ getPortfolioId()

ilPortfolioPage::getPortfolioId ( )

Get portfolio id.

Returns
int portfolio id

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

References $portfolio_id.

51  {
52  return $this->portfolio_id;
53  }

◆ getPropertiesForDB()

ilPortfolioPage::getPropertiesForDB ( )
protected

Get properties for insert/update statements.

Returns
array

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

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

Referenced by create(), and update().

146  {
147  $fields = array("portfolio_id" => array("integer", $this->portfolio_id),
148  "type" => array("integer", $this->getType()),
149  "title" => array("text", $this->getTitle()),
150  "order_nr" => array("integer", $this->getOrderNr()));
151 
152  return $fields;
153  }
getOrderNr()
Get order nr.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitle()

ilPortfolioPage::getTitle ( )

Get Title.

Returns
string Title

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

References ilPageObject\$lng, and $title.

Referenced by getPropertiesForDB().

91  {
92  $lng = $this->lng;
93 
94  // because of migration of extended user profiles
95  if ($this->title == "###-") {
96  return $lng->txt("profile");
97  }
98 
99  return $this->title;
100  }
+ Here is the caller graph for this function:

◆ getType()

◆ lookupMaxOrderNr()

static ilPortfolioPage::lookupMaxOrderNr (   $a_portfolio_id)
static

Lookup max order nr for portfolio.

Parameters
int$a_portfolio_id
Returns
int

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

References $DIC, and $ilDB.

129  {
130  global $DIC;
131 
132  $ilDB = $DIC->database();
133 
134  $set = $ilDB->query("SELECT MAX(order_nr) m FROM usr_portfolio_page" .
135  " WHERE portfolio_id = " . $ilDB->quote($a_portfolio_id, "integer"));
136  $rec = $ilDB->fetchAssoc($set);
137  return (int) $rec["m"];
138  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ lookupProperty()

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

Lookup portfolio page property.

Parameters
int$a_id
string$a_prop
Returns
mixed

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

References $DIC, and $ilDB.

256  {
257  global $DIC;
258 
259  $ilDB = $DIC->database();
260 
261  $set = $ilDB->query("SELECT " . $a_prop .
262  " FROM usr_portfolio_page" .
263  " WHERE id = " . $ilDB->quote($a_id, "integer"));
264  $rec = $ilDB->fetchAssoc($set);
265  return $rec[$a_prop];
266  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ lookupTitle()

static ilPortfolioPage::lookupTitle (   $a_page_id)
static

Lookup title.

Parameters
int$a_page_id

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

274  {
275  return self::lookupProperty($a_page_id, "title");
276  }

◆ read()

ilPortfolioPage::read ( )

Read page data.

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

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

208  {
209  $ilDB = $this->db;
210 
211  $query = "SELECT * FROM usr_portfolio_page" .
212  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
213  $set = $ilDB->query($query);
214  $rec = $ilDB->fetchAssoc($set);
215 
216  $this->setPortfolioId($rec["portfolio_id"]);
217  $this->setType($rec["type"]);
218  $this->setTitle($rec["title"]);
219  $this->setOrderNr($rec["order_nr"]);
220 
221  // get co page
222  parent::read();
223  }
setTitle($a_title)
Set Title.
setPortfolioId($a_val)
Set portfolio id.
$query
global $ilDB
setOrderNr($a_val)
Set order nr.
setType($a_val)
Set type.
+ Here is the call graph for this function:

◆ renameLinksOnTitleChange()

ilPortfolioPage::renameLinksOnTitleChange (   $a_title_changes)
Parameters
$a_title_changes

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

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

432  {
433  $this->buildDom();
434 
435  $changed = false;
436 
437  // resolve normal internal links
438  $xpc = xpath_new_context($this->dom);
439  $path = "//IntLink";
440  $res = xpath_eval($xpc, $path);
441  for ($i = 0; $i < count($res->nodeset); $i++) {
442  $target = $res->nodeset[$i]->get_attribute("Target");
443  $type = $res->nodeset[$i]->get_attribute("Type");
445  if (isset($a_title_changes[$obj_id]) && is_int(strpos($target, "__"))) {
446  if ($type == "PortfolioPage") {
447  if ($res->nodeset[$i]->get_content() == $a_title_changes[$obj_id]["old"]) {
448  $res->nodeset[$i]->set_content($a_title_changes[$obj_id]["new"]);
449  $changed = true;
450  }
451  }
452  }
453  }
454  unset($xpc);
455 
456  return $changed;
457  }
buildDom($a_force=false)
$path
Definition: aliased.php:25
xpath_new_context($dom_document)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
foreach($_POST as $key=> $value) $res
$i
Definition: disco.tpl.php:19
$target
Definition: test.php:19
+ Here is the call graph for this function:

◆ setOrderNr()

ilPortfolioPage::setOrderNr (   $a_val)

Set order nr.

Parameters
intorder nr

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

Referenced by create(), and read().

108  {
109  $this->order_nr = (int) $a_val;
110  }
+ Here is the caller graph for this function:

◆ setPortfolioId()

ilPortfolioPage::setPortfolioId (   $a_val)

Set portfolio id.

Parameters
int$a_valportfolio id

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

Referenced by read().

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

◆ setTitle()

ilPortfolioPage::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle

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

Referenced by read().

81  {
82  $this->title = $a_title;
83  }
+ Here is the caller graph for this function:

◆ setType()

ilPortfolioPage::setType (   $a_val)

Set type.

Parameters
inttype

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

Referenced by read().

61  {
62  $this->type = $a_val;
63  }
+ Here is the caller graph for this function:

◆ update()

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

Update page.

Returns
boolean

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

References ilPageObject\$db, ilPageObject\$id, $ilDB, ilPageObject\getId(), getPropertiesForDB(), and League\Flysystem\Adapter\Polyfill\update().

186  {
187  $ilDB = $this->db;
188 
189  $id = $this->getId();
190  if ($id) {
191  $fields = $this->getPropertiesForDB();
192  $ilDB->update(
193  "usr_portfolio_page",
194  $fields,
195  array("id" => array("integer", $id))
196  );
197 
198  parent::update($a_validate, $a_no_history);
199  return true;
200  }
201  return false;
202  }
getPropertiesForDB()
Get properties for insert/update statements.
update($pash, $contents, Config $config)
global $ilDB
+ Here is the call graph for this function:

◆ updateInternalLinks()

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

Update internal links, after multiple pages have been copied.

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

References $l, $t, $target, ilInternalLink\_extractInstOfTarget(), ilInternalLink\_extractObjIdOfTarget(), ilInternalLink\_extractTypeOfTarget(), ilObject\_lookupType(), ilPageObjectFactory\getInstance(), and ilObject2\getType().

Referenced by ilObjPortfolioBase\clonePagesAndSettings().

370  {
371  // var_dump($a_copied_nodes);
372  $all_fixes = array();
373  foreach ($a_copied_nodes as $original_id => $copied_id) {
374  $pid = self::findPortfolioForPage((int) $copied_id);
375 
376  //
377  // 1. Outgoing links from the copied page.
378  //
379  //$targets = ilInternalLink::_getTargetsOfSource($a_parent_type.":pg", $copied_id);
380  if ($a_target_obj->getType() == "prtf") {
381  $tpg = new ilPortfolioPage($copied_id);
382  }
383  if ($a_target_obj->getType() == "prtt") {
384  $tpg = new ilPortfolioTemplatePage($copied_id);
385  }
386  $tpg->buildDom();
387  $il = $tpg->getInternalLinks();
388  // var_dump($il);
389  $targets = array();
390  foreach ($il as $l) {
391  $targets[] = array("type" => ilInternalLink::_extractTypeOfTarget($l["Target"]),
392  "id" => (int) ilInternalLink::_extractObjIdOfTarget($l["Target"]),
393  "inst" => (int) ilInternalLink::_extractInstOfTarget($l["Target"]));
394  }
395  $fix = array();
396  foreach ($targets as $target) {
397  if (($target["inst"] == 0 || $target["inst"] = IL_INST_ID) &&
398  ($target["type"] == "ppage")) {
399  // first check, whether target is also within the copied set
400  if ($a_copied_nodes[$target["id"]] > 0) {
401  $fix[$target["id"]] = $a_copied_nodes[$target["id"]];
402  }
403  }
404  }
405  // var_dump($fix);
406  // outgoing links to be fixed
407  if (count($fix) > 0) {
408  $t = ilObject::_lookupType($pid);
409  if (is_array($all_fixes[$t . ":" . $copied_id])) {
410  $all_fixes[$t . ":" . $copied_id] += $fix;
411  } else {
412  $all_fixes[$t . ":" . $copied_id] = $fix;
413  }
414  }
415  }
416  // var_dump($all_fixes);
417  foreach ($all_fixes as $pg => $fixes) {
418  $pg = explode(":", $pg);
419  include_once("./Services/COPage/classes/class.ilPageObjectFactory.php");
420  $page = ilPageObjectFactory::getInstance($pg[0], $pg[1]);
421  if ($page->moveIntLinks($fixes)) {
422  $page->update(true, true);
423  }
424  }
425  }
Page for user portfolio.
Page for portfolio template.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
global $l
Definition: afr.php:30
$target
Definition: test.php:19
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $order_nr

ilPortfolioPage::$order_nr
protected

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

Referenced by getOrderNr().

◆ $portfolio_id

ilPortfolioPage::$portfolio_id
protected

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

Referenced by getPortfolioId().

◆ $title

ilPortfolioPage::$title
protected

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

Referenced by getTitle().

◆ $type

ilPortfolioPage::$type = 1
protected

◆ TYPE_BLOG

◆ TYPE_PAGE


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