ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilBlogPostingGUI Class Reference

Class ilBlogPosting GUI class. More...

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

Public Member Functions

 __construct ($a_node_id, $a_access_handler=null, $a_id=0, $a_old_nr=0, $a_enable_public_notes=true, $a_may_contribute=true, $a_style_sheet_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 setBlogPosting (ilBlogPosting $a_posting)
 Set blog posting. More...
 
 getBlogPosting ()
 Get blog posting. More...
 
 preview ($a_mode=null)
 Preview blog posting. More...
 
 previewEmbedded ()
 Needed for portfolio/blog handling. More...
 
 previewFullscreen ()
 Needed for portfolio/blog handling. More...
 
 showPage ($a_title="")
 Embedded posting in portfolio. More...
 
 postOutputProcessing ($a_output)
 Finalizing output processing. More...
 
 getTabs ($a_activate="")
 Get tabs. More...
 
 deleteBlogPostingConfirmationScreen ()
 Delete blog posting confirmation screen. More...
 
 cancelBlogPostingDeletion ()
 Cancel blog posting deletion. More...
 
 confirmBlogPostingDeletion ()
 Delete the blog posting. More...
 
 editTitle ($a_form=null)
 
 updateTitle ()
 
 initTitleForm ()
 
 editDate ($a_form=null)
 
 updateDate ()
 
 initDateForm ()
 
 observeNoteAction ($a_blog_id, $a_posting_id, $a_type, $a_action, $a_note_id)
 
 deactivatePageToList ()
 
 deactivatePage ($a_to_list=false)
 
 activatePageToList ()
 
 activatePage ($a_to_list=false)
 
 editKeywords (ilPropertyFormGUI $a_form=null)
 Diplay the form. More...
 
 saveKeywordsForm ()
 
 getDisabledText ()
 Get disabled text. More...
 
- Public Member Functions inherited from ilPageObjectGUI
 __construct ( $a_parent_type, $a_id, $a_old_nr=0, $a_prevent_get_id=false, $a_lang="")
 Constructor. More...
 
 afterConstructor ()
 After constructor. More...
 
 setParentType ($a_val)
 Set parent type. More...
 
 getParentType ()
 Get parent type. More...
 
 setId ($a_val)
 Set ID. More...
 
 getId ()
 Get ID. More...
 
 setOldNr ($a_val)
 Set old nr (historic page) More...
 
 getOldNr ()
 Get old nr (historic page) More...
 
 setLanguage ($a_val)
 Set language. More...
 
 getLanguage ()
 Get language. More...
 
 setEnablePCType ($a_pc_type, $a_val)
 Set enable pc type. More...
 
 getEnablePCType ($a_pc_type)
 Get enable pc type. More...
 
 setPageConfig ($a_val)
 Set page config object. More...
 
 getPageConfig ()
 Get page config object. More...
 
 setPageObject (ilPageObject $a_pg_obj)
 Set Page Object. More...
 
 getPageObject ()
 Get Page Object. More...
 
 setOutputMode ($a_mode=self::PRESENTATION)
 Set Output Mode. More...
 
 getOutputMode ()
 
 setTemplateOutput ($a_output=true)
 
 outputToTemplate ()
 
 setPresentationTitle ($a_title="")
 
 getPresentationTitle ()
 
 setHeader ($a_title="")
 
 getHeader ()
 
 setLinkParams ($l_params="")
 
 getLinkParams ()
 
 setLinkFrame ($l_frame="")
 
 getLinkFrame ()
 
 setPageLinker ($page_linker)
 
 getLinkXML ()
 
 setQuestionXML ($question_xml)
 
 setQuestionHTML ($question_html)
 
 getQuestionXML ()
 
 getQuestionHTML ()
 
 setTemplateTargetVar ($a_variable)
 
 getTemplateTargetVar ()
 
 setTemplateOutputVar ($a_value)
 
 getTemplateOutputVar ()
 
 setSourcecodeDownloadScript ($script_name)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 setLocator (&$a_locator)
 
 setTabs ($a_tabs)
 
 setPageBackTitle ($a_title)
 
 setFileDownloadLink ($a_download_link)
 Set file download link. More...
 
 getFileDownloadLink ()
 Get file download link. More...
 
 setFullscreenLink ($a_fullscreen_link)
 Set fullscreen link. More...
 
 getFullscreenLink ()
 Get fullscreen link. More...
 
 setIntLinkReturn ($a_return)
 
 enableChangeComments ($a_enabled)
 
 isEnabledChangeComments ()
 
 enableNotes ($a_enabled, $a_parent_id)
 
 isEnabledNotes ()
 
 setOfflineDirectory ($offdir)
 set offline directory to offdir More...
 
 getOfflineDirectory ()
 get offline directory More...
 
 setViewPageLink ($a_link, $a_target="")
 set link for "view page" button More...
 
 getViewPageLink ()
 get view page link More...
 
 getViewPageTarget ()
 get view page target frame More...
 
 getViewPageText ()
 get view page text More...
 
 setActivationListener (&$a_obj, $a_meth)
 
 setEnabledNews ($a_enabled, $a_news_obj_id=0, $a_news_obj_type=0)
 Set enabled news. More...
 
 getEnabledNews ()
 Get enabled news. More...
 
 setTabHook ($a_object, $a_function)
 Set tab hook. More...
 
 setEditPreview ($a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 getEditPreview ()
 Get Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 setEnabledTabs ($a_enabledtabs)
 Set Output tabs. More...
 
 getEnabledTabs ()
 Get Output tabs. More...
 
 setEnabledPageFocus ($a_enabledpagefocus)
 Set Enable page focus. More...
 
 getEnabledPageFocus ()
 Get Enable page focus. More...
 
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater. More...
 
 setPrependingHtml ($a_prependinghtml)
 Set Prepending HTML. More...
 
 getPrependingHtml ()
 Get Prepending HTML. More...
 
 setEnableEditing ($a_enableediting)
 Set Enable Editing. More...
 
 getEnableEditing ()
 Get Enable Editing. More...
 
 setRawPageContent ($a_rawpagecontent)
 Set Get raw page content only. More...
 
 getRawPageContent ()
 Get Get raw page content only. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 setCompareMode ($a_val)
 Set compare mode. More...
 
 getCompareMode ()
 Get compare mode. More...
 
 setAbstractOnly ($a_val)
 Set abstract only. More...
 
 getAbstractOnly ()
 Get abstract only. More...
 
 setRenderPageContainer ($a_val)
 Set render page container. More...
 
 getRenderPageContainer ()
 Get render page container. More...
 
 getDisabledText ()
 Get disabled text. More...
 
 activateMetaDataEditor ( $a_rep_obj, $a_type, $a_sub_obj_id, $a_observer_obj=null, $a_observer_func="")
 Activate meda data editor. More...
 
 determineFileDownloadLink ()
 Determine file download link. More...
 
 determineFullscreenLink ()
 Determine fullscreen link. More...
 
 determineSourcecodeDownloadScript ()
 Determine source code download script. More...
 
 getComponentPluginsXML ()
 Put information about activated plugins into XML. More...
 
 executeCommand ()
 execute command More...
 
 setQEditTabs ($a_active)
 Set question editing tabs. More...
 
 onFeedbackEditingForwarding ()
 On feedback editing forwarding. More...
 
 deactivatePage ()
 
 activatePage ()
 
 showPage ()
 display content of page More...
 
 replaceCurlyBrackets ($output)
 Replace curly brackets. More...
 
 addActionsMenu ($a_tpl, $sel_media_mode, $sel_html_mode, $sel_js_mode)
 Add actions menu. More...
 
 addMultiLangActionsAndInfo ($a_list, $a_tpl)
 Add multi-language actions to menu. More...
 
 setEditMode ()
 Set edit mode. More...
 
 setDefaultLinkXml ()
 Set standard link xml. More...
 
 setLinkXml ($xml)
 Set linkXML. More...
 
 getProfileBackUrl ()
 Get profile back url. More...
 
 setProfileBackUrl ($url)
 Get profile back url. More...
 
 downloadFile ()
 Download file of file lists. More...
 
 displayMediaFullscreen ()
 Show media in fullscreen mode. More...
 
 displayMedia ($a_fullscreen=false)
 Display media. More...
 
 download_paragraph ()
 download source code paragraph More...
 
 insertPageToc ($a_output)
 Insert page toc. More...
 
 insertResources ($a_output)
 Insert resources. More...
 
 insertAdvTrigger ($a_output)
 Insert adv content trigger. More...
 
 postOutputProcessing ($a_output)
 Finalizing output processing. More...
 
 previewHistory ()
 Preview history. More...
 
 preview ()
 preview More...
 
 edit ()
 edit ("view" before) More...
 
 insertJSAtPlaceholder ()
 InsertJS at placeholder. More...
 
 initCaptchaForm ()
 Init captcha form. More...
 
 presentation ($a_mode=self::PRESENTATION)
 
 getHTML ()
 
 showMediaFullscreen ($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 ()
 Set screen id component. More...
 
 getTabs ($a_activate="")
 adds tabs to tab gui object More...
 
 compareVersion ()
 Compares two revisions of the page. More...
 
 replaceDiffTags ($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 ($a_content_object=null, $a_enable_private_notes=true, $a_enable_public_notes=false, $a_enable_notes_deletion=false, $a_callback=null)
 Get html for public and/or private notes. More...
 
 processAnswer ()
 Process answer. More...
 
 initialOpenedContent ()
 Initially opened content. More...
 
 initOpenedContentForm ()
 Init form for initially opened content. More...
 
 saveInitialOpenedContent ()
 Save initial opened content. More...
 
 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...
 
 getPagePermaLink ()
 Get page perma link. More...
 

Static Public Member Functions

static getSnippet ($a_id, $a_truncate=false, $a_truncate_length=500, $a_truncate_sign="...", $a_include_picture=false, $a_picture_width=144, $a_picture_height=144, $a_export_directory=null)
 Get first text paragraph of page. More...
 
- Static Public Member Functions inherited from ilPageObjectGUI
static getTinyMenu ( $a_par_type, $a_int_links=false, $a_wiki_links=false, $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)
 Get Tiny Menu. More...
 

Protected Member Functions

 checkAccess ($a_cmd)
 Centralized access management. More...
 
 isInWorkspace ()
 Is current page part of personal workspace blog? More...
 
 cancelEdit ()
 Cancel editing. More...
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 initKeywordsForm ()
 
 getParentObjId ()
 
 getFirstMediaObjectAsTag ($a_width=144, $a_height=144, $a_export_directory=null)
 
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 getBlockingInfoMessage ()
 Get block info message. More...
 
 isPageContainerToBeRendered ()
 
 addResourcesToTemplate (ilGlobalTemplateInterface $tpl)
 Add resources to template. More...
 

Static Protected Member Functions

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

Protected Attributes

 $tabs
 
 $locator
 
 $settings
 
 $node_id
 
 $access_handler
 
 $enable_public_notes
 
 $may_contribute
 
 $fetchall
 
 $blpg
 
 $term
 
- Protected Attributes inherited from ilPageObjectGUI
 $profile_back_url = ""
 
 $tpl
 
 $lng
 
 $ctrl
 
 $tabs_gui
 
 $access
 
 $plugin_admin
 
 $log
 
 $user
 
 $help
 
 $output_mode
 
 $parent_type = ""
 
 $tool_context
 
 $ui
 
 $page_linker
 

Additional Inherited Members

- Data Fields inherited from ilPageObjectGUI
const PRESENTATION = "presentation"
 
const EDIT = "edit"
 
const PREVIEW = "preview"
 
const OFFLINE = "offline"
 
const PRINTING = "print"
 
 $obj
 
 $presentation_title
 
 $target_script
 
 $return_location
 
 $target_var
 
 $template_output_var
 
 $output2template
 
 $link_params
 
 $sourcecode_download_script
 
 $change_comments
 
 $question_html
 
 $activation = false
 
 $activated = true
 
 $editpreview = false
 
 $use_meta_data = false
 
 $link_xml_set = false
 
 $enableediting = true
 
 $rawpagecontent = false
 
 $enabledcontentincludes = false
 
 $compare_mode = false
 
 $page_config = null
 
 $tabs_enabled = true
 
 $render_page_container = false
 
 $pl_start = "{{{{{"
 
 $pl_end = "}}}}}"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
int$a_node
object$a_access_handler
int$a_id
int$a_old_nr
bool$a_enable_notes
bool$a_may_contribute

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

72 {
73 global $DIC;
74
75 $this->tabs = $DIC->tabs();
76 $this->locator = $DIC["ilLocator"];
77 $this->settings = $DIC->settings();
78 $this->user = $DIC->user();
79 $tpl = $DIC["tpl"];
80 $lng = $DIC->language();
81
82 $lng->loadLanguageModule("blog");
83
84 $this->node_id = $a_node_id;
85 $this->access_handler = $a_access_handler;
86 $this->enable_public_notes = (bool) $a_enable_public_notes;
87
88 parent::__construct("blp", $a_id, $a_old_nr);
89
90 // needed for notification
91 $this->getBlogPosting()->setBlogNodeId($this->node_id, $this->isInWorkspace());
92 $this->getBlogPosting()->getPageConfig()->setEditLockSupport(!$this->isInWorkspace());
93
94 // #11151
95 $this->may_contribute = (bool) $a_may_contribute;
96 $this->setEnableEditing($a_may_contribute);
97
98 // content style
99
100 $tpl->setCurrentBlock("SyntaxStyle");
101 $tpl->setVariable(
102 "LOCATION_SYNTAX_STYLESHEET",
104 );
105 $tpl->parseCurrentBlock();
106
107 // #17814
108 $tpl->setCurrentBlock("ContentStyle");
109 $tpl->setVariable(
110 "LOCATION_CONTENT_STYLESHEET",
111 ilObjStyleSheet::getContentStylePath($a_style_sheet_id)
112 );
113 $tpl->parseCurrentBlock();
114
115 // needed for editor
116 $this->setStyleId($a_style_sheet_id);
117
118 $this->blpg = (int) $_GET["blpg"];
119 $this->fetchall = (bool) $_GET["fetchall"];
120 $this->term = ilUtil::stripSlashes($_GET["term"]);
121 }
user()
Definition: user.php:4
$_GET["client_id"]
isInWorkspace()
Is current page part of personal workspace blog?
getBlogPosting()
Get blog posting.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
setEnableEditing($a_enableediting)
Set Enable Editing.
setStyleId($a_styleid)
Set Style Id.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2
$DIC
Definition: xapitoken.php:46

References $_GET, $DIC, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ILIAS\GlobalScreen\Provider\__construct(), getBlogPosting(), ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getSyntaxStylePath(), isInWorkspace(), ilPageObjectGUI\setEnableEditing(), ilPageObjectGUI\setStyleId(), settings(), ilUtil\stripSlashes(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ activatePage()

ilBlogPostingGUI::activatePage (   $a_to_list = false)

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

662 {
663 // send notifications
664 ilObjBlog::sendNotification("new", $this->isInWorkspace(), $this->node_id, $this->getBlogPosting()->getId());
665
666 if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
667 $this->getBlogPosting()->setActive(true);
668 $this->getBlogPosting()->update(true, false, false);
669 }
670 if (!$a_to_list) {
671 $this->ctrl->redirect($this, "edit");
672 } else {
673 $this->ctrl->setParameterByClass("ilobjbloggui", "blpg", "");
674 $this->ctrl->redirectByClass("ilobjbloggui", "");
675 }
676 }
checkAccess($a_cmd)
Centralized access management.
static sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment=null)

References checkAccess(), getBlogPosting(), ilPageObjectGUI\getId(), isInWorkspace(), and ilObjBlog\sendNotification().

+ Here is the call graph for this function:

◆ activatePageToList()

ilBlogPostingGUI::activatePageToList ( )

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

657 {
658 $this->activatePage(true);
659 }

References ilPageObjectGUI\activatePage().

+ Here is the call graph for this function:

◆ cancelBlogPostingDeletion()

ilBlogPostingGUI::cancelBlogPostingDeletion ( )

Cancel blog posting deletion.

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

452 {
454
455 $ilCtrl->redirect($this, "preview");
456 }
global $ilCtrl
Definition: ilias.php:18

References ilPageObjectGUI\$ctrl, and $ilCtrl.

◆ cancelEdit()

ilBlogPostingGUI::cancelEdit ( )
protected

Cancel editing.

Parameters

return

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

616 {
617 $this->ctrl->redirectByClass("ilObjBlogGUI", "");
618 }

◆ checkAccess()

ilBlogPostingGUI::checkAccess (   $a_cmd)
protected

Centralized access management.

Parameters
string$a_cmd
Returns
bool

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

201 {
202 if ($a_cmd == "contribute") {
204 }
205 return $this->access_handler->checkAccess($a_cmd, "", $this->node_id);
206 }

References $may_contribute.

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

+ Here is the caller graph for this function:

◆ confirmBlogPostingDeletion()

ilBlogPostingGUI::confirmBlogPostingDeletion ( )

Delete the blog posting.

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

462 {
465
466 if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
467 // delete all md keywords
468 $md_section = $this->getBlogPosting()->getMDSection();
469 foreach ($md_section->getKeywordIds() as $id) {
470 $md_key = $md_section->getKeyword($id);
471 $md_key->delete();
472 }
473
474 $this->getBlogPosting()->delete();
475 ilUtil::sendSuccess($lng->txt("blog_posting_deleted"), true);
476 }
477
478 $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", ""); // #14363
479 $ilCtrl->redirectByClass("ilobjbloggui", "render");
480 }

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, checkAccess(), and getBlogPosting().

+ Here is the call graph for this function:

◆ deactivatePage()

ilBlogPostingGUI::deactivatePage (   $a_to_list = false)

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

643 {
644 if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
645 $this->getBlogPosting()->unpublish();
646 }
647
648 if (!$a_to_list) {
649 $this->ctrl->redirect($this, "edit");
650 } else {
651 $this->ctrl->setParameterByClass("ilobjbloggui", "blpg", "");
652 $this->ctrl->redirectByClass("ilobjbloggui", "");
653 }
654 }

References checkAccess(), and getBlogPosting().

+ Here is the call graph for this function:

◆ deactivatePageToList()

ilBlogPostingGUI::deactivatePageToList ( )

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

638 {
639 $this->deactivatePage(true);
640 }

References ilPageObjectGUI\deactivatePage().

+ Here is the call graph for this function:

◆ deleteBlogPostingConfirmationScreen()

ilBlogPostingGUI::deleteBlogPostingConfirmationScreen ( )

Delete blog posting confirmation screen.

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

409 {
413
414 if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
415 $confirmation_gui = new ilConfirmationGUI();
416 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
417 $confirmation_gui->setHeaderText($lng->txt("blog_posting_deletion_confirmation"));
418 $confirmation_gui->setCancel($lng->txt("cancel"), "cancelBlogPostingDeletion");
419 $confirmation_gui->setConfirm($lng->txt("delete"), "confirmBlogPostingDeletion");
420
421 $dtpl = new ilTemplate(
422 "tpl.blog_posting_deletion_confirmation.html",
423 true,
424 true,
425 "Modules/Blog"
426 );
427
428 $dtpl->setVariable("PAGE_TITLE", $this->getBlogPosting()->getTitle());
429
430 // notes/comments
431 $cnt_note_users = ilNote::getUserCount(
432 $this->getBlogPosting()->getParentId(),
433 $this->getBlogPosting()->getId(),
434 "wpg"
435 );
436 $dtpl->setVariable(
437 "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
438 $lng->txt("blog_number_users_notes_or_comments")
439 );
440 $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
441
442 $confirmation_gui->addItem("", "", $dtpl->get());
443
444 $tpl->setContent($confirmation_gui->getHTML());
445 }
446 }
Confirmation screen class.
static getUserCount($a_rep_obj_id, $a_obj_id, $a_type)
How many users have attached a note/comment to a given object?
special template class to simplify handling of ITX/PEAR

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, checkAccess(), getBlogPosting(), ilPageObjectGUI\getId(), and ilNote\getUserCount().

+ Here is the call graph for this function:

◆ editDate()

ilBlogPostingGUI::editDate (   $a_form = null)

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

545 {
547 $ilTabs = $this->tabs;
548
549 $ilTabs->clearTargets();
550 $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
551
552 $ilTabs->activateTab("edit");
553
554 if (!$a_form) {
555 $a_form = $this->initDateForm();
556 }
557
558 $tpl->setContent($a_form->getHTML());
559 }

References $tabs, ilPageObjectGUI\$tpl, and initDateForm().

+ Here is the call graph for this function:

◆ editKeywords()

ilBlogPostingGUI::editKeywords ( ilPropertyFormGUI  $a_form = null)

Diplay the form.

Parameters
ilPropertyFormGUI | null$a_form

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

683 {
684 global $DIC;
685
686 $renderer = $DIC->ui()->renderer();
687
688 $ilTabs = $this->tabs;
690
691 $ilTabs->clearTargets();
692 $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
693
694 if (!$this->checkAccess("contribute")) {
695 return;
696 }
697
698 $ilTabs->activateTab("pg");
699
700 if (!$a_form) {
701 $a_form = $this->initKeywordsForm();
702 }
703
704 $tpl->setContent($renderer->render($a_form));
705 }

References $DIC, $tabs, ilPageObjectGUI\$tpl, checkAccess(), and initKeywordsForm().

+ Here is the call graph for this function:

◆ editTitle()

ilBlogPostingGUI::editTitle (   $a_form = null)

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

483 {
485 $ilTabs = $this->tabs;
486
487 $ilTabs->clearTargets();
488 $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
489
490 $ilTabs->activateTab("edit");
491
492 if (!$a_form) {
493 $a_form = $this->initTitleForm();
494 }
495
496 $tpl->setContent($a_form->getHTML());
497 }

References $tabs, ilPageObjectGUI\$tpl, and initTitleForm().

Referenced by updateDate(), and updateTitle().

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

◆ executeCommand()

ilBlogPostingGUI::executeCommand ( )

execute command

Reimplemented from ilPageObjectGUI.

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

127 {
129 $ilTabs = $this->tabs;
130 $ilLocator = $this->locator;
132
133 $next_class = $ilCtrl->getNextClass($this);
134 $cmd = $ilCtrl->getCmd();
135
136 $posting = $this->getBlogPosting();
137 $ilCtrl->setParameter($this, "blpg", $posting->getId());
138
139 switch ($next_class) {
140 case "ilnotegui":
141 $tpl->setTitle(ilObject::_lookupTitle($this->getBlogPosting()->getBlogId()) . ": " . // #15017
142 $posting->getTitle());
143 $tpl->setTitleIcon(
144 ilUtil::getImagePath("icon_blog.svg"),
145 $this->lng->txt("obj_blog")
146 ); // #12879
147 return $this->previewFullscreen();
148
149 default:
150 if ($posting) {
151 if ($ilCtrl->getCmd() == "deactivatePageToList") {
152 ilUtil::sendSuccess($this->lng->txt("blog_draft_info"), true);
153 } elseif ($ilCtrl->getCmd() == "activatePageToList") {
154 ilUtil::sendSuccess($this->lng->txt("blog_new_posting_info"), true);
155 }
156 $this->setPresentationTitle($posting->getTitle());
157
158 $tpl->setTitle(ilObject::_lookupTitle($this->getBlogPosting()->getBlogId()) . ": " . // #15017
159 $posting->getTitle());
160 $tpl->setTitleIcon(
161 ilUtil::getImagePath("icon_blog.svg"),
162 $this->lng->txt("obj_blog")
163 ); // #12879
164
165 $ilLocator->addItem(
166 $posting->getTitle(),
167 $ilCtrl->getLinkTarget($this, "preview")
168 );
169 }
170 return parent::executeCommand();
171 }
172 }
previewFullscreen()
Needed for portfolio/blog handling.
static _lookupTitle($a_id)
lookup object title
setPresentationTitle($a_title="")
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilPageObjectGUI\$ctrl, $ilCtrl, $locator, $tabs, ilPageObjectGUI\$tpl, ilObject\_lookupTitle(), getBlogPosting(), ilUtil\getImagePath(), previewFullscreen(), and ilPageObjectGUI\setPresentationTitle().

+ Here is the call graph for this function:

◆ getActivationCaptions()

ilBlogPostingGUI::getActivationCaptions ( )
protected

Get captions for activation action menu entries.

Reimplemented from ilPageObjectGUI.

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

630 {
632
633 return array("deactivatePage" => $lng->txt("blog_toggle_draft"),
634 "activatePage" => $lng->txt("blog_toggle_final"));
635 }

References ilPageObjectGUI\$lng.

◆ getBlogPosting()

ilBlogPostingGUI::getBlogPosting ( )

Get blog posting.

@returnilBlogPosting

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

190 {
191 return $this->getPageObject();
192 }
getPageObject()
Get Page Object.

References ilPageObjectGUI\getPageObject().

Referenced by __construct(), activatePage(), confirmBlogPostingDeletion(), deactivatePage(), deleteBlogPostingConfirmationScreen(), executeCommand(), getTabs(), initKeywordsForm(), postOutputProcessing(), preview(), saveKeywordsForm(), and showPage().

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

◆ getDisabledText()

ilBlogPostingGUI::getDisabledText ( )

Get disabled text.

Parameters

return

Reimplemented from ilPageObjectGUI.

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

913 {
914 return $this->lng->txt("blog_draft_text");
915 }

◆ getFirstMediaObjectAsTag()

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

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

848 {
849 $this->obj->buildDom();
850 $mob_ids = $this->obj->collectMediaObjects();
851 if ($mob_ids) {
852 foreach ($mob_ids as $mob_id) {
853 $mob_obj = new ilObjMediaObject($mob_id);
854 $mob_item = $mob_obj->getMediaItem("Standard");
855 if (stristr($mob_item->getFormat(), "image")) {
856 $mob_size = $mob_item->getOriginalSize();
857 if ($mob_size["width"] >= $a_width ||
858 $mob_size["height"] >= $a_height) {
859 if (!$a_export_directory) {
860 $mob_dir = ilObjMediaObject::_getDirectory($mob_obj->getId());
861 } else {
862 // see ilCOPageHTMLExport::exportHTMLMOB()
863 $mob_dir = "./mobs/mm_" . $mob_obj->getId();
864 }
865 $mob_res = self::parseImage(
866 $mob_size["width"],
867 $mob_size["height"],
868 $a_width,
869 $a_height
870 );
871
872
873 $location = $mob_item->getLocationType() == "Reference"
874 ? $mob_item->getLocation()
875 : $mob_dir . "/" . $mob_item->getLocation();
876
877 return '<img' .
878 ' src="' . $location . '"' .
879 ' width="' . $mob_res[0] . '"' .
880 ' height="' . $mob_res[1] . '"' .
881 ' class="ilBlogListItemSnippetPreviewImage ilFloatLeft noMirror"' .
882 ' />';
883 }
884 }
885 }
886 }
887 }
$location
Definition: buildRTE.php:44
static parseImage($src_width, $src_height, $tgt_width, $tgt_height)
Class ilObjMediaObject.
static _getDirectory($a_mob_id)
Get absolute directory.

References $location, ilObjMediaObject\_getDirectory(), and parseImage().

+ Here is the call graph for this function:

◆ getParentObjId()

ilBlogPostingGUI::getParentObjId ( )
protected

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

767 {
768 if ($this->node_id) {
769 if ($this->isInWorkspace()) {
770 return $this->access_handler->getTree()->lookupObjectId($this->node_id);
771 } else {
772 return ilObject::_lookupObjId($this->node_id);
773 }
774 }
775 }
static _lookupObjId($a_id)

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

+ Here is the call graph for this function:

◆ getSnippet()

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

Get first text paragraph of page.

Parameters
int$a_id
bool$a_truncate
int$a_truncate_length
bool$a_include_picture
int$a_picture_width
int$a_picture_height
string$a_export_directory
Returns
string

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

816 {
817 $bpgui = new self(0, null, $a_id);
818
819 // scan the full page for media objects
820 if ($a_include_picture) {
821 $img = $bpgui->getFirstMediaObjectAsTag($a_picture_width, $a_picture_height, $a_export_directory);
822 }
823
824 $bpgui->setRawPageContent(true);
825 $bpgui->setAbstractOnly(true);
826
827 // #8627: export won't work - should we set offline mode?
828 $bpgui->setFileDownloadLink(".");
829 $bpgui->setFullscreenLink(".");
830 $bpgui->setSourcecodeDownloadScript(".");
831 $bpgui->setProfileBackUrl(".");
832
833 // render without title
834 $page = $bpgui->showPage();
835
836 if ($a_truncate) {
837 $page = ilPageObject::truncateHTML($page, $a_truncate_length, $a_truncate_sign);
838 }
839
840 if ($img) {
841 $page = '<div>' . $img . $page . '</div><div style="clear:both;"></div>';
842 }
843
844 return $page;
845 }
static truncateHTML($a_text, $a_length=100, $a_ending='...', $a_exact=false, $a_consider_html=true)
Truncate (html) string.

References $img, and ilPageObject\truncateHTML().

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

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

◆ getTabs()

ilBlogPostingGUI::getTabs (   $a_activate = "")

Get tabs.

Parameters
string$a_activate

Reimplemented from ilPageObjectGUI.

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

397 {
399
400 $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", $this->getBlogPosting()->getId());
401
402 parent::getTabs($a_activate);
403 }

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

+ Here is the call graph for this function:

◆ initDateForm()

ilBlogPostingGUI::initDateForm ( )

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

587 {
590
591 $form = new ilPropertyFormGUI();
592 $form->setFormAction($ilCtrl->getFormAction($this));
593 $form->setTitle($lng->txt('blog_edit_date'));
594
595 $date = new ilDateTimeInputGUI($lng->txt("date"), "date");
596 $date->setRequired(true);
597 $date->setShowTime(true);
598 $date->setInfo($lng->txt('blog_edit_date_info'));
599 $form->addItem($date);
600
601 $date->setDate($this->getPageObject()->getCreated());
602
603 $form->addCommandButton('updateDate', $lng->txt('save'));
604 $form->addCommandButton('cancelEdit', $lng->txt('cancel'));
605
606 return $form;
607 }
This class represents a date/time property in a property form.
This class represents a property form user interface.

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, and ilPageObjectGUI\getPageObject().

Referenced by editDate(), and updateDate().

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

◆ initKeywordsForm()

ilBlogPostingGUI::initKeywordsForm ( )
protected

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

708 {
709 global $DIC;
710
711 $ui_factory = $DIC->ui()->factory();
712 //$ilUser = $this->user;
713
714 $md_section = $this->getBlogPosting()->getMDSection();
715
716 $keywords = array();
717 foreach ($ids = $md_section->getKeywordIds() as $id) {
718 $md_key = $md_section->getKeyword($id);
719 if (trim($md_key->getKeyword()) != "") {
720 //$keywords[$md_key->getKeywordLanguageCode()][]
721 // = $md_key->getKeyword();
722 $keywords[] = $md_key->getKeyword();
723 }
724 }
725
726 // language is not "used" anywhere
727 /*$ulang = $ilUser->getLanguage();
728 if($keywords[$ulang])
729 {
730 asort($keywords[$ulang]);
731 }*/
732
733 // other keywords in blog
734 $other = array();
735 foreach (array_keys(ilBlogPosting::getAllPostings($this->getBlogPosting()->getBlogId())) as $posting_id) {
736 if ($posting_id != $this->getBlogPosting()->getId()) {
737 $other = array_merge($other, ilBlogPosting::getKeywords($this->getBlogPosting()->getBlogId(), $posting_id));
738 }
739 }
740 // #17414
741 $other = array_unique($other);
742 sort($other, SORT_LOCALE_STRING);
743 if (is_array($keywords[$ulang])) {
744 $other = array_diff($other, $keywords[$ulang]);
745 }
746
747 $input_tag = $ui_factory->input()->field()->tag($this->lng->txt("blog_keywords"), $other, $this->lng->txt("blog_keyword_enter"));
748 if (count($keywords) > 0) {
749 $input_tag = $input_tag->withValue($keywords);
750 }
751
752 $DIC->ctrl()->setParameter(
753 $this,
754 'tags',
755 'tags_processing'
756 );
757
758 $section = $ui_factory->input()->field()->section([$input_tag], $this->lng->txt("blog_edit_keywords"), "");
759
760 $form_action = $DIC->ctrl()->getFormAction($this, "saveKeywordsForm");
761 $form = $ui_factory->input()->container()->form()->standard($form_action, ["tags" => $section]);
762
763 return $form;
764 }
$section
Definition: Utf8Test.php:83
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
static getKeywords($a_obj_id, $a_posting_id)

References $DIC, $section, ilBlogPosting\getAllPostings(), getBlogPosting(), ilPageObjectGUI\getId(), and ilBlogPosting\getKeywords().

Referenced by editKeywords(), and saveKeywordsForm().

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

◆ initTitleForm()

ilBlogPostingGUI::initTitleForm ( )

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

524 {
527
528 $form = new ilPropertyFormGUI();
529 $form->setFormAction($ilCtrl->getFormAction($this));
530 $form->setTitle($lng->txt('blog_rename_posting'));
531
532 $title = new ilTextInputGUI($lng->txt("title"), "title");
533 $title->setRequired(true);
534 $form->addItem($title);
535
536 $title->setValue($this->getPageObject()->getTitle());
537
538 $form->addCommandButton('updateTitle', $lng->txt('save'));
539 $form->addCommandButton('cancelEdit', $lng->txt('cancel'));
540
541 return $form;
542 }
This class represents a text property in a property form.

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, and ilPageObjectGUI\getPageObject().

Referenced by editTitle(), and updateTitle().

+ 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?

Returns
bool

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

338 {
339 $class = '';
340 if (is_object($this->access_handler)) {
341 $class = get_class($this->access_handler);
342 }
343
344 return stristr($class, "workspace");
345 }

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

+ Here is the caller graph for this function:

◆ observeNoteAction()

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

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

622 {
623 // #10040 - get note text
624 $note = new ilNote($a_note_id);
625 $note = $note->getText();
626 ilObjBlog::sendNotification("comment", $this->isInWorkspace(), $this->node_id, $a_posting_id, $note);
627 }
Note class.

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

+ Here is the call graph for this function:

◆ parseImage()

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

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

890 {
891 $ratio_width = $ratio_height = 1;
892 if ($src_width > $tgt_width) {
893 $ratio_width = $tgt_width / $src_width;
894 }
895 if ($src_height > $tgt_height) {
896 $ratio_height = $tgt_height / $src_height;
897 }
898 $shrink_ratio = min($ratio_width, $ratio_height);
899
900 return array(
901 (int) round($src_width * $shrink_ratio),
902 (int) round($src_height * $shrink_ratio)
903 );
904 }

Referenced by getFirstMediaObjectAsTag().

+ Here is the caller graph for this function:

◆ postOutputProcessing()

ilBlogPostingGUI::postOutputProcessing (   $a_output)

Finalizing output processing.

Parameters
string$a_output
Returns
string

Reimplemented from ilPageObjectGUI.

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

354 {
355 // #8626/#9370
356 if (($this->getOutputMode() == "preview" || $this->getOutputMode() == "offline")
357 && !$this->getAbstractOnly() && $this->add_date) {
358 $author = "";
359 if (!$this->isInWorkspace()) {
360 $authors = array();
361 $author_id = $this->getBlogPosting()->getAuthor();
362 if ($author_id) {
363 $authors[] = ilUserUtil::getNamePresentation($author_id);
364 }
365
366 foreach (ilBlogPosting::getPageContributors("blp", $this->getBlogPosting()->getId()) as $editor) {
367 if ($editor["user_id"] != $author_id) {
368 $authors[] = ilUserUtil::getNamePresentation($editor["user_id"]);
369 }
370 }
371
372 if ($authors) {
373 $author = implode(", ", $authors) . " - ";
374 }
375 }
376
377 // prepend creation date
380 $prefix = "<div class=\"il_BlockInfo\" style=\"text-align:right\">" .
381 $author . ilDatePresentation::formatDate($this->getBlogPosting()->getCreated()) .
382 "</div>";
384
385 $a_output = $prefix . $a_output;
386 }
387
388 return $a_output;
389 }
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used
getAbstractOnly()
Get abstract only.
static getPageContributors($a_parent_type, $a_page_id, $a_lang="-")
Get all contributors for parent object.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:

References ilDatePresentation\formatDate(), ilPageObjectGUI\getAbstractOnly(), getBlogPosting(), ilPageObjectGUI\getId(), ilUserUtil\getNamePresentation(), ilPageObjectGUI\getOutputMode(), ilPageObject\getPageContributors(), isInWorkspace(), ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

+ Here is the call graph for this function:

◆ preview()

ilBlogPostingGUI::preview (   $a_mode = null)

Preview blog posting.

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

212 {
213 global $DIC;
214
218
219 $toolbar = $DIC->toolbar();
220
221 $this->getBlogPosting()->increaseViewCnt();
222
223 $wtpl = new ilTemplate(
224 "tpl.blog_page_view_main_column.html",
225 true,
226 true,
227 "Modules/Blog"
228 );
229
230 // page commands
231 if (!$a_mode) {
232 if (!$this->getEnableEditing()) {
233 $this->ctrl->redirect($this, "previewFullscreen");
234 }
235 /*
236 // delete
237 $page_commands = false;
238 if ($this->checkAccess("write"))
239 {
240 $wtpl->setCurrentBlock("page_command");
241 $wtpl->setVariable("HREF_PAGE_CMD",
242 $ilCtrl->getLinkTarget($this, "deleteBlogPostingConfirmationScreen"));
243 $wtpl->setVariable("TXT_PAGE_CMD", $lng->txt("delete"));
244 $wtpl->parseCurrentBlock();
245 }
246 if ($page_commands)
247 {
248 $wtpl->setCurrentBlock("page_commands");
249 $wtpl->parseCurrentBlock();
250 }
251 */
252 } else {
253 $callback = array($this, "observeNoteAction");
254
255 // notes
256
257 $may_delete_comments = ($this->checkAccess("contribute") &&
258 $ilSetting->get("comments_del_tutor", 1));
259
260 $wtpl->setVariable("TOOLBAR", $toolbar->getHTML());
261 $wtpl->setVariable("NOTES", $this->getNotesHTML(
262 $this->getBlogPosting(),
263 false,
264 $this->enable_public_notes,
265 $may_delete_comments,
266 $callback
267 ));
268 }
269
270 // permanent link
271 if ($a_mode != "embedded") {
272 $append = ($this->blpg > 0)
273 ? "_" . $this->blpg
274 : "";
275 if ($this->isInWorkspace()) {
276 $append .= "_wsp";
277 }
278 $tpl->setPermanentLink("blog", $this->node_id, $append);
279 }
280
281 $wtpl->setVariable("PAGE", parent::preview());
282
283 $tpl->setLoginTargetPar("blog_" . $this->node_id . $append);
284
285 $ilCtrl->setParameter($this, "blpg", $this->getBlogPosting()->getId());
286
287 return $wtpl->get();
288 }
getNotesHTML($a_content_object=null, $a_enable_private_notes=true, $a_enable_public_notes=false, $a_enable_notes_deletion=false, $a_callback=null)
Get html for public and/or private notes.
getEnableEditing()
Get Enable Editing.
global $ilSetting
Definition: privfeed.php:17

References ilPageObjectGUI\$ctrl, $DIC, $ilCtrl, $ilSetting, $settings, ilPageObjectGUI\$tpl, checkAccess(), getBlogPosting(), ilPageObjectGUI\getEnableEditing(), ilPageObjectGUI\getNotesHTML(), and isInWorkspace().

+ Here is the call graph for this function:

◆ previewEmbedded()

ilBlogPostingGUI::previewEmbedded ( )

Needed for portfolio/blog handling.

Returns
string

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

296 {
297 return $this->preview("embedded");
298 }

References ilPageObjectGUI\preview().

+ Here is the call graph for this function:

◆ previewFullscreen()

ilBlogPostingGUI::previewFullscreen ( )

Needed for portfolio/blog handling.

Returns
string

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

306 {
307 $this->add_date = true;
308 return $this->preview("fullscreen");
309 }

References ilPageObjectGUI\preview().

Referenced by executeCommand().

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

◆ saveKeywordsForm()

ilBlogPostingGUI::saveKeywordsForm ( )

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

778 {
779 global $DIC;
780
781 $request = $DIC->http()->request();
782 $form = $this->initKeywordsForm();
783
784 if ($request->getMethod() == "POST"
785 && $request->getQueryParams()['tags'] == 'tags_processing') {
786 $form = $form->withRequest($request);
787 $result = $form->getData();
788 //TODO identify the input instead of use 0
789 $keywords = $result["tags"][0];
790
791 if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
792 if (is_array($keywords)) {
793 $this->getBlogPosting()->updateKeywords($keywords);
794 } else {
795 $this->getBlogPosting()->updateKeywords([]);
796 }
797 }
798
799 $this->ctrl->redirectByClass("ilObjBlogGUI", "");
800 }
801 }
$result

References $DIC, $result, checkAccess(), getBlogPosting(), and initKeywordsForm().

+ Here is the call graph for this function:

◆ setBlogPosting()

ilBlogPostingGUI::setBlogPosting ( ilBlogPosting  $a_posting)

Set blog posting.

Parameters
ilBlogPosting$a_posting

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

180 {
181 $this->setPageObject($a_posting);
182 }
setPageObject(ilPageObject $a_pg_obj)
Set Page Object.

References ilPageObjectGUI\setPageObject().

+ Here is the call graph for this function:

◆ showPage()

ilBlogPostingGUI::showPage (   $a_title = "")

Embedded posting in portfolio.

Returns
string

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

317 {
318 $this->setTemplateOutput(false);
319
320 if (!$this->getAbstractOnly()) {
321 if ($a_title != "") {
322 $this->setPresentationTitle($a_title);
323 } else {
324 $this->setPresentationTitle($this->getBlogPosting()->getTitle());
325 }
326 }
327 $this->getBlogPosting()->increaseViewCnt();
328
329 return parent::showPage();
330 }
setTemplateOutput($a_output=true)

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

+ Here is the call graph for this function:

◆ updateDate()

ilBlogPostingGUI::updateDate ( )

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

562 {
565
566 $form = $this->initDateForm();
567 if ($form->checkInput()) {
568 if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
569 $dt = $form->getItemByPostVar("date");
570 $dt = $dt->getDate();
571
572 $page = $this->getPageObject();
573 $page->setCreated($dt);
574 $page->update();
575
576 ilUtil::sendSuccess($lng->txt("settings_saved"), true);
577 //$ilCtrl->redirect($this, "preview");
578 $this->ctrl->redirectByClass("ilObjBlogGUI", "");
579 }
580 }
581
582 $form->setValuesByPost();
583 $this->editTitle($form);
584 }

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, checkAccess(), editTitle(), ilPageObjectGUI\getPageObject(), and initDateForm().

+ Here is the call graph for this function:

◆ updateTitle()

ilBlogPostingGUI::updateTitle ( )

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

500 {
503
504 $form = $this->initTitleForm();
505 if ($form->checkInput()) {
506 if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
507 $page = $this->getPageObject();
508 $page->setTitle($form->getInput("title"));
509 $page->update();
510
511 $page->handleNews(true);
512
513 ilUtil::sendSuccess($lng->txt("settings_saved"), true);
514 //$ilCtrl->redirect($this, "preview");
515 $this->ctrl->redirectByClass("ilObjBlogGUI", "");
516 }
517 }
518
519 $form->setValuesByPost();
520 $this->editTitle($form);
521 }

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, checkAccess(), editTitle(), ilPageObjectGUI\getPageObject(), and initTitleForm().

+ Here is the call graph for this function:

Field Documentation

◆ $access_handler

ilBlogPostingGUI::$access_handler
protected

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

◆ $blpg

ilBlogPostingGUI::$blpg
protected

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

◆ $enable_public_notes

ilBlogPostingGUI::$enable_public_notes
protected

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

◆ $fetchall

ilBlogPostingGUI::$fetchall
protected

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

◆ $locator

ilBlogPostingGUI::$locator
protected

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

Referenced by executeCommand().

◆ $may_contribute

ilBlogPostingGUI::$may_contribute
protected

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

Referenced by checkAccess().

◆ $node_id

ilBlogPostingGUI::$node_id
protected

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

◆ $settings

ilBlogPostingGUI::$settings
protected

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

Referenced by preview().

◆ $tabs

ilBlogPostingGUI::$tabs
protected

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

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

◆ $term

ilBlogPostingGUI::$term
protected

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


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