ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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, bool $offline=false)
 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 (bool $offline=false)
 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 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
 
- 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
 
LOMServices $lom_services
 
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 33 of file class.ilPortfolioPage.php.

References $DIC.

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

◆ create()

ilPortfolioPage::create ( bool  $a_import = false)

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

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

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

◆ delete()

ilPortfolioPage::delete ( )

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

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

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

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

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

◆ fixOrdering()

static ilPortfolioPage::fixOrdering ( int  $a_portfolio_id)
static

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

References $DIC, and $ilDB.

Referenced by ilObjPortfolioBaseGUI\savePortfolioPagesOrdering().

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

◆ getAllPortfolioPages()

static ilPortfolioPage::getAllPortfolioPages ( int  $a_portfolio_id)
static

Get pages of portfolio.

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

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

Referenced by ilObjPortfolioBase\clonePagesAndSettings(), ilObjPortfolioGUI\createPortfolioFromAssignment(), ilObjPortfolio\deleteAllPages(), ilObjPortfolioTemplate\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().

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

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

Referenced by ilPageLinker\getLinkXML().

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

References $order_nr.

Referenced by getPropertiesForDB().

89  : int
90  {
91  return $this->order_nr;
92  }
+ Here is the caller graph for this function:

◆ getParentType()

ilPortfolioPage::getParentType ( )

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

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

◆ getPortfolioId()

ilPortfolioPage::getPortfolioId ( )

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

References $portfolio_id.

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

◆ getPropertiesForDB()

ilPortfolioPage::getPropertiesForDB ( )
protected

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

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

Referenced by create(), and update().

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

◆ getTitle()

ilPortfolioPage::getTitle ( )

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

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

Referenced by getPropertiesForDB().

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

References $type.

Referenced by getPropertiesForDB().

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

◆ lookupMaxOrderNr()

static ilPortfolioPage::lookupMaxOrderNr ( int  $a_portfolio_id)
static

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

References $DIC, and $ilDB.

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

◆ lookupProperty()

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

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

References $DIC, and $ilDB.

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

◆ lookupTitle()

static ilPortfolioPage::lookupTitle ( int  $a_page_id)
static

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

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

◆ lookupType()

static ilPortfolioPage::lookupType (   $a_page_id)
static

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

Referenced by ilObjPortfolioBaseGUI\showEditButton().

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

◆ read()

ilPortfolioPage::read ( )

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

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

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

◆ renameLinksOnTitleChange()

ilPortfolioPage::renameLinksOnTitleChange ( array  $a_title_changes)

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

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

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

◆ setOrderNr()

ilPortfolioPage::setOrderNr ( int  $a_val)

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

Referenced by create(), and read().

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

◆ setPortfolioId()

ilPortfolioPage::setPortfolioId ( int  $a_val)

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

Referenced by read().

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

◆ setTitle()

ilPortfolioPage::setTitle ( string  $a_title)

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

Referenced by read().

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

Referenced by read().

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

◆ update()

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

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

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

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

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

Referenced by ilObjPortfolioBase\clonePagesAndSettings().

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

Referenced by getOrderNr().

◆ $portfolio_id

int ilPortfolioPage::$portfolio_id
protected

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

Referenced by getPortfolioId().

◆ $title

string ilPortfolioPage::$title
protected

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

Referenced by getTitle().

◆ $type

int ilPortfolioPage::$type = 1
protected

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

Referenced by getType().

◆ TYPE_PAGE


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