ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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

 afterConstructor ()
 
 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="-")
 
 setContentIdManager (\ILIAS\COPage\ID\ContentIdManager $content_id_manager)
 
 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 ()
 
 getDomDoc ()
 Get dom doc (DOMDocument) More...
 
 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...
 
 getContentDomNode (string $a_hier_id, string $a_pc_id="")
 
 getDomNodeForPCId (string $pc_id)
 
 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...
 
 handleDeleteContent (?DOMNode $a_node=null, $move_operation=false)
 Handle content before deletion This currently treats only plugged content If no node is given, then the whole dom will be scanned. More...
 
 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)
 
 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 ()
 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 ()
 
 stripHierIDs ()
 
 stripPCIDs ()
 
 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...
 
 handleRepositoryLinksOnCopy (array $a_mapping, int $a_source_ref_id)
 Handle repository links on copy process. More...
 
 setEmptyPageXml ()
 
 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...
 
 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 (DOMNode $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...
 
 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...
 
 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...
 
 generatePCId ()
 
 insertPCIds ()
 Insert Page Content IDs. More...
 
 sendParagraph (string $par_id, string $filename)
 
 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...
 
 preparePageForCompare (ilPageObject $page)
 
 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, bool $overwrite_existing=true)
 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 ()
 
 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 _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 _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
 
DOMDocument $dom = null
 
string $xml = ""
 
string $encoding = ""
 
DomNode $node
 
string $cur_dtd = "ilias_pg_9.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
 getIliasAbsolutePath ()
 
 getLangVarXML (string $var)
 
 __afterUpdate (DOMDocument $a_domdoc, string $a_xml, bool $a_creation=false, bool $a_empty=false)
 After update event handler (internal). More...
 
 isTranslationPage ()
 
 __beforeDelete ()
 Before deletion handler (internal). More...
 
 __afterDelete ()
 
 afterDelete ()
 
 __afterHistoryEntry (DOMDocument $a_old_domdoc, string $a_old_content, int $a_old_nr)
 
 getContentManager ()
 
 setCopyProperties (ilPageObject $new_page)
 
 setTranslationProperties (self $transl_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
ILIAS COPage Dom DomUtil $dom_util
 
ILIAS COPage Link LinkManager $link
 
ILIAS COPage PC PCDefinition $pc_definition
 
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 = []
 
string $activationstart = null
 
string $activationend = null
 
ILIAS COPage ReadingTime ReadingTimeManager $reading_time_manager
 
 $concrete_lang = ""
 
ILIAS COPage ID ContentIdManager $content_id_manager
 
ILIAS COPage Page PageManager $page_manager
 
ILIAS COPage Style StyleManager $style_manager
 
ILIAS COPage PC DomainService $pc_service
 

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

◆ afterConstructor()

ilPortfolioPage::afterConstructor ( )

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

References $DIC.

34  : void
35  {
36  global $DIC;
37  $this->dom_util = $DIC->copage()->internal()->domain()->domUtil();
38  }
global $DIC
Definition: feed.php:28

◆ create()

ilPortfolioPage::create ( bool  $a_import = false)

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

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

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

◆ delete()

ilPortfolioPage::delete ( )

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

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

180  : void
181  {
182  $ilDB = $this->db;
183 
184  $id = $this->getId();
185  if ($id) {
186  // delete internal links information to this page
188 
189  // delete record of table usr_portfolio_page
190  $query = "DELETE FROM usr_portfolio_page" .
191  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
192  $ilDB->manipulate($query);
193 
194  // delete co page
195  parent::delete();
196  }
197  }
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 272 of file class.ilPortfolioPage.php.

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

272  : int
273  {
274  return (int) self::lookupProperty($a_page_id, "portfolio_id");
275  }
+ Here is the caller graph for this function:

◆ fixOrdering()

static ilPortfolioPage::fixOrdering ( int  $a_portfolio_id)
static

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

References $DIC, and $ilDB.

Referenced by ilObjPortfolioBaseGUI\savePortfolioPagesOrdering().

252  : void {
253  global $DIC;
254 
255  $ilDB = $DIC->database();
256 
257  $pages = self::getAllPortfolioPages($a_portfolio_id);
258  $cnt = 10;
259  foreach ($pages as $p) {
260  $ilDB->manipulate(
261  "UPDATE usr_portfolio_page SET " .
262  " order_nr = " . $ilDB->quote($cnt, "integer") .
263  " WHERE id = " . $ilDB->quote($p["id"], "integer")
264  );
265  $cnt += 10;
266  }
267  }
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 227 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(), ilPortfolioExerciseGUI\getActionButtons(), ilObjPortfolioBaseGUI\getCurrentPage(), ilPortfolioPageTableGUI\getItems(), ILIAS\Portfolio\PortfolioPrintViewProviderGUI\getPages(), ILIAS\Portfolio\PortfolioPrintViewProviderGUI\getSelectionForm(), ilPortfolioExporter\getXmlExportTailDependencies(), ilObjPortfolioGUI\initCreatePortfolioFromTemplateForm(), ilInternalLinkGUI\showLinkHelp(), and ilObjPortfolioBaseGUI\view().

229  : array {
230  global $DIC;
231 
232  $ilDB = $DIC->database();
233  $lng = $DIC->language();
234 
235  $set = $ilDB->query("SELECT * FROM usr_portfolio_page" .
236  " WHERE portfolio_id = " . $ilDB->quote($a_portfolio_id, "integer") .
237  " ORDER BY order_nr");
238  $pages = array();
239  while ($rec = $ilDB->fetchAssoc($set)) {
240  // because of migration of extended user profiles
241  if ($rec["title"] == "###-") {
242  $rec["title"] = $lng->txt("profile");
243  }
244 
245  $pages[] = $rec;
246  }
247  return $pages;
248  }
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 280 of file class.ilPortfolioPage.php.

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

Referenced by ilPageLinker\getLinkXML().

283  : string {
284  global $DIC;
285 
286  $pid = self::findPortfolioForPage($a_target);
288  if ($type === "prtt") {
289  $ctrl = $DIC->ctrl();
290  $ctrl->setParameterByClass("ilobjportfoliotemplategui", "user_page", $a_target);
291  $href = $ctrl->getLinkTargetByClass(array(
292  "ilRepositoryGUI",
293  "ilObjPortfolioTemplateGUI"
294  ), "preview", "", false, true);
295  } else {
296  if (!$a_offline) {
297  $href = "./goto.php?client_id=" . CLIENT_ID . "&amp;target=prtf_" . $pid . "_" . $a_target;
298  } else {
299  $href = "prtf_" . $a_target . ".html";
300  }
301  }
302  return $href;
303  }
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 90 of file class.ilPortfolioPage.php.

References $order_nr.

Referenced by getPropertiesForDB().

90  : int
91  {
92  return $this->order_nr;
93  }
+ 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 404 of file class.ilPortfolioPage.php.

References $DIC, and $ilDB.

Referenced by ilPortfolioPageAction\deletePagesOfBlog().

406  : array {
407  global $DIC;
408 
409  $ilDB = $DIC->database();
410 
411  $set = $ilDB->query("SELECT * FROM usr_portfolio_page" .
412  " WHERE title = " . $ilDB->quote($a_blog_id, "text") .
413  " AND type = " . $ilDB->quote(self::TYPE_BLOG, "integer"));
414  $pages = array();
415  while ($rec = $ilDB->fetchAssoc($set)) {
416  $pages[] = new ilPortfolioPage($rec["id"]);
417  }
418  return $pages;
419  }
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 40 of file class.ilPortfolioPage.php.

40  : string
41  {
42  return "prtf";
43  }

◆ getPortfolioId()

ilPortfolioPage::getPortfolioId ( )

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

References $portfolio_id.

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

◆ getPropertiesForDB()

ilPortfolioPage::getPropertiesForDB ( )
protected

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

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

Referenced by create(), and update().

108  : array
109  {
110  $fields = array(
111  "portfolio_id" => array("integer", $this->portfolio_id),
112  "type" => array("integer", $this->getType()),
113  "title" => array("text", $this->getTitle()),
114  "order_nr" => array("integer", $this->getOrderNr())
115  );
116 
117  return $fields;
118  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitle()

ilPortfolioPage::getTitle ( )

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

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

Referenced by getPropertiesForDB().

73  : string
74  {
75  $lng = $this->lng;
76 
77  // because of migration of extended user profiles
78  if ($this->title === "###-") {
79  return $lng->txt("profile");
80  }
81 
82  return $this->title;
83  }
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 63 of file class.ilPortfolioPage.php.

References $type.

Referenced by getPropertiesForDB().

63  : int
64  {
65  return $this->type;
66  }
+ Here is the caller graph for this function:

◆ lookupMaxOrderNr()

static ilPortfolioPage::lookupMaxOrderNr ( int  $a_portfolio_id)
static

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

References $DIC, and $ilDB.

97  : int {
98  global $DIC;
99 
100  $ilDB = $DIC->database();
101 
102  $set = $ilDB->query("SELECT MAX(order_nr) m FROM usr_portfolio_page" .
103  " WHERE portfolio_id = " . $ilDB->quote($a_portfolio_id, "integer"));
104  $rec = $ilDB->fetchAssoc($set);
105  return (int) $rec["m"];
106  }
global $DIC
Definition: feed.php:28

◆ lookupProperty()

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

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

References $DIC, and $ilDB.

202  : string {
203  global $DIC;
204 
205  $ilDB = $DIC->database();
206 
207  $set = $ilDB->query("SELECT " . $a_prop .
208  " FROM usr_portfolio_page" .
209  " WHERE id = " . $ilDB->quote($a_id, "integer"));
210  $rec = $ilDB->fetchAssoc($set);
211  return (string) ($rec[$a_prop] ?? "");
212  }
global $DIC
Definition: feed.php:28

◆ lookupTitle()

static ilPortfolioPage::lookupTitle ( int  $a_page_id)
static

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

214  : string
215  {
216  return self::lookupProperty($a_page_id, "title");
217  }

◆ lookupType()

static ilPortfolioPage::lookupType (   $a_page_id)
static

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

Referenced by ilObjPortfolioBaseGUI\showEditButton().

219  : int
220  {
221  return (int) self::lookupProperty($a_page_id, "type");
222  }
+ Here is the caller graph for this function:

◆ read()

ilPortfolioPage::read ( )

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

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

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

◆ renameLinksOnTitleChange()

ilPortfolioPage::renameLinksOnTitleChange ( array  $a_title_changes)

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

References ilPageObject\$node, $path, ilInternalLink\_extractObjIdOfTarget(), ilPageObject\buildDom(), and ilPageObject\getDomDoc().

373  : bool {
374  $this->buildDom();
375 
376  $changed = false;
377 
378  // resolve normal internal links
379  $path = "//IntLink";
380  $nodes = $this->dom_util->path($this->getDomDoc(), $path);
381  foreach ($nodes as $node) {
382  $target = $node->getAttribute("Target");
383  $type = $node->getAttribute("Type");
384  $obj_id = ilInternalLink::_extractObjIdOfTarget($target);
385  if (isset($a_title_changes[$obj_id]) && is_int(strpos($target, "__"))) {
386  if ($type == "PortfolioPage") {
387  if ($this->dom_util->getContent($node) == $a_title_changes[$obj_id]["old"]) {
388  $this->dom_util->setContent($node, $a_title_changes[$obj_id]["new"]);
389  $changed = true;
390  }
391  }
392  }
393  }
394 
395  return $changed;
396  }
buildDom(bool $a_force=false)
getDomDoc()
Get dom doc (DOMDocument)
$path
Definition: ltiservices.php:32
+ Here is the call graph for this function:

◆ setOrderNr()

ilPortfolioPage::setOrderNr ( int  $a_val)

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

Referenced by create(), and read().

85  : void
86  {
87  $this->order_nr = $a_val;
88  }
+ Here is the caller graph for this function:

◆ setPortfolioId()

ilPortfolioPage::setPortfolioId ( int  $a_val)

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

Referenced by read().

45  : void
46  {
47  $this->portfolio_id = $a_val;
48  }
+ Here is the caller graph for this function:

◆ setTitle()

ilPortfolioPage::setTitle ( string  $a_title)

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

Referenced by read().

68  : void
69  {
70  $this->title = $a_title;
71  }
+ 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 58 of file class.ilPortfolioPage.php.

Referenced by read().

58  : void
59  {
60  $this->type = $a_val;
61  }
+ Here is the caller graph for this function:

◆ update()

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

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

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

145  {
146  $ilDB = $this->db;
147 
148  $id = $this->getId();
149  if ($id) {
150  $fields = $this->getPropertiesForDB();
151  $ilDB->update(
152  "usr_portfolio_page",
153  $fields,
154  array("id" => array("integer", $id))
155  );
156 
157  return parent::update($a_validate, $a_no_history);
158  }
159  return false;
160  }
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 308 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().

311  : void {
312  $all_fixes = array();
313  $tpg = null;
314 
315  foreach ($a_copied_nodes as $original_id => $copied_id) {
316  $pid = self::findPortfolioForPage((int) $copied_id);
317 
318  //
319  // 1. Outgoing links from the copied page.
320  //
321  //$targets = ilInternalLink::_getTargetsOfSource($a_parent_type.":pg", $copied_id);
322  if ($a_target_obj->getType() === "prtf") {
323  $tpg = new ilPortfolioPage($copied_id);
324  }
325  if ($a_target_obj->getType() === "prtt") {
326  $tpg = new ilPortfolioTemplatePage($copied_id);
327  }
328  $tpg->buildDom();
329  $il = $tpg->getInternalLinks();
330  // var_dump($il);
331  $targets = array();
332  foreach ($il as $l) {
333  $targets[] = array(
334  "type" => ilInternalLink::_extractTypeOfTarget($l["Target"]),
335  "id" => ilInternalLink::_extractObjIdOfTarget($l["Target"]),
336  "inst" => (int) ilInternalLink::_extractInstOfTarget($l["Target"])
337  );
338  }
339  $fix = array();
340  foreach ($targets as $target) {
341  if (($target["inst"] == 0 || $target["inst"] = IL_INST_ID) &&
342  ($target["type"] == "ppage")) {
343  // first check, whether target is also within the copied set
344  if ($a_copied_nodes[$target["id"]] > 0) {
345  $fix[$target["id"]] = $a_copied_nodes[$target["id"]];
346  }
347  }
348  }
349  // var_dump($fix);
350  // outgoing links to be fixed
351  if (count($fix) > 0) {
352  $t = ilObject::_lookupType($pid);
353  if (is_array($all_fixes[$t . ":" . $copied_id] ?? false)) {
354  $all_fixes[$t . ":" . $copied_id] += $fix;
355  } else {
356  $all_fixes[$t . ":" . $copied_id] = $fix;
357  }
358  }
359  }
360  // var_dump($all_fixes);
361  foreach ($all_fixes as $pg => $fixes) {
362  $pg = explode(":", $pg);
363  $page = ilPageObjectFactory::getInstance($pg[0], $pg[1]);
364  if ($page->moveIntLinks($fixes)) {
365  $page->update(true, true);
366  }
367  }
368  }
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: