ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilBlogPostingGUI Class Reference

Class ilBlogPosting GUI class. More...

+ Inheritance diagram for ilBlogPostingGUI:
+ Collaboration diagram for ilBlogPostingGUI:

Public Member Functions

 __construct (int $a_node_id, object $a_access_handler=null, int $a_id=0, int $a_old_nr=0, bool $a_enable_public_notes=true, bool $a_may_contribute=true, int $a_style_sheet_id=0)
 
 executeCommand ()
 
 setBlogPosting (ilBlogPosting $a_posting)
 
 preview (string $a_mode=null)
 
 previewEmbedded ()
 Needed for portfolio/blog handling. More...
 
 previewFullscreen ()
 Needed for portfolio/blog handling. More...
 
 showPage (string $a_title="")
 
 postOutputProcessing (string $a_output)
 Finalizing output processing. More...
 
 getTabs (string $a_activate="")
 
 deleteBlogPostingConfirmationScreen ()
 
 cancelBlogPostingDeletion ()
 
 confirmBlogPostingDeletion ()
 
 editTitle (ilPropertyFormGUI $a_form=null)
 
 updateTitle ()
 
 initTitleForm ()
 
 editDate (ilPropertyFormGUI $a_form=null)
 
 updateDate ()
 
 initDateForm ()
 
 observeNoteAction (int $a_blog_id, int $a_posting_id, string $a_type, string $a_action, int $a_note_id)
 
 getActivationCaptions ()
 
 deactivatePageToList ()
 
 deactivatePage (bool $a_to_list=false)
 
 activatePageToList ()
 
 activatePage (bool $a_to_list=false)
 
 editKeywords ()
 Diplay the keywords form. More...
 
 saveKeywordsForm ()
 
 getDisabledText ()
 
 getCommentsHTMLExport ()
 
 finishEditing ()
 
- Public Member Functions inherited from ilPageObjectGUI
 __construct (string $a_parent_type, int $a_id, int $a_old_nr=0, bool $a_prevent_get_id=false, string $a_lang="", string $concrete_lang="")
 
 setTemplate (ilGlobalTemplateInterface $main_tpl)
 
 afterConstructor ()
 
 setAdvMdRecordObject (int $a_adv_ref_id, string $a_adv_type, string $a_adv_subtype="-")
 Set object, that defines the adv md records being used. More...
 
 getAdvMdRecordObject ()
 Get adv md record type. More...
 
 setParentType (string $a_val)
 
 getParentType ()
 
 setId (int $a_val)
 
 getId ()
 
 setOldNr (int $a_val)
 Set old nr (historic page) More...
 
 getOldNr ()
 
 setLanguage (string $a_val)
 
 getLanguage ()
 
 setEnablePCType (string $a_pc_type, bool $a_val)
 
 getEnablePCType (string $a_pc_type)
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setPageObject (ilPageObject $a_pg_obj)
 
 getPageObject ()
 
 setOutputMode (string $a_mode=self::PRESENTATION)
 
 getOutputMode ()
 
 setTemplateOutput (bool $a_output=true)
 
 outputToTemplate ()
 
 setPresentationTitle (string $a_title="")
 
 getPresentationTitle ()
 
 setHeader (string $a_title="")
 
 getHeader ()
 
 setLinkParams (string $l_params="")
 
 getLinkParams ()
 
 setLinkFrame (string $l_frame="")
 
 getLinkFrame ()
 
 setPageLinker (\ILIAS\COPage\PageLinker $page_linker)
 
 getLinkXML ()
 
 setQuestionHTML (array $question_html)
 
 getQuestionHTML ()
 
 setTemplateTargetVar (string $a_variable)
 
 getTemplateTargetVar ()
 
 getTemplateOutputVar ()
 
 setSourcecodeDownloadScript (string $script_name)
 
 getSourcecodeDownloadScript ()
 
 setTabs (ilTabsGUI $a_tabs)
 
 setPageBackTitle (string $a_title)
 
 setFileDownloadLink (string $a_download_link)
 
 getFileDownloadLink ()
 
 setFullscreenLink (string $a_fullscreen_link)
 
 getFullscreenLink ()
 
 setIntLinkReturn (string $a_return)
 
 enableChangeComments (bool $a_enabled)
 
 isEnabledChangeComments ()
 
 enableNotes (bool $a_enabled, int $a_parent_id)
 
 isEnabledNotes ()
 
 setOfflineDirectory (string $offdir)
 
 getOfflineDirectory ()
 
 setViewPageLink (string $a_link, string $a_target="")
 set link for "view page" button More...
 
 getViewPageLink ()
 
 getViewPageTarget ()
 
 getViewPageText ()
 
 setActivationListener (object $a_obj, string $a_meth)
 
 setEnabledNews (bool $a_enabled, int $a_news_obj_id=0, string $a_news_obj_type="")
 
 getEnabledNews ()
 
 setTabHook (object $a_object, string $a_function)
 
 setEditPreview (bool $a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 getEditPreview ()
 
 setEnabledTabs (bool $a_enabledtabs)
 
 getEnabledTabs ()
 
 setEnabledPageFocus (bool $a_enabledpagefocus)
 
 setOpenPlaceHolder (string $a_val)
 
 getOpenPlaceHolder ()
 
 getEnabledPageFocus ()
 
 setPrependingHtml (string $a_prependinghtml)
 
 getPrependingHtml ()
 
 setEnableEditing (bool $a_enableediting)
 
 getEnableEditing ()
 
 setRawPageContent (bool $a_rawpagecontent)
 Set Get raw page content only. More...
 
 getRawPageContent ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 setCompareMode (bool $a_val)
 
 getCompareMode ()
 
 setAbstractOnly (bool $a_val, string $pcid="")
 Get only abstract (first text paragraph) More...
 
 getAbstractOnly ()
 
 setRenderPageContainer (bool $a_val)
 
 getRenderPageContainer ()
 
 getDisabledText ()
 
 getEnabledHref ()
 
 setEnabledHref (bool $enable)
 
 activateMetaDataEditor (ilObject $a_rep_obj, string $a_type, int $a_sub_obj_id, object $a_observer_obj=null, string $a_observer_func="")
 Activate meda data editor. More...
 
 determineFileDownloadLink ()
 
 determineFullscreenLink ()
 
 determineSourcecodeDownloadScript ()
 
 getComponentPluginsXML ()
 Put information about activated plugins into XML. More...
 
 executeCommand ()
 execute command More...
 
 setQEditTabs (string $a_active)
 Set question editing tabs. More...
 
 onFeedbackEditingForwarding ()
 
 deactivatePage ()
 
 activatePage ()
 
 showPage ()
 display content of page More...
 
 replaceCurlyBrackets (string $output)
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 setEditMode ()
 Set edit mode. More...
 
 setDefaultLinkXml ()
 
 setLinkXml (string $xml)
 
 getProfileBackUrl ()
 
 setProfileBackUrl (string $url)
 
 downloadFile ()
 
 displayMediaFullscreen ()
 
 displayMedia (bool $a_fullscreen=false)
 
 download_paragraph ()
 download source code paragraph More...
 
 insertPageToc (string $a_output)
 
 insertResources (string $a_output)
 
 insertAdvTrigger (string $a_output)
 Insert adv content trigger. More...
 
 postOutputProcessing (string $a_output)
 Finalizing output processing. More...
 
 previewHistory ()
 Preview history. More...
 
 preview ()
 
 edit ()
 
 getBlockingInfoMessage ()
 
 insertJSAtPlaceholder ()
 
 presentation (string $a_mode=self::PRESENTATION)
 
 getHTML ()
 
 showMediaFullscreen (int $a_style_id=0)
 show fullscreen view of media object More...
 
 displayValidationError ($a_error)
 display validation error More...
 
 history ()
 Get history table as HTML. More...
 
 rollbackConfirmation ()
 Rollback confirmation. More...
 
 rollback ()
 Rollback to a previous version. More...
 
 setScreenIdComponent ()
 
 getMetaDataLink ()
 
 getTabs (string $a_activate="")
 
 compareVersion ()
 Compares two revisions of the page. More...
 
 replaceDiffTags (string $a_html)
 
 editActivation ()
 Edit activation (only, if scheduled page activation is activated in administration) More...
 
 initActivationForm ()
 Init activation form. More...
 
 getActivationFormValues ()
 Get values for activation form. More...
 
 saveActivation ()
 Save Activation. More...
 
 getNotesHTML (object $a_content_object=null, bool $a_enable_private_notes=true, bool $a_enable_public_notes=false, bool $a_enable_notes_deletion=false, callable $a_callback=null, bool $export=false)
 Get html for public and/or private notes. More...
 
 processAnswer ()
 Process answer. More...
 
 initialOpenedContent ()
 Initially opened content. More...
 
 initOpenedContentForm ()
 
 saveInitialOpenedContent ()
 
 switchToLanguage ()
 Switch to language. More...
 
 confirmPageTranslationCreation ()
 Confirm page translation creation. More...
 
 editMasterLanguage ()
 Edit master language. More...
 
 createPageTranslation ()
 Create page translation. More...
 
 releasePageLock ()
 Release page lock. More...
 
 finishEditing ()
 
 getPagePermaLink ()
 
 getAdditionalPageActions ()
 Get additional page actions. More...
 
 afterDeleteContents ()
 

Static Public Member Functions

static getSnippet (int $a_id, bool $a_truncate=false, int $a_truncate_length=500, string $a_truncate_sign="...", bool $a_include_picture=false, int $a_picture_width=144, int $a_picture_height=144, string $a_export_directory=null)
 Get first text paragraph of page. More...
 
- Static Public Member Functions inherited from ilPageObjectGUI
static getTinyMenu (string $a_par_type, bool $a_int_links=false, bool $a_wiki_links=false, bool $a_keywords=false, $a_style_id=0, $a_paragraph_styles=true, $a_save_return=true, $a_anchors=false, $a_save_new=true, $a_user_links=false, \ILIAS\COPage\Editor\Server\UIWrapper $ui_wrapper=null)
 Get Tiny Menu. More...
 

Data Fields

bool $add_date = false
 
- Data Fields inherited from ilPageObjectGUI
const PRESENTATION = "presentation"
 
const EDIT = "edit"
 
const PREVIEW = "preview"
 
const OFFLINE = "offline"
 
const PRINTING = "print"
 
string $page_back_title = ""
 
ilPageObject $obj
 
string $presentation_title = ""
 
string $target_script = ""
 
string $return_location = ""
 
string $target_var = ""
 
string $template_output_var = ""
 
bool $output2template = false
 
string $link_params = ""
 
string $sourcecode_download_script = ""
 
bool $change_comments = false
 
bool $activation = false
 
bool $activated = true
 
bool $editpreview = false
 
bool $use_meta_data = false
 
ilObject $meta_data_rep_obj = null
 
int $meta_data_sub_obj_id = 0
 
string $meta_data_type = ""
 
object $meta_data_observer_obj = null
 
string $meta_data_observer_func = ""
 
bool $link_xml_set = false
 
bool $enableediting = true
 
bool $rawpagecontent = false
 
bool $enabledcontentincludes = false
 
bool $compare_mode = false
 
ilPageConfig $page_config = null
 
bool $tabs_enabled = true
 
bool $render_page_container = false
 
string $pl_start = "{{{{{"
 
string $pl_end = "}}}}}"
 

Protected Member Functions

 checkAccess (string $a_cmd)
 
 isInWorkspace ()
 Is current page part of personal workspace blog? More...
 
 showPageHeading ()
 
 getPageHeading ()
 Get page heading see also https://docu.ilias.de/goto_docu_wiki_wpage_5793_1357.html the presentation heading has a defined layout, title is not from page content. More...
 
 cancelEdit ()
 
 initKeywordsForm ()
 
 getParentObjId ()
 
 getFirstMediaObjectAsTag (int $a_width=144, int $a_height=144, string $a_export_directory=null)
 
 showEditToolbar ()
 
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 showEditToolbar ()
 Show edit toolbar. More...
 
 setEditorToolContext ()
 Set editor tool context. More...
 
 initEditing ()
 
 showEditLockInfo ()
 
 setBackToEditTabs ()
 
 setBackToHistoryTabs ()
 
 checkLangPageAvailable (int $id, string $lang)
 
 isPageContainerToBeRendered ()
 
 addResourcesToTemplate (ilGlobalTemplateInterface $tpl)
 Add resources to template. More...
 

Static Protected Member Functions

static parseImage (int $src_width, int $src_height, int $tgt_width, int $tgt_height)
 

Protected Attributes

ILIAS Blog InternalGUIService $blog_gui
 
ProfileGUI $profile_gui
 
ILIAS Notes Service $notes
 
ILIAS Blog ReadingTime ReadingTimeManager $reading_time_manager
 
StandardGUIRequest $blog_request
 
ilTabsGUI $tabs
 
ilLocatorGUI $locator
 
ilSetting $settings
 
int $node_id
 
object $access_handler = null
 
bool $enable_public_notes = false
 
bool $may_contribute = false
 
bool $fetchall = false
 
int $blpg = 0
 
string $term = ""
 
- Protected Attributes inherited from ilPageObjectGUI
ILIAS TestQuestionPool QuestionInfoService $questioninfo
 
ILIAS COPage Page PageManager $pm
 
ILIAS COPage Link LinkManager $link
 
ILIAS COPage InternalGUIService $gui
 
ILIAS COPage PC PCDefinition $pc_definition
 
ILIAS COPage Xsl XslManager $xsl
 
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS Notes Service $notes
 
int $requested_ref_id
 
int $requested_pg_id
 
string $requested_file_id
 
string $requested_transl
 
int $requested_old_nr
 
EditGUIRequest $request
 
EditSessionRepository $edit_repo
 
string $exp_target_script = ""
 
string $exp_id = ""
 
string $exp_frame = ""
 
string $act_meth = ""
 
object $act_obj
 
int $notes_parent_id = 0
 
ilPropertyFormGUI $form
 
int $styleid = 0
 
bool $enabledpagefocus
 
string $link_xml
 
int $old_nr = 0
 
int $id
 
string $language
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilAccessHandler $access
 
ilLogger $log
 
ilObjUser $user
 
ilHelpGUI $help
 
string $output_mode = ""
 
string $parent_type = ""
 
string $file_download_link = ''
 
string $fullscreen_link = ''
 
string $link_frame = ''
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
ILIAS DI UIServices $ui
 
ILIAS COPage PageLinker $page_linker
 
string $abstract_pcid = ""
 
ilToolbarGUI $toolbar
 
string $open_place_holder = ""
 
int $requested_user_id = 0
 
int $requested_q_id = 0
 
int $requested_history_mode = 0
 
bool $enabled_news = false
 
int $news_obj_id = 0
 
string $news_obj_type = ""
 
array $tab_hook = null
 
string $view_page_link = ""
 
string $view_page_target = ""
 
string $offline_directory = ""
 
bool $notes_enabled = false
 
string $prependinghtml = ""
 
string $header = ""
 
string $int_link_return = ""
 
bool $enabled_href = true
 
int $adv_ref_id = null
 
string $adv_type = null
 
string $adv_subtype = null
 
string $concrete_lang = ""
 
string $profile_back_url = ""
 
ilComponentFactory $component_factory
 
ILIAS COPage Compare PageCompare $compare
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBlogPostingGUI::__construct ( int  $a_node_id,
object  $a_access_handler = null,
int  $a_id = 0,
int  $a_old_nr = 0,
bool  $a_enable_public_notes = true,
bool  $a_may_contribute = true,
int  $a_style_sheet_id = 0 
)

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

References $DIC, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ILIAS\MetaData\Repository\Validation\Data\__construct(), ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getSyntaxStylePath(), isInWorkspace(), ilLanguage\loadLanguageModule(), ILIAS\Repository\locator(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), ilPageObjectGUI\setEnableEditing(), ilPageObjectGUI\setStyleId(), ILIAS\Repository\settings(), ilGlobalTemplateInterface\setVariable(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

57  {
58  global $DIC;
59 
60  $this->tabs = $DIC->tabs();
61  $this->locator = $DIC["ilLocator"];
62  $this->settings = $DIC->settings();
63  $this->user = $DIC->user();
64  $tpl = $DIC["tpl"];
65  $lng = $DIC->language();
66  $this->blog_request = $DIC->blog()
67  ->internal()
68  ->gui()
69  ->standardRequest();
70 
71  $lng->loadLanguageModule("blog");
72 
73  $this->node_id = $a_node_id;
74  $this->access_handler = $a_access_handler;
75  $this->enable_public_notes = $a_enable_public_notes;
76 
77  parent::__construct("blp", $a_id, $a_old_nr);
78 
79  // needed for notification
80  $this->getBlogPosting()->setBlogNodeId($this->node_id, $this->isInWorkspace());
81  $this->getBlogPosting()->getPageConfig()->setEditLockSupport(!$this->isInWorkspace());
82 
83  // #11151
84  $this->may_contribute = $a_may_contribute;
85  $this->setEnableEditing($a_may_contribute);
86 
87  // content style
88 
89  $tpl->setCurrentBlock("SyntaxStyle");
91  "LOCATION_SYNTAX_STYLESHEET",
93  );
95 
96  // #17814
97  $tpl->setCurrentBlock("ContentStyle");
99  "LOCATION_CONTENT_STYLESHEET",
100  ilObjStyleSheet::getContentStylePath($a_style_sheet_id)
101  );
103 
104  // needed for editor
105  $this->setStyleId($a_style_sheet_id);
106 
107  $this->blpg = $this->blog_request->getBlogPage();
108  $this->fetchall = $this->blog_request->getFetchAll();
109  $this->term = $this->blog_request->getTerm();
110 
111  $this->reading_time_manager = new \ILIAS\Blog\ReadingTime\ReadingTimeManager();
112  $this->notes = $DIC->notes();
113  $this->profile_gui = $DIC->blog()->internal()->gui()->profile();
114  $this->blog_gui = $DIC->blog()->internal()->gui();
115  }
loadLanguageModule(string $a_module)
Load language module.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
setStyleId(int $a_styleid)
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
ilGlobalTemplateInterface $tpl
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
isInWorkspace()
Is current page part of personal workspace blog?
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setEnableEditing(bool $a_enableediting)
+ Here is the call graph for this function:

Member Function Documentation

◆ activatePage()

ilBlogPostingGUI::activatePage ( bool  $a_to_list = false)

Definition at line 617 of file class.ilBlogPostingGUI.php.

References checkAccess(), ILIAS\Repository\ctrl(), ilPageObjectGUI\getId(), isInWorkspace(), and ilObjBlog\sendNotification().

617  : void
618  {
619  // send notifications
620  ilObjBlog::sendNotification("new", $this->isInWorkspace(), $this->node_id, $this->getBlogPosting()->getId());
621 
622  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
623  $this->getBlogPosting()->setActive(true);
624  $this->getBlogPosting()->update(true, false);
625  }
626  if (!$a_to_list) {
627  $this->ctrl->redirect($this, "edit");
628  } else {
629  $this->ctrl->setParameterByClass("ilobjbloggui", "blpg", "");
630  $this->ctrl->redirectByClass("ilobjbloggui", "");
631  }
632  }
static sendNotification(string $a_action, bool $a_in_wsp, int $a_blog_node_id, int $a_posting_id, ?string $a_comment=null)
isInWorkspace()
Is current page part of personal workspace blog?
+ Here is the call graph for this function:

◆ activatePageToList()

ilBlogPostingGUI::activatePageToList ( )

Definition at line 612 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\activatePage().

612  : void
613  {
614  $this->activatePage(true);
615  }
+ Here is the call graph for this function:

◆ cancelBlogPostingDeletion()

ilBlogPostingGUI::cancelBlogPostingDeletion ( )

Definition at line 413 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$ctrl, and ilCtrl\setParameterByClass().

413  : void
414  {
415  $ilCtrl = $this->ctrl;
416 
417  $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", ""); // #14363
418  $ilCtrl->redirectByClass("ilobjbloggui", "render");
419  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ cancelEdit()

ilBlogPostingGUI::cancelEdit ( )
protected

Definition at line 567 of file class.ilBlogPostingGUI.php.

References ILIAS\Repository\ctrl().

567  : void
568  {
569  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
570  }
+ Here is the call graph for this function:

◆ checkAccess()

ilBlogPostingGUI::checkAccess ( string  $a_cmd)
protected

Definition at line 169 of file class.ilBlogPostingGUI.php.

References $may_contribute.

Referenced by activatePage(), confirmBlogPostingDeletion(), deactivatePage(), deleteBlogPostingConfirmationScreen(), editKeywords(), preview(), saveKeywordsForm(), updateDate(), and updateTitle().

169  : bool
170  {
171  if ($a_cmd === "contribute") {
172  return $this->may_contribute;
173  }
174  return $this->access_handler->checkAccess($a_cmd, "", $this->node_id);
175  }
+ Here is the caller graph for this function:

◆ confirmBlogPostingDeletion()

ilBlogPostingGUI::confirmBlogPostingDeletion ( )

Definition at line 421 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$id, ilPageObjectGUI\$lng, checkAccess(), and ilLanguage\txt().

421  : void
422  {
423  $ilCtrl = $this->ctrl;
424  $lng = $this->lng;
425 
426  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
427  // delete all md keywords
428  $md_section = $this->getBlogPosting()->getMDSection();
429  foreach ($md_section->getKeywordIds() as $id) {
430  $md_key = $md_section->getKeyword($id);
431  $md_key->delete();
432  }
433 
434  $this->getBlogPosting()->delete();
435  $this->tpl->setOnScreenMessage('success', $lng->txt("blog_posting_deleted"), true);
436  }
437 
438  $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", ""); // #14363
439  $ilCtrl->redirectByClass("ilobjbloggui", "render");
440  }
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:

◆ deactivatePage()

ilBlogPostingGUI::deactivatePage ( bool  $a_to_list = false)

Definition at line 598 of file class.ilBlogPostingGUI.php.

References checkAccess(), and ILIAS\Repository\ctrl().

598  : void
599  {
600  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
601  $this->getBlogPosting()->unpublish();
602  }
603 
604  if (!$a_to_list) {
605  $this->ctrl->redirect($this, "edit");
606  } else {
607  $this->ctrl->setParameterByClass("ilobjbloggui", "blpg", "");
608  $this->ctrl->redirectByClass("ilobjbloggui", "");
609  }
610  }
+ Here is the call graph for this function:

◆ deactivatePageToList()

ilBlogPostingGUI::deactivatePageToList ( )

Definition at line 593 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\deactivatePage().

593  : void
594  {
595  $this->deactivatePage(true);
596  }
+ Here is the call graph for this function:

◆ deleteBlogPostingConfirmationScreen()

ilBlogPostingGUI::deleteBlogPostingConfirmationScreen ( )

Definition at line 373 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, checkAccess(), ilPageObjectGUI\getId(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

373  : void
374  {
375  $tpl = $this->tpl;
376  $ilCtrl = $this->ctrl;
377  $lng = $this->lng;
378 
379  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
380  $confirmation_gui = new ilConfirmationGUI();
381  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
382  $confirmation_gui->setHeaderText($lng->txt("blog_posting_deletion_confirmation"));
383  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelBlogPostingDeletion");
384  $confirmation_gui->setConfirm($lng->txt("delete"), "confirmBlogPostingDeletion");
385 
386  $dtpl = new ilTemplate(
387  "tpl.blog_posting_deletion_confirmation.html",
388  true,
389  true,
390  "Modules/Blog"
391  );
392 
393  $dtpl->setVariable("PAGE_TITLE", $this->getBlogPosting()->getTitle());
394 
395  // notes/comments
396  $cnt_note_users = $this->notes->domain()->getUserCount(
397  $this->getBlogPosting()->getParentId(),
398  $this->getBlogPosting()->getId(),
399  "wpg"
400  );
401  $dtpl->setVariable(
402  "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
403  $lng->txt("blog_number_users_notes_or_comments")
404  );
405  $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
406 
407  $confirmation_gui->addItem("", "", $dtpl->get());
408 
409  $tpl->setContent($confirmation_gui->getHTML());
410  }
411  }
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...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ editDate()

ilBlogPostingGUI::editDate ( ilPropertyFormGUI  $a_form = null)

Definition at line 503 of file class.ilBlogPostingGUI.php.

References $tabs, ilPageObjectGUI\$tpl, ilTabsGUI\clearTargets(), ILIAS\Repository\ctrl(), initDateForm(), ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setContent().

503  : void
504  {
505  $tpl = $this->tpl;
506  $ilTabs = $this->tabs;
507 
508  $ilTabs->clearTargets();
509  $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
510 
511  $ilTabs->activateTab("edit");
512 
513  if (!$a_form) {
514  $a_form = $this->initDateForm();
515  }
516 
517  $tpl->setContent($a_form->getHTML());
518  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
clearTargets()
clear all targets
+ Here is the call graph for this function:

◆ editKeywords()

ilBlogPostingGUI::editKeywords ( )

Diplay the keywords form.

Definition at line 637 of file class.ilBlogPostingGUI.php.

References $DIC, $tabs, ilPageObjectGUI\$tpl, checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setContent().

637  : void
638  {
639  global $DIC;
640 
641  $renderer = $DIC->ui()->renderer();
642 
643  $ilTabs = $this->tabs;
644  $tpl = $this->tpl;
645 
646  $ilTabs->clearTargets();
647  $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
648 
649  if (!$this->checkAccess("contribute")) {
650  return;
651  }
652 
653  $ilTabs->activateTab("pg");
654 
655  $tpl->setContent($renderer->render($this->initKeywordsForm()));
656  }
global $DIC
Definition: feed.php:28
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ editTitle()

ilBlogPostingGUI::editTitle ( ilPropertyFormGUI  $a_form = null)

Definition at line 442 of file class.ilBlogPostingGUI.php.

References $tabs, ilPageObjectGUI\$tpl, ilTabsGUI\clearTargets(), ILIAS\Repository\ctrl(), initTitleForm(), ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setContent().

Referenced by updateDate(), and updateTitle().

442  : void
443  {
444  $tpl = $this->tpl;
445  $ilTabs = $this->tabs;
446 
447  $ilTabs->clearTargets();
448  $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
449 
450  $ilTabs->activateTab("edit");
451 
452  if (!$a_form) {
453  $a_form = $this->initTitleForm();
454  }
455 
456  $tpl->setContent($a_form->getHTML());
457  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
clearTargets()
clear all targets
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilBlogPostingGUI::executeCommand ( )

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

References ilPageObjectGUI\$ctrl, $locator, ilPageObjectGUI\$tpl, ilObject\_lookupTitle(), ilUtil\getImagePath(), ILIAS\Repository\lng(), previewFullscreen(), ilPageObjectGUI\setPresentationTitle(), ilGlobalTemplateInterface\setTitle(), and ilGlobalTemplateInterface\setTitleIcon().

117  : string
118  {
119  $ilCtrl = $this->ctrl;
120  $ilLocator = $this->locator;
121  $tpl = $this->tpl;
122 
123  $next_class = $ilCtrl->getNextClass($this);
124 
125  $posting = $this->getBlogPosting();
126  $ilCtrl->setParameter($this, "blpg", $posting->getId());
127 
128  switch ($next_class) {
129  case "ilcommentgui":
130  // $this->getTabs();
131  // $ilTabs->setTabActive("pg");
132  return $this->previewFullscreen();
133 
134  default:
135  if ($ilCtrl->getCmd() === "deactivatePageToList") {
136  $this->tpl->setOnScreenMessage('success', $this->lng->txt("blog_draft_info"), true);
137  } elseif ($ilCtrl->getCmd() === "activatePageToList") {
138  $this->tpl->setOnScreenMessage('success', $this->lng->txt("blog_new_posting_info"), true);
139  }
140  $this->setPresentationTitle($posting->getTitle());
141 
142  $tpl->setTitle(ilObject::_lookupTitle($this->getBlogPosting()->getBlogId()) . ": " . // #15017
143  $posting->getTitle());
145  ilUtil::getImagePath("standard/icon_blog.svg"),
146  $this->lng->txt("obj_blog")
147  ); // #12879
148 
149  $ilLocator->addItem(
150  $posting->getTitle(),
151  $ilCtrl->getLinkTarget($this, "preview")
152  );
153  return parent::executeCommand();
154  }
155  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
previewFullscreen()
Needed for portfolio/blog handling.
static _lookupTitle(int $obj_id)
ilGlobalTemplateInterface $tpl
setPresentationTitle(string $a_title="")
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
+ Here is the call graph for this function:

◆ finishEditing()

ilBlogPostingGUI::finishEditing ( )

Definition at line 879 of file class.ilBlogPostingGUI.php.

References ILIAS\Repository\ctrl().

879  : void
880  {
881  $this->ctrl->setParameterByClass("ilobjbloggui", "bmn", "");
882  $this->ctrl->redirectByClass("ilobjbloggui", "render");
883  }
+ Here is the call graph for this function:

◆ getActivationCaptions()

ilBlogPostingGUI::getActivationCaptions ( )

Definition at line 585 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$lng, and ilLanguage\txt().

585  : array
586  {
587  $lng = $this->lng;
588 
589  return array("deactivatePage" => $lng->txt("blog_toggle_draft"),
590  "activatePage" => $lng->txt("blog_toggle_final"));
591  }
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:

◆ getCommentsHTMLExport()

ilBlogPostingGUI::getCommentsHTMLExport ( )

Definition at line 863 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\getNotesHTML().

863  : string
864  {
865  return $this->getNotesHTML(
866  $this->getBlogPosting(),
867  false,
868  $this->enable_public_notes,
869  false,
870  null,
871  true
872  );
873  }
getNotesHTML(object $a_content_object=null, bool $a_enable_private_notes=true, bool $a_enable_public_notes=false, bool $a_enable_notes_deletion=false, callable $a_callback=null, bool $export=false)
Get html for public and/or private notes.
+ Here is the call graph for this function:

◆ getDisabledText()

ilBlogPostingGUI::getDisabledText ( )

Definition at line 858 of file class.ilBlogPostingGUI.php.

References ILIAS\Repository\lng().

858  : string
859  {
860  return $this->lng->txt("blog_draft_text");
861  }
+ Here is the call graph for this function:

◆ getFirstMediaObjectAsTag()

ilBlogPostingGUI::getFirstMediaObjectAsTag ( int  $a_width = 144,
int  $a_height = 144,
string  $a_export_directory = null 
)
protected

Definition at line 788 of file class.ilBlogPostingGUI.php.

References $location, and ilObjMediaObject\_getDirectory().

792  : string {
793  $this->obj->buildDom();
794  $mob_ids = $this->obj->collectMediaObjects();
795  if ($mob_ids) {
796  foreach ($mob_ids as $mob_id) {
797  $mob_obj = new ilObjMediaObject((int) $mob_id);
798  $mob_item = $mob_obj->getMediaItem("Standard");
799  if (stripos($mob_item->getFormat(), "image") !== false) {
800  $mob_size = $mob_item->getOriginalSize();
801  if (is_null($mob_size)) {
802  continue;
803  }
804  if ($mob_size["width"] >= $a_width ||
805  $mob_size["height"] >= $a_height) {
806  if (!$a_export_directory) {
807  $mob_dir = ilObjMediaObject::_getDirectory($mob_obj->getId());
808  } else {
809  // see ilCOPageHTMLExport::exportHTMLMOB()
810  $mob_dir = "./mobs/mm_" . $mob_obj->getId();
811  }
812  $mob_res = self::parseImage(
813  $mob_size["width"],
814  $mob_size["height"],
815  $a_width,
816  $a_height
817  );
818 
819 
820  $location = $mob_item->getLocationType() === "Reference"
821  ? $mob_item->getLocation()
822  : $mob_dir . "/" . $mob_item->getLocation();
823 
824  return '<img' .
825  ' src="' . $location . '"' .
826  ' width="' . $mob_res[0] . '"' .
827  ' height="' . $mob_res[1] . '"' .
828  ' class="ilBlogListItemSnippetPreviewImage ilFloatLeft noMirror"' .
829  ' />';
830  }
831  }
832  }
833  }
834  return "";
835  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
static _getDirectory(int $a_mob_id)
Get absolute directory.
+ Here is the call graph for this function:

◆ getPageHeading()

ilBlogPostingGUI::getPageHeading ( )
protected

Get page heading see also https://docu.ilias.de/goto_docu_wiki_wpage_5793_1357.html the presentation heading has a defined layout, title is not from page content.

Definition at line 315 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$tpl, ilDatePresentation\formatDate(), ilGlobalTemplateInterface\get(), ilPageObjectGUI\getId(), ilPageObject\getPageContributors(), isInWorkspace(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), ilDatePresentation\setUseRelativeDates(), ilGlobalTemplateInterface\setVariable(), and ilDatePresentation\useRelativeDates().

Referenced by postOutputProcessing().

315  : string
316  {
317  $author = "";
318  if (!$this->isInWorkspace()) {
319  $authors = array();
320  $author_id = $this->getBlogPosting()->getAuthor();
321  if ($author_id) {
322  $authors[] = $this->profile_gui->getNamePresentation($author_id);
323  }
324 
325  foreach (ilBlogPosting::getPageContributors("blp", $this->getBlogPosting()->getId()) as $editor) {
326  if ($editor["user_id"] != $author_id) {
327  $authors[] = $this->profile_gui->getNamePresentation($editor["user_id"]);
328  }
329  }
330 
331  if ($authors) {
332  $author = implode(", ", $authors) . " - ";
333  }
334  }
337  $tpl = new ilTemplate("tpl.posting_head.html", true, true, "Modules/Blog");
338 
339  // reading time
340  $reading_time = $this->reading_time_manager->getReadingTime(
341  $this->getBlogPosting()->getParentId(),
342  $this->getBlogPosting()->getId()
343  );
344  if (!is_null($reading_time)) {
345  $this->lng->loadLanguageModule("copg");
346  $tpl->setCurrentBlock("reading_time");
347  $tpl->setVariable(
348  "READING_TIME",
349  $this->lng->txt("copg_est_reading_time") . ": " .
350  sprintf($this->lng->txt("copg_x_minutes"), $reading_time)
351  );
353  }
354 
355  $tpl->setVariable("TITLE", $this->getBlogPosting()->getTitle());
356  $tpl->setVariable(
357  "DATETIME",
358  $author . ilDatePresentation::formatDate($this->getBlogPosting()->getCreated())
359  );
361  return $tpl->get();
362  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
static getPageContributors(string $a_parent_type, int $a_page_id, string $a_lang="-")
Get all contributors for parent object.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
isInWorkspace()
Is current page part of personal workspace blog?
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
static setUseRelativeDates(bool $a_status)
set use relative dates
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentObjId()

ilBlogPostingGUI::getParentObjId ( )
protected

Definition at line 705 of file class.ilBlogPostingGUI.php.

References ilObject\_lookupObjId(), and isInWorkspace().

705  : int
706  {
707  if ($this->node_id) {
708  if ($this->isInWorkspace()) {
709  return $this->access_handler->getTree()->lookupObjectId($this->node_id);
710  }
711 
712  return ilObject::_lookupObjId($this->node_id);
713  }
714  return 0;
715  }
static _lookupObjId(int $ref_id)
isInWorkspace()
Is current page part of personal workspace blog?
+ Here is the call graph for this function:

◆ getSnippet()

static ilBlogPostingGUI::getSnippet ( int  $a_id,
bool  $a_truncate = false,
int  $a_truncate_length = 500,
string  $a_truncate_sign = "...",
bool  $a_include_picture = false,
int  $a_picture_width = 144,
int  $a_picture_height = 144,
string  $a_export_directory = null 
)
static

Get first text paragraph of page.

Definition at line 747 of file class.ilBlogPostingGUI.php.

References ilPageObject\truncateHTML().

Referenced by ilObjBlog\deliverRSS(), ilBlogPosting\getNotificationAbstract(), ilBlogPosting\handleNews(), and ilObjBlogGUI\renderList().

756  : string {
757  $bpgui = new self(0, null, $a_id);
758 
759  // scan the full page for media objects
760  $img = "";
761  if ($a_include_picture) {
762  $img = $bpgui->getFirstMediaObjectAsTag($a_picture_width, $a_picture_height, $a_export_directory);
763  }
764 
765  $bpgui->setRawPageContent(true);
766  $bpgui->setAbstractOnly(true);
767 
768  // #8627: export won't work - should we set offline mode?
769  $bpgui->setFileDownloadLink(".");
770  $bpgui->setFullscreenLink(".");
771  $bpgui->setSourcecodeDownloadScript(".");
772  $bpgui->setProfileBackUrl(".");
773 
774  // render without title
775  $page = $bpgui->showPage();
776 
777  if ($a_truncate) {
778  $page = ilPageObject::truncateHTML($page, $a_truncate_length, $a_truncate_sign);
779  }
780 
781  if ($img) {
782  $page = '<div>' . $img . $page . '</div><div style="clear:both;"></div>';
783  }
784 
785  return $page;
786  }
static truncateHTML(string $a_text, int $a_length=100, string $a_ending='...', bool $a_exact=false, bool $a_consider_html=true)
Truncate (html) string.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilBlogPostingGUI::getTabs ( string  $a_activate = "")

Definition at line 364 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\getId(), and ilCtrl\setParameterByClass().

364  : void
365  {
366  $ilCtrl = $this->ctrl;
367 
368  $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", $this->getBlogPosting()->getId());
369 
370  parent::getTabs($a_activate);
371  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ initDateForm()

ilBlogPostingGUI::initDateForm ( )

Definition at line 544 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$form, ilPageObjectGUI\$lng, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPageObjectGUI\getPageObject(), ilFormGUI\setFormAction(), ilFormPropertyGUI\setRequired(), ilPropertyFormGUI\setTitle(), and ilLanguage\txt().

Referenced by editDate(), and updateDate().

545  {
546  $lng = $this->lng;
547  $ilCtrl = $this->ctrl;
548 
549  $form = new ilPropertyFormGUI();
550  $form->setFormAction($ilCtrl->getFormAction($this));
551  $form->setTitle($lng->txt('blog_edit_date'));
552 
553  $date = new ilDateTimeInputGUI($lng->txt("date"), "date");
554  $date->setRequired(true);
555  $date->setShowTime(true);
556  $date->setInfo($lng->txt('blog_edit_date_info'));
557  $form->addItem($date);
558 
559  $date->setDate($this->getPageObject()->getCreated());
560 
561  $form->addCommandButton('updateDate', $lng->txt('save'));
562  $form->addCommandButton('cancelEdit', $lng->txt('cancel'));
563 
564  return $form;
565  }
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...
This class represents a date/time property in a property form.
setFormAction(string $a_formaction)
setRequired(bool $a_required)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
ilPropertyFormGUI $form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initKeywordsForm()

ilBlogPostingGUI::initKeywordsForm ( )
protected
Exceptions
ilCtrlException

Definition at line 661 of file class.ilBlogPostingGUI.php.

References $DIC, ilPageObjectGUI\$id, ilBlogPosting\getAllPostings(), ilPageObjectGUI\getId(), ilBlogPosting\getKeywords(), and ILIAS\Repository\lng().

Referenced by saveKeywordsForm().

662  {
663  global $DIC;
664 
665  $ui_factory = $DIC->ui()->factory();
666 
667  $md_section = $this->getBlogPosting()->getMDSection();
668 
669  $keywords = array();
670  foreach ($ids = $md_section->getKeywordIds() as $id) {
671  $md_key = $md_section->getKeyword($id);
672  if (trim($md_key->getKeyword()) !== "") {
673  $keywords[] = $md_key->getKeyword();
674  }
675  }
676 
677  // other keywords in blog
678  $other = array();
679  foreach (array_keys(ilBlogPosting::getAllPostings($this->getBlogPosting()->getBlogId())) as $posting_id) {
680  if ($posting_id != $this->getBlogPosting()->getId()) {
681  $other = array_merge($other, ilBlogPosting::getKeywords($this->getBlogPosting()->getBlogId(), $posting_id));
682  }
683  }
684  // #17414
685  $other = array_unique($other);
686  sort($other, SORT_LOCALE_STRING);
687 
688  $input_tag = $ui_factory->input()->field()->tag($this->lng->txt("blog_keywords"), $other, $this->lng->txt("blog_keyword_enter"))->withUserCreatedTagsAllowed(true);
689  if (count($keywords) > 0) {
690  $input_tag = $input_tag->withValue($keywords);
691  }
692 
693  $DIC->ctrl()->setParameter(
694  $this,
695  'tags',
696  'tags_processing'
697  );
698 
699  $section = $ui_factory->input()->field()->section([$input_tag], $this->lng->txt("blog_edit_keywords"), "");
700 
701  $form_action = $DIC->ctrl()->getFormAction($this, "saveKeywordsForm");
702  return $ui_factory->input()->container()->form()->standard($form_action, ["tags" => $section]);
703  }
static getAllPostings(int $a_blog_id, int $a_limit=1000, int $a_offset=0)
Get all postings of blog.
global $DIC
Definition: feed.php:28
This describes a standard form.
Definition: Standard.php:26
static getKeywords(int $a_obj_id, int $a_posting_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTitleForm()

ilBlogPostingGUI::initTitleForm ( )

Definition at line 482 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$form, ilPageObjectGUI\$lng, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPageObjectGUI\getPageObject(), ilFormGUI\setFormAction(), ilPropertyFormGUI\setTitle(), and ilLanguage\txt().

Referenced by editTitle(), and updateTitle().

483  {
484  $lng = $this->lng;
485  $ilCtrl = $this->ctrl;
486 
487  $form = new ilPropertyFormGUI();
488  $form->setFormAction($ilCtrl->getFormAction($this));
489  $form->setTitle($lng->txt('blog_rename_posting'));
490 
491  $title = new ilTextInputGUI($lng->txt("title"), "title");
492  $title->setRequired(true);
493  $form->addItem($title);
494 
495  $title->setValue($this->getPageObject()->getTitle());
496 
497  $form->addCommandButton('updateTitle', $lng->txt('save'));
498  $form->addCommandButton('cancelEdit', $lng->txt('cancel'));
499 
500  return $form;
501  }
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...
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
ilPropertyFormGUI $form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInWorkspace()

ilBlogPostingGUI::isInWorkspace ( )
protected

Is current page part of personal workspace blog?

Definition at line 277 of file class.ilBlogPostingGUI.php.

Referenced by __construct(), activatePage(), getPageHeading(), getParentObjId(), observeNoteAction(), and preview().

277  : bool
278  {
279  $class = '';
280  if (is_object($this->access_handler)) {
281  $class = get_class($this->access_handler);
282  }
283 
284  return (bool) stristr($class, "workspace");
285  }
+ Here is the caller graph for this function:

◆ observeNoteAction()

ilBlogPostingGUI::observeNoteAction ( int  $a_blog_id,
int  $a_posting_id,
string  $a_type,
string  $a_action,
int  $a_note_id 
)

Definition at line 572 of file class.ilBlogPostingGUI.php.

References isInWorkspace(), and ilObjBlog\sendNotification().

578  : void {
579  // #10040 - get note text
580  $note = $this->notes->domain()->getById($a_note_id);
581  $text = $note->getText();
582  ilObjBlog::sendNotification("comment", $this->isInWorkspace(), $this->node_id, $a_posting_id, $text);
583  }
static sendNotification(string $a_action, bool $a_in_wsp, int $a_blog_node_id, int $a_posting_id, ?string $a_comment=null)
isInWorkspace()
Is current page part of personal workspace blog?
+ Here is the call graph for this function:

◆ parseImage()

static ilBlogPostingGUI::parseImage ( int  $src_width,
int  $src_height,
int  $tgt_width,
int  $tgt_height 
)
staticprotected

Definition at line 837 of file class.ilBlogPostingGUI.php.

842  : array {
843  $ratio_width = $ratio_height = 1;
844  if ($src_width > $tgt_width) {
845  $ratio_width = $tgt_width / $src_width;
846  }
847  if ($src_height > $tgt_height) {
848  $ratio_height = $tgt_height / $src_height;
849  }
850  $shrink_ratio = min($ratio_width, $ratio_height);
851 
852  return array(
853  (int) round($src_width * $shrink_ratio),
854  (int) round($src_height * $shrink_ratio)
855  );
856  }

◆ postOutputProcessing()

ilBlogPostingGUI::postOutputProcessing ( string  $a_output)

Finalizing output processing.

Definition at line 290 of file class.ilBlogPostingGUI.php.

References getPageHeading(), and showPageHeading().

292  : string {
293  // #8626/#9370
294  if ($this->showPageHeading()) {
295  $a_output = $this->getPageHeading() . $a_output;
296  }
297 
298  return $a_output;
299  }
getPageHeading()
Get page heading see also https://docu.ilias.de/goto_docu_wiki_wpage_5793_1357.html the presentation ...
+ Here is the call graph for this function:

◆ preview()

ilBlogPostingGUI::preview ( string  $a_mode = null)

Definition at line 177 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$ctrl, $DIC, $ilSetting, $node_id, $ref_id, $settings, ilPageObjectGUI\$toolbar, ilPageObjectGUI\$tpl, checkAccess(), ILIAS\Repository\ctrl(), ilPageObjectGUI\getEnableEditing(), ilPageObjectGUI\getId(), ilPageObjectGUI\getNotesHTML(), isInWorkspace(), and ilGlobalTemplateInterface\setLoginTargetPar().

179  : string {
180  global $DIC;
181  $ilCtrl = $this->ctrl;
182  $tpl = $this->tpl;
184 
185  $toolbar = $DIC->toolbar();
186  $append = "";
187 
188  $this->getBlogPosting()->increaseViewCnt();
189 
190  $wtpl = new ilTemplate(
191  "tpl.blog_page_view_main_column.html",
192  true,
193  true,
194  "Modules/Blog"
195  );
196 
197  // page commands
198  if (!$a_mode) {
199  if (!$this->getEnableEditing()) {
200  $this->ctrl->redirect($this, "previewFullscreen");
201  }
202  } else {
203  $callback = array($this, "observeNoteAction");
204 
205  // notes
206 
207  $may_delete_comments = ($this->checkAccess("contribute") &&
208  $ilSetting->get("comments_del_tutor", '1'));
209 
210  //$wtpl->setVariable("TOOLBAR", $toolbar->getHTML());
211 
212  $wtpl->setVariable("NOTES", $this->getNotesHTML(
213  $this->getBlogPosting(),
214  false,
215  $this->enable_public_notes,
216  $may_delete_comments,
217  $callback
218  ));
219  }
220  // permanent link
221  if ($a_mode !== "embedded") {
222  $ref_id = $this->isInWorkspace()
223  ? 0
224  : $this->node_id;
225  $wsp_id = $this->isInWorkspace()
226  ? $this->node_id
227  : 0;
228  $this->blog_gui->permanentLink($ref_id, $wsp_id)->setPermanentLink($this->blpg);
229  }
230 
231  $wtpl->setVariable("PAGE", parent::preview());
232 
233  $tpl->setLoginTargetPar("blog_" . $this->node_id . $append);
234 
235  $ilCtrl->setParameter($this, "blpg", $this->getBlogPosting()->getId());
236 
237  return $wtpl->get();
238  }
setLoginTargetPar(string $a_val)
Set target parameter for login (public sector).
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
ilGlobalTemplateInterface $tpl
global $ilSetting
Definition: privfeed.php:18
isInWorkspace()
Is current page part of personal workspace blog?
getNotesHTML(object $a_content_object=null, bool $a_enable_private_notes=true, bool $a_enable_public_notes=false, bool $a_enable_notes_deletion=false, callable $a_callback=null, bool $export=false)
Get html for public and/or private notes.
+ Here is the call graph for this function:

◆ previewEmbedded()

ilBlogPostingGUI::previewEmbedded ( )

Needed for portfolio/blog handling.

Definition at line 243 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\preview().

243  : string
244  {
245  return $this->preview("embedded");
246  }
+ Here is the call graph for this function:

◆ previewFullscreen()

ilBlogPostingGUI::previewFullscreen ( )

Needed for portfolio/blog handling.

Definition at line 251 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\preview().

Referenced by executeCommand().

251  : string
252  {
253  $this->add_date = true;
254  return $this->preview("fullscreen");
255  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveKeywordsForm()

ilBlogPostingGUI::saveKeywordsForm ( )

Definition at line 717 of file class.ilBlogPostingGUI.php.

References $DIC, ilPageObjectGUI\$form, ilPageObjectGUI\$request, checkAccess(), ILIAS\Repository\ctrl(), and initKeywordsForm().

717  : void
718  {
719  global $DIC;
720 
721  $request = $DIC->http()->request();
722  $form = $this->initKeywordsForm();
723 
724  if ($request->getMethod() === "POST"
725  && $request->getQueryParams()['tags'] == 'tags_processing') {
726  $form = $form->withRequest($request);
727  $result = $form->getData();
728  //TODO identify the input instead of use 0
729  $keywords = $result["tags"][0];
730 
731  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
732  if (is_array($keywords)) {
733  $this->getBlogPosting()->updateKeywords($keywords);
734  } else {
735  $this->getBlogPosting()->updateKeywords([]);
736  }
737  }
738 
739  $this->ctrl->setParameterByClass(ilObjBlogGUI::class, "blpg", "");
740  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
741  }
742  }
global $DIC
Definition: feed.php:28
EditGUIRequest $request
ilPropertyFormGUI $form
+ Here is the call graph for this function:

◆ setBlogPosting()

ilBlogPostingGUI::setBlogPosting ( ilBlogPosting  $a_posting)

Definition at line 157 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\getPageObject(), and ilPageObjectGUI\setPageObject().

157  : void
158  {
159  $this->setPageObject($a_posting);
160  }
setPageObject(ilPageObject $a_pg_obj)
+ Here is the call graph for this function:

◆ showEditToolbar()

ilBlogPostingGUI::showEditToolbar ( )
protected

Definition at line 875 of file class.ilBlogPostingGUI.php.

875  : void
876  {
877  }

◆ showPage()

ilBlogPostingGUI::showPage ( string  $a_title = "")

Definition at line 257 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\getAbstractOnly(), ilPageObjectGUI\setPresentationTitle(), ilPageObjectGUI\setTemplateOutput(), and showPageHeading().

259  : string {
260  $this->setTemplateOutput(false);
261 
262  $this->setPresentationTitle("");
263  if (!$this->getAbstractOnly() && !$this->showPageHeading()) {
264  if ($a_title !== "") {
265  $this->setPresentationTitle($a_title);
266  } else {
267  $this->setPresentationTitle($this->getBlogPosting()->getTitle());
268  }
269  }
270  $this->getBlogPosting()->increaseViewCnt();
271  return parent::showPage();
272  }
setTemplateOutput(bool $a_output=true)
setPresentationTitle(string $a_title="")
+ Here is the call graph for this function:

◆ showPageHeading()

ilBlogPostingGUI::showPageHeading ( )
protected

Definition at line 301 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\getAbstractOnly().

Referenced by postOutputProcessing(), and showPage().

301  : bool
302  {
303  if (!$this->getAbstractOnly() && $this->add_date) {
304  return true;
305  }
306 
307  return false;
308  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateDate()

ilBlogPostingGUI::updateDate ( )

Definition at line 520 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$form, ilPageObjectGUI\$lng, checkAccess(), ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), editTitle(), ilPropertyFormGUI\getItemByPostVar(), ilPageObjectGUI\getPageObject(), initDateForm(), ilPropertyFormGUI\setValuesByPost(), and ilLanguage\txt().

520  : void
521  {
522  $lng = $this->lng;
523 
524  $form = $this->initDateForm();
525  if ($form->checkInput()) {
526  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
527  $dt = $form->getItemByPostVar("date");
528  $dt = $dt->getDate();
529 
530  $page = $this->getPageObject();
531  $page->setCreated($dt);
532  $page->update();
533 
534  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
535  //$ilCtrl->redirect($this, "preview");
536  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
537  }
538  }
539 
541  $this->editTitle($form);
542  }
editTitle(ilPropertyFormGUI $a_form=null)
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...
getItemByPostVar(string $a_post_var)
ilPropertyFormGUI $form
+ Here is the call graph for this function:

◆ updateTitle()

ilBlogPostingGUI::updateTitle ( )

Definition at line 459 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$form, ilPageObjectGUI\$lng, checkAccess(), ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), editTitle(), ilPropertyFormGUI\getInput(), ilPageObjectGUI\getPageObject(), initTitleForm(), ilPropertyFormGUI\setValuesByPost(), and ilLanguage\txt().

459  : void
460  {
461  $lng = $this->lng;
462 
463  $form = $this->initTitleForm();
464  if ($form->checkInput()) {
465  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
466  $page = $this->getPageObject();
467  $page->setTitle($form->getInput("title"));
468  $page->update();
469 
470  $page->handleNews(true);
471 
472  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
473  //$ilCtrl->redirect($this, "preview");
474  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
475  }
476  }
477 
479  $this->editTitle($form);
480  }
editTitle(ilPropertyFormGUI $a_form=null)
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...
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
ilPropertyFormGUI $form
+ Here is the call graph for this function:

Field Documentation

◆ $access_handler

object ilBlogPostingGUI::$access_handler = null
protected

Definition at line 41 of file class.ilBlogPostingGUI.php.

◆ $add_date

bool ilBlogPostingGUI::$add_date = false

Definition at line 47 of file class.ilBlogPostingGUI.php.

◆ $blog_gui

ILIAS Blog InternalGUIService ilBlogPostingGUI::$blog_gui
protected

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

◆ $blog_request

StandardGUIRequest ilBlogPostingGUI::$blog_request
protected

Definition at line 36 of file class.ilBlogPostingGUI.php.

◆ $blpg

int ilBlogPostingGUI::$blpg = 0
protected

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

◆ $enable_public_notes

bool ilBlogPostingGUI::$enable_public_notes = false
protected

Definition at line 42 of file class.ilBlogPostingGUI.php.

◆ $fetchall

bool ilBlogPostingGUI::$fetchall = false
protected

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

◆ $locator

ilLocatorGUI ilBlogPostingGUI::$locator
protected

Definition at line 38 of file class.ilBlogPostingGUI.php.

Referenced by executeCommand().

◆ $may_contribute

bool ilBlogPostingGUI::$may_contribute = false
protected

Definition at line 43 of file class.ilBlogPostingGUI.php.

Referenced by checkAccess().

◆ $node_id

int ilBlogPostingGUI::$node_id
protected

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

Referenced by preview().

◆ $notes

ILIAS Notes Service ilBlogPostingGUI::$notes
protected

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

◆ $profile_gui

ProfileGUI ilBlogPostingGUI::$profile_gui
protected

Definition at line 33 of file class.ilBlogPostingGUI.php.

◆ $reading_time_manager

ILIAS Blog ReadingTime ReadingTimeManager ilBlogPostingGUI::$reading_time_manager
protected

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

◆ $settings

ilSetting ilBlogPostingGUI::$settings
protected

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

Referenced by preview().

◆ $tabs

ilTabsGUI ilBlogPostingGUI::$tabs
protected

Definition at line 37 of file class.ilBlogPostingGUI.php.

Referenced by editDate(), editKeywords(), and editTitle().

◆ $term

string ilBlogPostingGUI::$term = ""
protected

Definition at line 46 of file class.ilBlogPostingGUI.php.


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