ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 @access 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 lookupType ($a_page_id)
 Lookup type. 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

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

Member Function Documentation

◆ create()

ilPortfolioPage::create (   $a_import = false)

Create new portfolio page.

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

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

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

+ Here is the call graph for this function:

◆ delete()

ilPortfolioPage::delete ( )

delete portfolio page and all related data

Reimplemented from ilPageObject.

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

226 {
228
229 $id = $this->getId();
230 if ($id) {
231 // delete internal links information to this page
233
234 // delete record of table usr_portfolio_page
235 $query = "DELETE FROM usr_portfolio_page" .
236 " WHERE id = " . $ilDB->quote($this->getId(), "integer");
237 $ilDB->manipulate($query);
238
239 // delete co page
240 parent::delete();
241 }
242 }
$query

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

+ 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 343 of file class.ilPortfolioPage.php.

344 {
345 return self::lookupProperty($a_page_id, "portfolio_id");
346 }
static lookupProperty($a_id, $a_prop)
Lookup portfolio page property.

References lookupProperty().

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

+ Here is the call graph for this function:
+ 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 319 of file class.ilPortfolioPage.php.

320 {
321 global $DIC;
322
323 $ilDB = $DIC->database();
324
325 $pages = self::getAllPortfolioPages($a_portfolio_id);
326 $cnt = 10;
327 foreach ($pages as $p) {
328 $ilDB->manipulate(
329 "UPDATE usr_portfolio_page SET " .
330 " order_nr = " . $ilDB->quote($cnt, "integer") .
331 " WHERE id = " . $ilDB->quote($p["id"], "integer")
332 );
333 $cnt += 10;
334 }
335 }
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
$DIC
Definition: xapitoken.php:46

References $DIC, $ilDB, and getAllPortfolioPages().

Referenced by ilObjPortfolioBaseGUI\savePortfolioPagesOrdering().

+ Here is the call graph for this function:
+ 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 292 of file class.ilPortfolioPage.php.

293 {
294 global $DIC;
295
296 $ilDB = $DIC->database();
297 $lng = $DIC->language();
298
299 $set = $ilDB->query("SELECT * FROM usr_portfolio_page" .
300 " WHERE portfolio_id = " . $ilDB->quote($a_portfolio_id, "integer") .
301 " ORDER BY order_nr");
302 $pages = array();
303 while ($rec = $ilDB->fetchAssoc($set)) {
304 // because of migration of extended user profiles
305 if ($rec["title"] == "###-") {
306 $rec["title"] = $lng->txt("profile");
307 }
308
309 $pages[] = $rec;
310 }
311 return $pages;
312 }

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

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

+ 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

return string

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

355 {
356 global $DIC;
357
358 $pid = self::findPortfolioForPage((int) $a_target);
360 if ($type == "prtt") {
361 $ctrl = $DIC->ctrl();
362 $ctrl->setParameterByClass("ilobjportfoliotemplategui", "user_page", $a_target);
363 $href = $ctrl->getLinkTargetByClass(array(
364 "ilRepositoryGUI",
365 "ilObjPortfolioTemplateGUI",
366 "ilobjportfoliotemplategui"
367 ), "preview", "", false, true);
368 } else {
369 if (!$a_offline) {
370 $href = "./goto.php?client_id=" . CLIENT_ID . "&amp;target=prtf_" . $pid . "_" . $a_target;
371 } else {
372 $href = "prtf_" . $a_target . ".html";
373 }
374 }
375 return $href;
376 }
static _lookupType($a_id, $a_reference=false)
lookup object type
static findPortfolioForPage($a_page_id)
Get portfolio id of page id.

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

Referenced by ilPageLinker\getLinkXML().

+ 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 112 of file class.ilPortfolioPage.php.

113 {
114 return $this->order_nr;
115 }

References $order_nr.

Referenced by getPropertiesForDB().

+ 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 478 of file class.ilPortfolioPage.php.

479 {
480 global $DIC;
481
482 $ilDB = $DIC->database();
483
484 $set = $ilDB->query("SELECT * FROM usr_portfolio_page" .
485 " WHERE title = " . $ilDB->quote($a_blog_id, "text") .
486 " AND type = " . $ilDB->quote(self::TYPE_BLOG, "integer"));
487 $pages = array();
488 while ($rec = $ilDB->fetchAssoc($set)) {
489 $pages[] = new ilPortfolioPage($rec["id"]);
490 }
491 return $pages;
492 }
Page for user portfolio.

References $DIC, and $ilDB.

Referenced by ilPortfolioPageAction\deletePagesOfBlog().

+ Here is the caller graph for this function:

◆ getParentType()

ilPortfolioPage::getParentType ( )

Get parent type.

Returns
string parent type

Reimplemented from ilPageObject.

Reimplemented in ilPortfolioTemplatePage.

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

26 {
27 return "prtf";
28 }

◆ getPortfolioId()

ilPortfolioPage::getPortfolioId ( )

Get portfolio id.

Returns
int portfolio id

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

References $portfolio_id.

◆ getPropertiesForDB()

ilPortfolioPage::getPropertiesForDB ( )
protected

Get properties for insert/update statements.

Returns
array

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

141 {
142 $fields = array(
143 "portfolio_id" => array("integer", $this->portfolio_id),
144 "type" => array("integer", $this->getType()),
145 "title" => array("text", $this->getTitle()),
146 "order_nr" => array("integer", $this->getOrderNr())
147 );
148
149 return $fields;
150 }
getOrderNr()
Get order nr.

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

Referenced by create(), and update().

+ 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 85 of file class.ilPortfolioPage.php.

86 {
88
89 // because of migration of extended user profiles
90 if ($this->title == "###-") {
91 return $lng->txt("profile");
92 }
93
94 return $this->title;
95 }

References ilPageObject\$lng, and $title.

Referenced by getPropertiesForDB().

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

124 {
125 global $DIC;
126
127 $ilDB = $DIC->database();
128
129 $set = $ilDB->query("SELECT MAX(order_nr) m FROM usr_portfolio_page" .
130 " WHERE portfolio_id = " . $ilDB->quote($a_portfolio_id, "integer"));
131 $rec = $ilDB->fetchAssoc($set);
132 return (int) $rec["m"];
133 }

References $DIC, and $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 251 of file class.ilPortfolioPage.php.

252 {
253 global $DIC;
254
255 $ilDB = $DIC->database();
256
257 $set = $ilDB->query("SELECT " . $a_prop .
258 " FROM usr_portfolio_page" .
259 " WHERE id = " . $ilDB->quote($a_id, "integer"));
260 $rec = $ilDB->fetchAssoc($set);
261 return $rec[$a_prop];
262 }

References $DIC, and $ilDB.

Referenced by findPortfolioForPage(), lookupTitle(), and lookupType().

+ Here is the caller graph for this function:

◆ lookupTitle()

static ilPortfolioPage::lookupTitle (   $a_page_id)
static

Lookup title.

Parameters
$a_page_id
Returns
mixed

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

271 {
272 return self::lookupProperty($a_page_id, "title");
273 }

References lookupProperty().

+ Here is the call graph for this function:

◆ lookupType()

static ilPortfolioPage::lookupType (   $a_page_id)
static

Lookup type.

Parameters
$a_page_id
Returns
mixed

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

282 {
283 return self::lookupProperty($a_page_id, "type");
284 }

References lookupProperty().

Referenced by ilObjPortfolioBaseGUI\showEditButton().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilPortfolioPage::read ( )

Read page data.

Reimplemented from ilPageObject.

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

205 {
207
208 $query = "SELECT * FROM usr_portfolio_page" .
209 " WHERE id = " . $ilDB->quote($this->getId(), "integer");
210 $set = $ilDB->query($query);
211 $rec = $ilDB->fetchAssoc($set);
212
213 $this->setPortfolioId($rec["portfolio_id"]);
214 $this->setType($rec["type"]);
215 $this->setTitle($rec["title"]);
216 $this->setOrderNr($rec["order_nr"]);
217
218 // get co page
219 parent::read();
220 }
setPortfolioId($a_val)
Set portfolio id.
setType($a_val)
Set type.
setTitle($a_title)
Set Title.

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

+ Here is the call graph for this function:

◆ renameLinksOnTitleChange()

ilPortfolioPage::renameLinksOnTitleChange (   $a_title_changes)
Parameters
$a_title_changes

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

445 {
446 $this->buildDom();
447
448 $changed = false;
449
450 // resolve normal internal links
451 $xpc = xpath_new_context($this->dom);
452 $path = "//IntLink";
453 $res = xpath_eval($xpc, $path);
454 for ($i = 0; $i < count($res->nodeset); $i++) {
455 $target = $res->nodeset[$i]->get_attribute("Target");
456 $type = $res->nodeset[$i]->get_attribute("Type");
457 $obj_id = ilInternalLink::_extractObjIdOfTarget($target);
458 if (isset($a_title_changes[$obj_id]) && is_int(strpos($target, "__"))) {
459 if ($type == "PortfolioPage") {
460 if ($res->nodeset[$i]->get_content() == $a_title_changes[$obj_id]["old"]) {
461 $res->nodeset[$i]->set_content($a_title_changes[$obj_id]["new"]);
462 $changed = true;
463 }
464 }
465 }
466 }
467 unset($xpc);
468
469 return $changed;
470 }
buildDom($a_force=false)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
xpath_new_context($dom_document)
$i
Definition: metadata.php:24
foreach($_POST as $key=> $value) $res

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

+ Here is the call graph for this function:

◆ setOrderNr()

ilPortfolioPage::setOrderNr (   $a_val)

Set order nr.

Parameters
intorder nr

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

103 {
104 $this->order_nr = (int) $a_val;
105 }

Referenced by create(), and read().

+ Here is the caller graph for this function:

◆ setPortfolioId()

ilPortfolioPage::setPortfolioId (   $a_val)

Set portfolio id.

Parameters
int$a_valportfolio id

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

36 {
37 $this->portfolio_id = $a_val;
38 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilPortfolioPage::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle

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

76 {
77 $this->title = $a_title;
78 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setType()

ilPortfolioPage::setType (   $a_val)

Set type.

Parameters
inttype

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

56 {
57 $this->type = $a_val;
58 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

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

Update page.

Returns
boolean

Reimplemented from ilPageObject.

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

183 {
185
186 $id = $this->getId();
187 if ($id) {
188 $fields = $this->getPropertiesForDB();
189 $ilDB->update(
190 "usr_portfolio_page",
191 $fields,
192 array("id" => array("integer", $id))
193 );
194
195 parent::update($a_validate, $a_no_history);
196 return true;
197 }
198 return false;
199 }

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

+ 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 381 of file class.ilPortfolioPage.php.

382 {
383 // var_dump($a_copied_nodes);
384 $all_fixes = array();
385 foreach ($a_copied_nodes as $original_id => $copied_id) {
386 $pid = self::findPortfolioForPage((int) $copied_id);
387
388 //
389 // 1. Outgoing links from the copied page.
390 //
391 //$targets = ilInternalLink::_getTargetsOfSource($a_parent_type.":pg", $copied_id);
392 if ($a_target_obj->getType() == "prtf") {
393 $tpg = new ilPortfolioPage($copied_id);
394 }
395 if ($a_target_obj->getType() == "prtt") {
396 $tpg = new ilPortfolioTemplatePage($copied_id);
397 }
398 $tpg->buildDom();
399 $il = $tpg->getInternalLinks();
400 // var_dump($il);
401 $targets = array();
402 foreach ($il as $l) {
403 $targets[] = array(
404 "type" => ilInternalLink::_extractTypeOfTarget($l["Target"]),
405 "id" => (int) ilInternalLink::_extractObjIdOfTarget($l["Target"]),
406 "inst" => (int) ilInternalLink::_extractInstOfTarget($l["Target"])
407 );
408 }
409 $fix = array();
410 foreach ($targets as $target) {
411 if (($target["inst"] == 0 || $target["inst"] = IL_INST_ID) &&
412 ($target["type"] == "ppage")) {
413 // first check, whether target is also within the copied set
414 if ($a_copied_nodes[$target["id"]] > 0) {
415 $fix[$target["id"]] = $a_copied_nodes[$target["id"]];
416 }
417 }
418 }
419 // var_dump($fix);
420 // outgoing links to be fixed
421 if (count($fix) > 0) {
422 $t = ilObject::_lookupType($pid);
423 if (is_array($all_fixes[$t . ":" . $copied_id])) {
424 $all_fixes[$t . ":" . $copied_id] += $fix;
425 } else {
426 $all_fixes[$t . ":" . $copied_id] = $fix;
427 }
428 }
429 }
430 // var_dump($all_fixes);
431 foreach ($all_fixes as $pg => $fixes) {
432 $pg = explode(":", $pg);
433 $page = ilPageObjectFactory::getInstance($pg[0], $pg[1]);
434 if ($page->moveIntLinks($fixes)) {
435 $page->update(true, true);
436 }
437 }
438 }
getType()
get object type @access public
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
Page for portfolio template.

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

Referenced by ilObjPortfolioBase\clonePagesAndSettings().

+ 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 15 of file class.ilPortfolioPage.php.

Referenced by getOrderNr().

◆ $portfolio_id

ilPortfolioPage::$portfolio_id
protected

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

Referenced by getPortfolioId().

◆ $title

ilPortfolioPage::$title
protected

Definition at line 14 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: