ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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_news_id, $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=IL_PAGE_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 ()
 
 setLinkXML ($link_xml)
 
 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...
 
 getProfileBackUrl ()
 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...
 
 insertHelp ($a_tpl)
 Insert help texts. 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=IL_PAGE_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 ()
 
 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 ()
 

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
 $tpl
 
 $lng
 
 $ctrl
 
 $tabs_gui
 
 $access
 
 $plugin_admin
 
 $log
 
 $user
 
 $help
 
 $output_mode
 
 $parent_type = ""
 
 $ui
 

Additional Inherited Members

- Data Fields inherited from ilPageObjectGUI
 $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 76 of file class.ilBlogPostingGUI.php.

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

77  {
78  global $DIC;
79 
80  $this->tabs = $DIC->tabs();
81  $this->locator = $DIC["ilLocator"];
82  $this->settings = $DIC->settings();
83  $this->user = $DIC->user();
84  $tpl = $DIC["tpl"];
85  $lng = $DIC->language();
86 
87  $lng->loadLanguageModule("blog");
88 
89  $this->node_id = $a_node_id;
90  $this->access_handler = $a_access_handler;
91  $this->enable_public_notes = (bool) $a_enable_public_notes;
92 
93  parent::__construct("blp", $a_id, $a_old_nr);
94 
95  // needed for notification
96  $this->getBlogPosting()->setBlogNodeId($this->node_id, $this->isInWorkspace());
97  $this->getBlogPosting()->getPageConfig()->setEditLockSupport(!$this->isInWorkspace());
98 
99  // #11151
100  $this->may_contribute = (bool) $a_may_contribute;
101  $this->setEnableEditing($a_may_contribute);
102 
103  // content style
104  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
105 
106  $tpl->setCurrentBlock("SyntaxStyle");
107  $tpl->setVariable(
108  "LOCATION_SYNTAX_STYLESHEET",
110  );
111  $tpl->parseCurrentBlock();
112 
113  // #17814
114  $tpl->setCurrentBlock("ContentStyle");
115  $tpl->setVariable(
116  "LOCATION_CONTENT_STYLESHEET",
117  ilObjStyleSheet::getContentStylePath($a_style_sheet_id)
118  );
119  $tpl->parseCurrentBlock();
120 
121  // needed for editor
122  $this->setStyleId($a_style_sheet_id);
123 
124  $this->blpg = (int) $_GET["blpg"];
125  $this->fetchall = (bool) $_GET["fetchall"];
126  $this->term = ilUtil::stripSlashes($_GET["term"]);
127  }
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
$_GET["client_id"]
setEnableEditing($a_enableediting)
Set Enable Editing.
user()
Definition: user.php:4
getBlogPosting()
Get blog posting.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
setStyleId($a_styleid)
Set Style Id.
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 671 of file class.ilBlogPostingGUI.php.

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

672  {
673  // send notifications
674  include_once "Modules/Blog/classes/class.ilObjBlog.php";
675  ilObjBlog::sendNotification("new", $this->isInWorkspace(), $this->node_id, $this->getBlogPosting()->getId());
676 
677  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
678  $this->getBlogPosting()->setActive(true);
679  $this->getBlogPosting()->update(true, false, false);
680  }
681  if (!$a_to_list) {
682  $this->ctrl->redirect($this, "edit");
683  } else {
684  $this->ctrl->setParameterByClass("ilobjbloggui", "blpg", "");
685  $this->ctrl->redirectByClass("ilobjbloggui", "");
686  }
687  }
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 666 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\activatePage().

667  {
668  $this->activatePage(true);
669  }
+ Here is the call graph for this function:

◆ cancelBlogPostingDeletion()

ilBlogPostingGUI::cancelBlogPostingDeletion ( )

Cancel blog posting deletion.

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

References ilPageObjectGUI\$ctrl, and $ilCtrl.

458  {
460 
461  $ilCtrl->redirect($this, "preview");
462  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelEdit()

ilBlogPostingGUI::cancelEdit ( )
protected

Cancel editing.

Parameters

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

624  {
625  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
626  }

◆ checkAccess()

ilBlogPostingGUI::checkAccess (   $a_cmd)
protected

Centralized access management.

Parameters
string$a_cmd
Returns
bool

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

References $may_contribute.

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

203  {
204  if ($a_cmd == "contribute") {
205  return $this->may_contribute;
206  }
207  return $this->access_handler->checkAccess($a_cmd, "", $this->node_id);
208  }
+ Here is the caller graph for this function:

◆ confirmBlogPostingDeletion()

ilBlogPostingGUI::confirmBlogPostingDeletion ( )

Delete the blog posting.

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

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

468  {
470  $lng = $this->lng;
471 
472  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
473  // delete all md keywords
474  $md_section = $this->getBlogPosting()->getMDSection();
475  foreach ($md_section->getKeywordIds() as $id) {
476  $md_key = $md_section->getKeyword($id);
477  $md_key->delete();
478  }
479 
480  $this->getBlogPosting()->delete();
481  ilUtil::sendSuccess($lng->txt("blog_posting_deleted"), true);
482  }
483 
484  $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", ""); // #14363
485  $ilCtrl->redirectByClass("ilobjbloggui", "render");
486  }
if(!array_key_exists('StateId', $_REQUEST)) $id
global $ilCtrl
Definition: ilias.php:18
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 652 of file class.ilBlogPostingGUI.php.

References checkAccess(), and getBlogPosting().

653  {
654  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
655  $this->getBlogPosting()->unpublish();
656  }
657 
658  if (!$a_to_list) {
659  $this->ctrl->redirect($this, "edit");
660  } else {
661  $this->ctrl->setParameterByClass("ilobjbloggui", "blpg", "");
662  $this->ctrl->redirectByClass("ilobjbloggui", "");
663  }
664  }
getBlogPosting()
Get blog posting.
checkAccess($a_cmd)
Centralized access management.
+ Here is the call graph for this function:

◆ deactivatePageToList()

ilBlogPostingGUI::deactivatePageToList ( )

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

References ilPageObjectGUI\deactivatePage().

648  {
649  $this->deactivatePage(true);
650  }
+ Here is the call graph for this function:

◆ deleteBlogPostingConfirmationScreen()

ilBlogPostingGUI::deleteBlogPostingConfirmationScreen ( )

Delete blog posting confirmation screen.

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

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

413  {
414  $tpl = $this->tpl;
416  $lng = $this->lng;
417 
418  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
419  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
420  $confirmation_gui = new ilConfirmationGUI();
421  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
422  $confirmation_gui->setHeaderText($lng->txt("blog_posting_deletion_confirmation"));
423  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelBlogPostingDeletion");
424  $confirmation_gui->setConfirm($lng->txt("delete"), "confirmBlogPostingDeletion");
425 
426  $dtpl = new ilTemplate(
427  "tpl.blog_posting_deletion_confirmation.html",
428  true,
429  true,
430  "Modules/Blog"
431  );
432 
433  $dtpl->setVariable("PAGE_TITLE", $this->getBlogPosting()->getTitle());
434 
435  // notes/comments
436  include_once("./Services/Notes/classes/class.ilNote.php");
437  $cnt_note_users = ilNote::getUserCount(
438  $this->getBlogPosting()->getParentId(),
439  $this->getBlogPosting()->getId(),
440  "wpg"
441  );
442  $dtpl->setVariable(
443  "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
444  $lng->txt("blog_number_users_notes_or_comments")
445  );
446  $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
447 
448  $confirmation_gui->addItem("", "", $dtpl->get());
449 
450  $tpl->setContent($confirmation_gui->getHTML());
451  }
452  }
global $ilCtrl
Definition: ilias.php:18
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.
special template class to simplify handling of ITX/PEAR
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 551 of file class.ilBlogPostingGUI.php.

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

552  {
553  $tpl = $this->tpl;
554  $ilTabs = $this->tabs;
555 
556  $ilTabs->clearTargets();
557  $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
558 
559  $ilTabs->activateTab("edit");
560 
561  if (!$a_form) {
562  $a_form = $this->initDateForm();
563  }
564 
565  $tpl->setContent($a_form->getHTML());
566  }
+ 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 693 of file class.ilBlogPostingGUI.php.

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

694  {
695  global $DIC;
696 
697  $renderer = $DIC->ui()->renderer();
698 
699  $ilTabs = $this->tabs;
700  $tpl = $this->tpl;
701 
702  $ilTabs->clearTargets();
703  $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
704 
705  if (!$this->checkAccess("contribute")) {
706  return;
707  }
708 
709  $ilTabs->activateTab("pg");
710 
711  if (!$a_form) {
712  $a_form = $this->initKeywordsForm();
713  }
714 
715  $tpl->setContent($renderer->render($a_form));
716  }
global $DIC
Definition: saml.php:7
checkAccess($a_cmd)
Centralized access management.
+ Here is the call graph for this function:

◆ editTitle()

ilBlogPostingGUI::editTitle (   $a_form = null)

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

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

Referenced by updateDate(), and updateTitle().

489  {
490  $tpl = $this->tpl;
491  $ilTabs = $this->tabs;
492 
493  $ilTabs->clearTargets();
494  $ilTabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("ilobjblogGUI"));
495 
496  $ilTabs->activateTab("edit");
497 
498  if (!$a_form) {
499  $a_form = $this->initTitleForm();
500  }
501 
502  $tpl->setContent($a_form->getHTML());
503  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilBlogPostingGUI::executeCommand ( )

execute command

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

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

133  {
135  $ilTabs = $this->tabs;
136  $ilLocator = $this->locator;
137  $tpl = $this->tpl;
138 
139  $next_class = $ilCtrl->getNextClass($this);
140  $cmd = $ilCtrl->getCmd();
141 
142  $posting = $this->getBlogPosting();
143  $ilCtrl->setParameter($this, "blpg", $posting->getId());
144 
145  switch ($next_class) {
146  case "ilnotegui":
147  // $this->getTabs();
148  // $ilTabs->setTabActive("pg");
149  return $this->previewFullscreen();
150 
151  default:
152  if ($posting) {
153  if ($ilCtrl->getCmd() == "deactivatePageToList") {
154  ilUtil::sendSuccess($this->lng->txt("blog_draft_info"), true);
155  } elseif ($ilCtrl->getCmd() == "activatePageToList") {
156  ilUtil::sendSuccess($this->lng->txt("blog_new_posting_info"), true);
157  }
158  $this->setPresentationTitle($posting->getTitle());
159 
160  $tpl->setTitle(ilObject::_lookupTitle($this->getBlogPosting()->getBlogId()) . ": " . // #15017
161  $posting->getTitle());
162  $tpl->setTitleIcon(
163  ilUtil::getImagePath("icon_blog.svg"),
164  $this->lng->txt("obj_blog")
165  ); // #12879
166 
167  $ilLocator->addItem(
168  $posting->getTitle(),
169  $ilCtrl->getLinkTarget($this, "preview")
170  );
171  }
172  return parent::executeCommand();
173  }
174  }
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
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:

◆ getActivationCaptions()

ilBlogPostingGUI::getActivationCaptions ( )
protected

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

References ilPageObjectGUI\$lng.

640  {
641  $lng = $this->lng;
642 
643  return array("deactivatePage" => $lng->txt("blog_toggle_draft"),
644  "activatePage" => $lng->txt("blog_toggle_final"));
645  }

◆ getBlogPosting()

ilBlogPostingGUI::getBlogPosting ( )

Get blog posting.

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

References ilPageObjectGUI\getPageObject().

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

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

◆ getDisabledText()

ilBlogPostingGUI::getDisabledText ( )

Get disabled text.

Parameters

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

923  {
924  return $this->lng->txt("blog_draft_text");
925  }

◆ getFirstMediaObjectAsTag()

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

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

References $location, and ilObjMediaObject\_getDirectory().

857  {
858  $this->obj->buildDom();
859  $mob_ids = $this->obj->collectMediaObjects();
860  if ($mob_ids) {
861  require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
862  foreach ($mob_ids as $mob_id) {
863  $mob_obj = new ilObjMediaObject($mob_id);
864  $mob_item = $mob_obj->getMediaItem("Standard");
865  if (stristr($mob_item->getFormat(), "image")) {
866  $mob_size = $mob_item->getOriginalSize();
867  if ($mob_size["width"] >= $a_width ||
868  $mob_size["height"] >= $a_height) {
869  if (!$a_export_directory) {
870  $mob_dir = ilObjMediaObject::_getDirectory($mob_obj->getId());
871  } else {
872  // see ilCOPageHTMLExport::exportHTMLMOB()
873  $mob_dir = "./mobs/mm_" . $mob_obj->getId();
874  }
875  $mob_res = self::parseImage(
876  $mob_size["width"],
877  $mob_size["height"],
878  $a_width,
879  $a_height
880  );
881 
882 
883  $location = $mob_item->getLocationType() == "Reference"
884  ? $mob_item->getLocation()
885  : $mob_dir . "/" . $mob_item->getLocation();
886 
887  return '<img' .
888  ' src="' . $location . '"' .
889  ' width="' . $mob_res[0] . '"' .
890  ' height="' . $mob_res[1] . '"' .
891  ' class="ilBlogListItemSnippetPreviewImage ilFloatLeft noMirror"' .
892  ' />';
893  }
894  }
895  }
896  }
897  }
$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 775 of file class.ilBlogPostingGUI.php.

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

776  {
777  if ($this->node_id) {
778  if ($this->isInWorkspace()) {
779  return $this->access_handler->getTree()->lookupObjectId($this->node_id);
780  } else {
781  return ilObject::_lookupObjId($this->node_id);
782  }
783  }
784  }
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 825 of file class.ilBlogPostingGUI.php.

References $img, and ilPageObject\truncateHTML().

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

826  {
827  $bpgui = new self(0, null, $a_id);
828 
829  // scan the full page for media objects
830  if ($a_include_picture) {
831  $img = $bpgui->getFirstMediaObjectAsTag($a_picture_width, $a_picture_height, $a_export_directory);
832  }
833 
834  $bpgui->setRawPageContent(true);
835  $bpgui->setAbstractOnly(true);
836 
837  // #8627: export won't work - should we set offline mode?
838  $bpgui->setFileDownloadLink(".");
839  $bpgui->setFullscreenLink(".");
840  $bpgui->setSourcecodeDownloadScript(".");
841 
842  // render without title
843  $page = $bpgui->showPage();
844 
845  if ($a_truncate) {
846  $page = ilPageObject::truncateHTML($page, $a_truncate_length, $a_truncate_sign);
847  }
848 
849  if ($img) {
850  $page = '<div>' . $img . $page . '</div><div style="clear:both;"></div>';
851  }
852 
853  return $page;
854  }
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 400 of file class.ilBlogPostingGUI.php.

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

401  {
403 
404  $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", $this->getBlogPosting()->getId());
405 
406  parent::getTabs($a_activate);
407  }
global $ilCtrl
Definition: ilias.php:18
getBlogPosting()
Get blog posting.
+ Here is the call graph for this function:

◆ initDateForm()

ilBlogPostingGUI::initDateForm ( )

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

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

Referenced by editDate(), and updateDate().

594  {
595  $lng = $this->lng;
597 
598  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
599  $form = new ilPropertyFormGUI();
600  $form->setFormAction($ilCtrl->getFormAction($this));
601  $form->setTitle($lng->txt('blog_edit_date'));
602 
603  $date = new ilDateTimeInputGUI($lng->txt("date"), "date");
604  $date->setRequired(true);
605  $date->setShowTime(true);
606  $date->setInfo($lng->txt('blog_edit_date_info'));
607  $form->addItem($date);
608 
609  $date->setDate($this->getPageObject()->getCreated());
610 
611  $form->addCommandButton('updateDate', $lng->txt('save'));
612  $form->addCommandButton('cancelEdit', $lng->txt('cancel'));
613 
614  return $form;
615  }
getPageObject()
Get Page Object.
This class represents a property form user interface.
This class represents a date/time property in a property form.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $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 718 of file class.ilBlogPostingGUI.php.

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

Referenced by editKeywords(), and saveKeywordsForm().

719  {
720  global $DIC;
721 
722  $ui_factory = $DIC->ui()->factory();
723  //$ilUser = $this->user;
724 
725  $md_section = $this->getBlogPosting()->getMDSection();
726 
727  $keywords = array();
728  foreach ($ids = $md_section->getKeywordIds() as $id) {
729  $md_key = $md_section->getKeyword($id);
730  if (trim($md_key->getKeyword()) != "") {
731  //$keywords[$md_key->getKeywordLanguageCode()][]
732  // = $md_key->getKeyword();
733  $keywords[] = $md_key->getKeyword();
734  }
735  }
736 
737  // language is not "used" anywhere
738  /*$ulang = $ilUser->getLanguage();
739  if($keywords[$ulang])
740  {
741  asort($keywords[$ulang]);
742  }*/
743 
744  // other keywords in blog
745  $other = array();
746  foreach (array_keys(ilBlogPosting::getAllPostings($this->getBlogPosting()->getBlogId())) as $posting_id) {
747  if ($posting_id != $this->getBlogPosting()->getId()) {
748  $other = array_merge($other, ilBlogPosting::getKeywords($this->getBlogPosting()->getBlogId(), $posting_id));
749  }
750  }
751  // #17414
752  $other = array_unique($other);
753  sort($other, SORT_LOCALE_STRING);
754  if (is_array($keywords[$ulang])) {
755  $other = array_diff($other, $keywords[$ulang]);
756  }
757 
758  $input_tag = $ui_factory->input()->field()->tag($this->lng->txt("blog_keywords"), $other, $this->lng->txt("blog_keyword_enter"));
759  $input_tag = $input_tag->withValue($keywords);
760 
761  $DIC->ctrl()->setParameter(
762  $this,
763  'tags',
764  'tags_processing'
765  );
766 
767  $section = $ui_factory->input()->field()->section([$input_tag], $this->lng->txt("blog_edit_keywords"), "");
768 
769  $form_action = $DIC->ctrl()->getFormAction($this, "saveKeywordsForm");
770  $form = $ui_factory->input()->container()->form()->standard($form_action, ["tags" => $section]);
771 
772  return $form;
773  }
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
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
if(isset($_POST['submit'])) $form
getBlogPosting()
Get blog posting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTitleForm()

ilBlogPostingGUI::initTitleForm ( )

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

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

Referenced by editTitle(), and updateTitle().

530  {
531  $lng = $this->lng;
533 
534  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
535  $form = new ilPropertyFormGUI();
536  $form->setFormAction($ilCtrl->getFormAction($this));
537  $form->setTitle($lng->txt('blog_rename_posting'));
538 
539  $title = new ilTextInputGUI($lng->txt("title"), "title");
540  $title->setRequired(true);
541  $form->addItem($title);
542 
543  $title->setValue($this->getPageObject()->getTitle());
544 
545  $form->addCommandButton('updateTitle', $lng->txt('save'));
546  $form->addCommandButton('cancelEdit', $lng->txt('cancel'));
547 
548  return $form;
549  }
getPageObject()
Get Page Object.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInWorkspace()

ilBlogPostingGUI::isInWorkspace ( )
protected

Is current page part of personal workspace blog?

Returns
bool

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

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

341  {
342  $class = '';
343  if (is_object($this->access_handler)) {
344  $class = get_class($this->access_handler);
345  }
346 
347  return stristr($class, "workspace");
348  }
+ Here is the caller graph for this function:

◆ observeNoteAction()

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

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

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

630  {
631  // #10040 - get note text
632  include_once "Services/Notes/classes/class.ilNote.php";
633  $note = new ilNote($a_note_id);
634  $note = $note->getText();
635  include_once "Modules/Blog/classes/class.ilObjBlog.php";
636  ilObjBlog::sendNotification("comment", $this->isInWorkspace(), $this->node_id, $a_posting_id, $note);
637  }
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 899 of file class.ilBlogPostingGUI.php.

900  {
901  $ratio_width = $ratio_height = 1;
902  if ($src_width > $tgt_width) {
903  $ratio_width = $tgt_width / $src_width;
904  }
905  if ($src_height > $tgt_height) {
906  $ratio_height = $tgt_height / $src_height;
907  }
908  $shrink_ratio = min($ratio_width, $ratio_height);
909 
910  return array(
911  (int) round($src_width * $shrink_ratio),
912  (int) round($src_height * $shrink_ratio)
913  );
914  }

◆ postOutputProcessing()

ilBlogPostingGUI::postOutputProcessing (   $a_output)

Finalizing output processing.

Parameters
string$a_output
Returns
string

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

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

357  {
358  // #8626/#9370
359  if (($this->getOutputMode() == "preview" || $this->getOutputMode() == "offline")
360  && !$this->getAbstractOnly() && $this->add_date) {
361  $author = "";
362  if (!$this->isInWorkspace()) {
363  $authors = array();
364  $author_id = $this->getBlogPosting()->getAuthor();
365  if ($author_id) {
366  include_once "Services/User/classes/class.ilUserUtil.php";
367  $authors[] = ilUserUtil::getNamePresentation($author_id);
368  }
369 
370  foreach (ilBlogPosting::getPageContributors("blp", $this->getBlogPosting()->getId()) as $editor) {
371  if ($editor["user_id"] != $author_id) {
372  $authors[] = ilUserUtil::getNamePresentation($editor["user_id"]);
373  }
374  }
375 
376  if ($authors) {
377  $author = implode(", ", $authors) . " - ";
378  }
379  }
380 
381  // prepend creation date
384  $prefix = "<div class=\"il_BlockInfo\" style=\"text-align:right\">" .
385  $author . ilDatePresentation::formatDate($this->getBlogPosting()->getCreated()) .
386  "</div>";
388 
389  $a_output = $prefix . $a_output;
390  }
391 
392  return $a_output;
393  }
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.
$editor
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 213 of file class.ilBlogPostingGUI.php.

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

214  {
215  global $DIC;
216 
218  $tpl = $this->tpl;
220 
221  $toolbar = $DIC->toolbar();
222 
223  $this->getBlogPosting()->increaseViewCnt();
224 
225  $wtpl = new ilTemplate(
226  "tpl.blog_page_view_main_column.html",
227  true,
228  true,
229  "Modules/Blog"
230  );
231 
232  // page commands
233  if (!$a_mode) {
234  if (!$this->getEnableEditing()) {
235  $this->ctrl->redirect($this, "previewFullscreen");
236  }
237  /*
238  // delete
239  $page_commands = false;
240  if ($this->checkAccess("write"))
241  {
242  $wtpl->setCurrentBlock("page_command");
243  $wtpl->setVariable("HREF_PAGE_CMD",
244  $ilCtrl->getLinkTarget($this, "deleteBlogPostingConfirmationScreen"));
245  $wtpl->setVariable("TXT_PAGE_CMD", $lng->txt("delete"));
246  $wtpl->parseCurrentBlock();
247  }
248  if ($page_commands)
249  {
250  $wtpl->setCurrentBlock("page_commands");
251  $wtpl->parseCurrentBlock();
252  }
253  */
254  } else {
255  $callback = array($this, "observeNoteAction");
256 
257  // notes
258 
259  $may_delete_comments = ($this->checkAccess("contribute") &&
260  $ilSetting->get("comments_del_tutor", 1));
261 
262  $wtpl->setVariable("TOOLBAR", $toolbar->getHTML());
263 
264  $wtpl->setVariable("NOTES", $this->getNotesHTML(
265  $this->getBlogPosting(),
266  false,
267  $this->enable_public_notes,
268  $may_delete_comments,
269  $callback
270  ));
271  }
272 
273  // permanent link
274  if ($a_mode != "embedded") {
275  $append = ($this->blpg > 0)
276  ? "_" . $this->blpg
277  : "";
278  if ($this->isInWorkspace()) {
279  $append .= "_wsp";
280  }
281  $tpl->setPermanentLink("blog", $this->node_id, $append);
282  }
283 
284  $wtpl->setVariable("PAGE", parent::preview());
285 
286  $tpl->setLoginTargetPar("blog_" . $this->node_id . $append);
287 
288  $ilCtrl->setParameter($this, "blpg", $this->getBlogPosting()->getId());
289 
290  return $wtpl->get();
291  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
getEnableEditing()
Get Enable Editing.
getBlogPosting()
Get blog posting.
special template class to simplify handling of ITX/PEAR
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)
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 298 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\preview().

299  {
300  return $this->preview("embedded");
301  }
+ Here is the call graph for this function:

◆ previewFullscreen()

ilBlogPostingGUI::previewFullscreen ( )

Needed for portfolio/blog handling.

Returns
string

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

References ilPageObjectGUI\preview().

Referenced by executeCommand().

309  {
310  $this->add_date = true;
311  return $this->preview("fullscreen");
312  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveKeywordsForm()

ilBlogPostingGUI::saveKeywordsForm ( )

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

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

787  {
788  global $DIC;
789 
790  $request = $DIC->http()->request();
791  $form = $this->initKeywordsForm();
792 
793  if ($request->getMethod() == "POST"
794  && $request->getQueryParams()['tags'] == 'tags_processing') {
795  $form = $form->withRequest($request);
796  $result = $form->getData();
797 
798  //TODO identify the input instead of use 0
799  $keywords = $result["tags"][0];
800 
801  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
802  if (is_array($keywords)) {
803  $this->getBlogPosting()->updateKeywords($keywords);
804  } else {
805  $this->getBlogPosting()->updateKeywords([]);
806  }
807  }
808 
809  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
810  }
811  }
$result
foreach($paths as $path) $request
Definition: asyncclient.php:32
global $DIC
Definition: saml.php:7
if(isset($_POST['submit'])) $form
getBlogPosting()
Get blog posting.
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 181 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\setPageObject().

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

◆ showPage()

ilBlogPostingGUI::showPage (   $a_title = "")

Embedded posting in portfolio.

Returns
string

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

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

320  {
321  $this->setTemplateOutput(false);
322 
323  if (!$this->getAbstractOnly()) {
324  if ($a_title != "") {
325  $this->setPresentationTitle($a_title);
326  } else {
327  $this->setPresentationTitle($this->getBlogPosting()->getTitle());
328  }
329  }
330  $this->getBlogPosting()->increaseViewCnt();
331 
332  return parent::showPage();
333  }
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 568 of file class.ilBlogPostingGUI.php.

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

569  {
571  $lng = $this->lng;
572 
573  $form = $this->initDateForm();
574  if ($form->checkInput()) {
575  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
576  $dt = $form->getItemByPostVar("date");
577  $dt = $dt->getDate();
578 
579  $page = $this->getPageObject();
580  $page->setCreated($dt);
581  $page->update();
582 
583  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
584  //$ilCtrl->redirect($this, "preview");
585  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
586  }
587  }
588 
589  $form->setValuesByPost();
590  $this->editTitle($form);
591  }
getPageObject()
Get Page Object.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
checkAccess($a_cmd)
Centralized access management.
+ Here is the call graph for this function:

◆ updateTitle()

ilBlogPostingGUI::updateTitle ( )

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

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

506  {
508  $lng = $this->lng;
509 
510  $form = $this->initTitleForm();
511  if ($form->checkInput()) {
512  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
513  $page = $this->getPageObject();
514  $page->setTitle($form->getInput("title"));
515  $page->update();
516 
517  $page->handleNews(true);
518 
519  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
520  //$ilCtrl->redirect($this, "preview");
521  $this->ctrl->redirectByClass("ilObjBlogGUI", "");
522  }
523  }
524 
525  $form->setValuesByPost();
526  $this->editTitle($form);
527  }
getPageObject()
Get Page Object.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
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 39 of file class.ilBlogPostingGUI.php.

◆ $blpg

ilBlogPostingGUI::$blpg
protected

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

◆ $enable_public_notes

ilBlogPostingGUI::$enable_public_notes
protected

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

◆ $fetchall

ilBlogPostingGUI::$fetchall
protected

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

◆ $locator

ilBlogPostingGUI::$locator
protected

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

Referenced by executeCommand().

◆ $may_contribute

ilBlogPostingGUI::$may_contribute
protected

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

Referenced by checkAccess().

◆ $node_id

ilBlogPostingGUI::$node_id
protected

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

◆ $settings

ilBlogPostingGUI::$settings
protected

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

Referenced by preview().

◆ $tabs

ilBlogPostingGUI::$tabs
protected

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

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

◆ $term

ilBlogPostingGUI::$term
protected

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


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