ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
 getActivationCaptions ()
 
 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...
 
 getCommentsHTMLExport ()
 
 finishEditing ()
 
- Public Member Functions inherited from ilPageObjectGUI
 __construct ( $a_parent_type, $a_id, $a_old_nr=0, $a_prevent_get_id=false, $a_lang="", $concrete_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...
 
 setOpenPlaceHolder ($a_val)
 Set open placeholder. More...
 
 getOpenPlaceHolder ()
 Get open placeholder. 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, $pcid="")
 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...
 
 getEnabledHref ()
 
 setEnabledHref (bool $enable)
 
 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...
 
 getActivationCaptions ()
 Get captions for activation action menu entries. 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...
 
 getBlockingInfoMessage ()
 Get block info message. 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, $export=false)
 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...
 
 finishEditing ()
 
 getPagePermaLink ()
 Get page perma link. More...
 
 getAdditionalPageActions ()
 Get additional page actions. 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, \ILIAS\COPage\Editor\Server\UIWrapper $ui_wrapper=null)
 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...
 
 initKeywordsForm ()
 
 getParentObjId ()
 
 getFirstMediaObjectAsTag ($a_width=144, $a_height=144, $a_export_directory=null)
 
 showEditToolbar ()
 Show edit toolbar. More...
 
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 showEditToolbar ()
 Show edit toolbar. More...
 
 setEditorToolContext ()
 Set editor tool context. More...
 
 initEditing ()
 Init editing. More...
 
 showEditLockInfo ()
 
 setBackToEditTabs ()
 
 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 = ""
 
 $enabled_href = true
 
 $tpl
 
 $lng
 
 $ctrl
 
 $tabs_gui
 
 $access
 
 $plugin_admin
 
 $log
 
 $user
 
 $help
 
 $output_mode
 
 $parent_type = ""
 
 $tool_context
 
 $ui
 
 $page_linker
 
 $abstract_pcid = ""
 
 $toolbar
 
 $open_place_holder
 

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.

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().

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  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
settings()
Definition: settings.php:2
$_GET["client_id"]
setEnableEditing($a_enableediting)
Set Enable Editing.
user()
Definition: user.php:4
getBlogPosting()
Get blog posting.
global $DIC
Definition: goto.php:24
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getSyntaxStylePath()
get syntax style path
setStyleId($a_styleid)
Set Style Id.
__construct(Container $dic, ilPlugin $plugin)
isInWorkspace()
Is current page part of personal workspace blog?
+ Here is the call graph for this function:

Member Function Documentation

◆ activatePage()

ilBlogPostingGUI::activatePage (   $a_to_list = false)

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

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

658  {
659  // send notifications
660  ilObjBlog::sendNotification("new", $this->isInWorkspace(), $this->node_id, $this->getBlogPosting()->getId());
661 
662  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
663  $this->getBlogPosting()->setActive(true);
664  $this->getBlogPosting()->update(true, false, false);
665  }
666  if (!$a_to_list) {
667  $this->ctrl->redirect($this, "edit");
668  } else {
669  $this->ctrl->setParameterByClass("ilobjbloggui", "blpg", "");
670  $this->ctrl->redirectByClass("ilobjbloggui", "");
671  }
672  }
getBlogPosting()
Get blog posting.
isInWorkspace()
Is current page part of personal workspace blog?
checkAccess($a_cmd)
Centralized access management.
static sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment=null)
+ Here is the call graph for this function:

◆ activatePageToList()

ilBlogPostingGUI::activatePageToList ( )

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

References ilPageObjectGUI\activatePage().

653  {
654  $this->activatePage(true);
655  }
+ Here is the call graph for this function:

◆ cancelBlogPostingDeletion()

ilBlogPostingGUI::cancelBlogPostingDeletion ( )

Cancel blog posting deletion.

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

References ilPageObjectGUI\$ctrl.

448  {
449  $ilCtrl = $this->ctrl;
450 
451  $ilCtrl->redirect($this, "preview");
452  }

◆ cancelEdit()

ilBlogPostingGUI::cancelEdit ( )
protected

Cancel editing.

Parameters

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

612  {
613  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
614  }

◆ checkAccess()

ilBlogPostingGUI::checkAccess (   $a_cmd)
protected

Centralized access management.

Parameters
string$a_cmd
Returns
bool

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

References $may_contribute.

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

197  {
198  if ($a_cmd == "contribute") {
199  return $this->may_contribute;
200  }
201  return $this->access_handler->checkAccess($a_cmd, "", $this->node_id);
202  }
+ Here is the caller graph for this function:

◆ confirmBlogPostingDeletion()

ilBlogPostingGUI::confirmBlogPostingDeletion ( )

Delete the blog posting.

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

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

458  {
459  $ilCtrl = $this->ctrl;
460  $lng = $this->lng;
461 
462  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
463  // delete all md keywords
464  $md_section = $this->getBlogPosting()->getMDSection();
465  foreach ($md_section->getKeywordIds() as $id) {
466  $md_key = $md_section->getKeyword($id);
467  $md_key->delete();
468  }
469 
470  $this->getBlogPosting()->delete();
471  ilUtil::sendSuccess($lng->txt("blog_posting_deleted"), true);
472  }
473 
474  $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", ""); // #14363
475  $ilCtrl->redirectByClass("ilobjbloggui", "render");
476  }
getBlogPosting()
Get blog posting.
checkAccess($a_cmd)
Centralized access management.
+ Here is the call graph for this function:

◆ deactivatePage()

ilBlogPostingGUI::deactivatePage (   $a_to_list = false)

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

References checkAccess(), and getBlogPosting().

639  {
640  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
641  $this->getBlogPosting()->unpublish();
642  }
643 
644  if (!$a_to_list) {
645  $this->ctrl->redirect($this, "edit");
646  } else {
647  $this->ctrl->setParameterByClass("ilobjbloggui", "blpg", "");
648  $this->ctrl->redirectByClass("ilobjbloggui", "");
649  }
650  }
getBlogPosting()
Get blog posting.
checkAccess($a_cmd)
Centralized access management.
+ Here is the call graph for this function:

◆ deactivatePageToList()

ilBlogPostingGUI::deactivatePageToList ( )

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

References ilPageObjectGUI\deactivatePage().

634  {
635  $this->deactivatePage(true);
636  }
+ Here is the call graph for this function:

◆ deleteBlogPostingConfirmationScreen()

ilBlogPostingGUI::deleteBlogPostingConfirmationScreen ( )

Delete blog posting confirmation screen.

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

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

405  {
406  $tpl = $this->tpl;
407  $ilCtrl = $this->ctrl;
408  $lng = $this->lng;
409 
410  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
411  $confirmation_gui = new ilConfirmationGUI();
412  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
413  $confirmation_gui->setHeaderText($lng->txt("blog_posting_deletion_confirmation"));
414  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelBlogPostingDeletion");
415  $confirmation_gui->setConfirm($lng->txt("delete"), "confirmBlogPostingDeletion");
416 
417  $dtpl = new ilTemplate(
418  "tpl.blog_posting_deletion_confirmation.html",
419  true,
420  true,
421  "Modules/Blog"
422  );
423 
424  $dtpl->setVariable("PAGE_TITLE", $this->getBlogPosting()->getTitle());
425 
426  // notes/comments
427  $cnt_note_users = ilNote::getUserCount(
428  $this->getBlogPosting()->getParentId(),
429  $this->getBlogPosting()->getId(),
430  "wpg"
431  );
432  $dtpl->setVariable(
433  "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
434  $lng->txt("blog_number_users_notes_or_comments")
435  );
436  $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
437 
438  $confirmation_gui->addItem("", "", $dtpl->get());
439 
440  $tpl->setContent($confirmation_gui->getHTML());
441  }
442  }
static getUserCount($a_rep_obj_id, $a_obj_id, $a_type)
How many users have attached a note/comment to a given object?
getBlogPosting()
Get blog posting.
checkAccess($a_cmd)
Centralized access management.
Confirmation screen class.
+ Here is the call graph for this function:

◆ editDate()

ilBlogPostingGUI::editDate (   $a_form = null)

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

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

541  {
542  $tpl = $this->tpl;
543  $ilTabs = $this->tabs;
544 
545  $ilTabs->clearTargets();
546  $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
547 
548  $ilTabs->activateTab("edit");
549 
550  if (!$a_form) {
551  $a_form = $this->initDateForm();
552  }
553 
554  $tpl->setContent($a_form->getHTML());
555  }
+ 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 678 of file class.ilBlogPostingGUI.php.

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

679  {
680  global $DIC;
681 
682  $renderer = $DIC->ui()->renderer();
683 
684  $ilTabs = $this->tabs;
685  $tpl = $this->tpl;
686 
687  $ilTabs->clearTargets();
688  $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
689 
690  if (!$this->checkAccess("contribute")) {
691  return;
692  }
693 
694  $ilTabs->activateTab("pg");
695 
696  if (!$a_form) {
697  $a_form = $this->initKeywordsForm();
698  }
699 
700  $tpl->setContent($renderer->render($a_form));
701  }
global $DIC
Definition: goto.php:24
checkAccess($a_cmd)
Centralized access management.
+ Here is the call graph for this function:

◆ editTitle()

ilBlogPostingGUI::editTitle (   $a_form = null)

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

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

Referenced by updateDate(), and updateTitle().

479  {
480  $tpl = $this->tpl;
481  $ilTabs = $this->tabs;
482 
483  $ilTabs->clearTargets();
484  $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
485 
486  $ilTabs->activateTab("edit");
487 
488  if (!$a_form) {
489  $a_form = $this->initTitleForm();
490  }
491 
492  $tpl->setContent($a_form->getHTML());
493  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilBlogPostingGUI::executeCommand ( )

execute command

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

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

127  {
128  $ilCtrl = $this->ctrl;
129  $ilTabs = $this->tabs;
130  $ilLocator = $this->locator;
131  $tpl = $this->tpl;
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  // $this->getTabs();
142  // $ilTabs->setTabActive("pg");
143  return $this->previewFullscreen();
144 
145  default:
146  if ($posting) {
147  if ($ilCtrl->getCmd() == "deactivatePageToList") {
148  ilUtil::sendSuccess($this->lng->txt("blog_draft_info"), true);
149  } elseif ($ilCtrl->getCmd() == "activatePageToList") {
150  ilUtil::sendSuccess($this->lng->txt("blog_new_posting_info"), true);
151  }
152  $this->setPresentationTitle($posting->getTitle());
153 
154  $tpl->setTitle(ilObject::_lookupTitle($this->getBlogPosting()->getBlogId()) . ": " . // #15017
155  $posting->getTitle());
156  $tpl->setTitleIcon(
157  ilUtil::getImagePath("icon_blog.svg"),
158  $this->lng->txt("obj_blog")
159  ); // #12879
160 
161  $ilLocator->addItem(
162  $posting->getTitle(),
163  $ilCtrl->getLinkTarget($this, "preview")
164  );
165  }
166  return parent::executeCommand();
167  }
168  }
static _lookupTitle($a_id)
lookup object title
previewFullscreen()
Needed for portfolio/blog handling.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getBlogPosting()
Get blog posting.
setPresentationTitle($a_title="")
+ Here is the call graph for this function:

◆ finishEditing()

ilBlogPostingGUI::finishEditing ( )

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

936  {
937  $this->ctrl->setParameterByClass("ilobjbloggui", "bmn", "");
938  $this->ctrl->redirectByClass("ilobjbloggui", "render");
939  }

◆ getActivationCaptions()

ilBlogPostingGUI::getActivationCaptions ( )

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

References ilPageObjectGUI\$lng.

626  {
627  $lng = $this->lng;
628 
629  return array("deactivatePage" => $lng->txt("blog_toggle_draft"),
630  "activatePage" => $lng->txt("blog_toggle_final"));
631  }

◆ getBlogPosting()

ilBlogPostingGUI::getBlogPosting ( )

Get blog posting.

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

References ilPageObjectGUI\getPageObject().

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

186  {
187  return $this->getPageObject();
188  }
getPageObject()
Get Page Object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCommentsHTMLExport()

ilBlogPostingGUI::getCommentsHTMLExport ( )
Returns
string

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

References getBlogPosting(), and ilPageObjectGUI\getNotesHTML().

917  {
918  return $this->getNotesHTML(
919  $this->getBlogPosting(),
920  false,
921  $this->enable_public_notes,
922  false,
923  null,
924  true
925  );
926  }
getBlogPosting()
Get blog posting.
getNotesHTML($a_content_object=null, $a_enable_private_notes=true, $a_enable_public_notes=false, $a_enable_notes_deletion=false, $a_callback=null, $export=false)
Get html for public and/or private notes.
+ Here is the call graph for this function:

◆ getDisabledText()

ilBlogPostingGUI::getDisabledText ( )

Get disabled text.

Parameters

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

909  {
910  return $this->lng->txt("blog_draft_text");
911  }

◆ getFirstMediaObjectAsTag()

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

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

References $location, and ilObjMediaObject\_getDirectory().

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

◆ getParentObjId()

ilBlogPostingGUI::getParentObjId ( )
protected

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

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

763  {
764  if ($this->node_id) {
765  if ($this->isInWorkspace()) {
766  return $this->access_handler->getTree()->lookupObjectId($this->node_id);
767  } else {
768  return ilObject::_lookupObjId($this->node_id);
769  }
770  }
771  }
static _lookupObjId($a_id)
isInWorkspace()
Is current page part of personal workspace blog?
+ 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 811 of file class.ilBlogPostingGUI.php.

References $img, and ilPageObject\truncateHTML().

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

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

Get tabs.

Parameters
string$a_activate

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

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

393  {
394  $ilCtrl = $this->ctrl;
395 
396  $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", $this->getBlogPosting()->getId());
397 
398  parent::getTabs($a_activate);
399  }
getBlogPosting()
Get blog posting.
+ Here is the call graph for this function:

◆ initDateForm()

ilBlogPostingGUI::initDateForm ( )

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

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

Referenced by editDate(), and updateDate().

583  {
584  $lng = $this->lng;
585  $ilCtrl = $this->ctrl;
586 
587  $form = new ilPropertyFormGUI();
588  $form->setFormAction($ilCtrl->getFormAction($this));
589  $form->setTitle($lng->txt('blog_edit_date'));
590 
591  $date = new ilDateTimeInputGUI($lng->txt("date"), "date");
592  $date->setRequired(true);
593  $date->setShowTime(true);
594  $date->setInfo($lng->txt('blog_edit_date_info'));
595  $form->addItem($date);
596 
597  $date->setDate($this->getPageObject()->getCreated());
598 
599  $form->addCommandButton('updateDate', $lng->txt('save'));
600  $form->addCommandButton('cancelEdit', $lng->txt('cancel'));
601 
602  return $form;
603  }
getPageObject()
Get Page Object.
This class represents a property form user interface.
This class represents a date/time property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initKeywordsForm()

ilBlogPostingGUI::initKeywordsForm ( )
protected

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

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

Referenced by editKeywords(), and saveKeywordsForm().

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

◆ initTitleForm()

ilBlogPostingGUI::initTitleForm ( )

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

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

Referenced by editTitle(), and updateTitle().

520  {
521  $lng = $this->lng;
522  $ilCtrl = $this->ctrl;
523 
524  $form = new ilPropertyFormGUI();
525  $form->setFormAction($ilCtrl->getFormAction($this));
526  $form->setTitle($lng->txt('blog_rename_posting'));
527 
528  $title = new ilTextInputGUI($lng->txt("title"), "title");
529  $title->setRequired(true);
530  $form->addItem($title);
531 
532  $title->setValue($this->getPageObject()->getTitle());
533 
534  $form->addCommandButton('updateTitle', $lng->txt('save'));
535  $form->addCommandButton('cancelEdit', $lng->txt('cancel'));
536 
537  return $form;
538  }
getPageObject()
Get Page Object.
This class represents a property form user interface.
+ 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 333 of file class.ilBlogPostingGUI.php.

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

334  {
335  $class = '';
336  if (is_object($this->access_handler)) {
337  $class = get_class($this->access_handler);
338  }
339 
340  return stristr($class, "workspace");
341  }
+ 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 617 of file class.ilBlogPostingGUI.php.

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

618  {
619  // #10040 - get note text
620  $note = new ilNote($a_note_id);
621  $note = $note->getText();
622  ilObjBlog::sendNotification("comment", $this->isInWorkspace(), $this->node_id, $a_posting_id, $note);
623  }
Note class.
isInWorkspace()
Is current page part of personal workspace blog?
static sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment=null)
+ Here is the call graph for this function:

◆ parseImage()

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

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

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

◆ postOutputProcessing()

ilBlogPostingGUI::postOutputProcessing (   $a_output)

Finalizing output processing.

Parameters
string$a_output
Returns
string

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

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

350  {
351  // #8626/#9370
352  if (($this->getOutputMode() == "preview" || $this->getOutputMode() == "offline")
353  && !$this->getAbstractOnly() && $this->add_date) {
354  $author = "";
355  if (!$this->isInWorkspace()) {
356  $authors = array();
357  $author_id = $this->getBlogPosting()->getAuthor();
358  if ($author_id) {
359  $authors[] = ilUserUtil::getNamePresentation($author_id);
360  }
361 
362  foreach (ilBlogPosting::getPageContributors("blp", $this->getBlogPosting()->getId()) as $editor) {
363  if ($editor["user_id"] != $author_id) {
364  $authors[] = ilUserUtil::getNamePresentation($editor["user_id"]);
365  }
366  }
367 
368  if ($authors) {
369  $author = implode(", ", $authors) . " - ";
370  }
371  }
372 
373  // prepend creation date
376  $prefix = "<div class=\"il_BlockInfo\" style=\"text-align:right\">" .
377  $author . ilDatePresentation::formatDate($this->getBlogPosting()->getCreated()) .
378  "</div>";
380 
381  $a_output = $prefix . $a_output;
382  }
383 
384  return $a_output;
385  }
static getPageContributors($a_parent_type, $a_page_id, $a_lang="-")
Get all contributors for parent object.
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static useRelativeDates()
check if relative dates are used
getBlogPosting()
Get blog posting.
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:
getAbstractOnly()
Get abstract only.
isInWorkspace()
Is current page part of personal workspace blog?
+ Here is the call graph for this function:

◆ preview()

ilBlogPostingGUI::preview (   $a_mode = null)

Preview blog posting.

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

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

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

Returns
string

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

References ilPageObjectGUI\preview().

292  {
293  return $this->preview("embedded");
294  }
+ Here is the call graph for this function:

◆ previewFullscreen()

ilBlogPostingGUI::previewFullscreen ( )

Needed for portfolio/blog handling.

Returns
string

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

References ilPageObjectGUI\preview().

Referenced by executeCommand().

302  {
303  $this->add_date = true;
304  return $this->preview("fullscreen");
305  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveKeywordsForm()

ilBlogPostingGUI::saveKeywordsForm ( )

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

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

774  {
775  global $DIC;
776 
777  $request = $DIC->http()->request();
778  $form = $this->initKeywordsForm();
779 
780  if ($request->getMethod() == "POST"
781  && $request->getQueryParams()['tags'] == 'tags_processing') {
782  $form = $form->withRequest($request);
783  $result = $form->getData();
784  //TODO identify the input instead of use 0
785  $keywords = $result["tags"][0];
786 
787  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
788  if (is_array($keywords)) {
789  $this->getBlogPosting()->updateKeywords($keywords);
790  } else {
791  $this->getBlogPosting()->updateKeywords([]);
792  }
793  }
794 
795  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
796  }
797  }
$result
getBlogPosting()
Get blog posting.
global $DIC
Definition: goto.php:24
checkAccess($a_cmd)
Centralized access management.
+ Here is the call graph for this function:

◆ setBlogPosting()

ilBlogPostingGUI::setBlogPosting ( ilBlogPosting  $a_posting)

Set blog posting.

Parameters
ilBlogPosting$a_posting

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

References ilPageObjectGUI\setPageObject().

176  {
177  $this->setPageObject($a_posting);
178  }
setPageObject(ilPageObject $a_pg_obj)
Set Page Object.
+ Here is the call graph for this function:

◆ showEditToolbar()

ilBlogPostingGUI::showEditToolbar ( )
protected

Show edit toolbar.

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

932  {
933  }

◆ showPage()

ilBlogPostingGUI::showPage (   $a_title = "")

Embedded posting in portfolio.

Returns
string

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

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

313  {
314  $this->setTemplateOutput(false);
315 
316  if (!$this->getAbstractOnly()) {
317  if ($a_title != "") {
318  $this->setPresentationTitle($a_title);
319  } else {
320  $this->setPresentationTitle($this->getBlogPosting()->getTitle());
321  }
322  }
323  $this->getBlogPosting()->increaseViewCnt();
324 
325  return parent::showPage();
326  }
setTemplateOutput($a_output=true)
getBlogPosting()
Get blog posting.
setPresentationTitle($a_title="")
getAbstractOnly()
Get abstract only.
+ Here is the call graph for this function:

◆ updateDate()

ilBlogPostingGUI::updateDate ( )

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

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

558  {
559  $ilCtrl = $this->ctrl;
560  $lng = $this->lng;
561 
562  $form = $this->initDateForm();
563  if ($form->checkInput()) {
564  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
565  $dt = $form->getItemByPostVar("date");
566  $dt = $dt->getDate();
567 
568  $page = $this->getPageObject();
569  $page->setCreated($dt);
570  $page->update();
571 
572  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
573  //$ilCtrl->redirect($this, "preview");
574  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
575  }
576  }
577 
578  $form->setValuesByPost();
579  $this->editTitle($form);
580  }
getPageObject()
Get Page Object.
checkAccess($a_cmd)
Centralized access management.
+ Here is the call graph for this function:

◆ updateTitle()

ilBlogPostingGUI::updateTitle ( )

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

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

496  {
497  $ilCtrl = $this->ctrl;
498  $lng = $this->lng;
499 
500  $form = $this->initTitleForm();
501  if ($form->checkInput()) {
502  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
503  $page = $this->getPageObject();
504  $page->setTitle($form->getInput("title"));
505  $page->update();
506 
507  $page->handleNews(true);
508 
509  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
510  //$ilCtrl->redirect($this, "preview");
511  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
512  }
513  }
514 
515  $form->setValuesByPost();
516  $this->editTitle($form);
517  }
getPageObject()
Get Page Object.
checkAccess($a_cmd)
Centralized access management.
+ 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: