ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilBlogPostingGUI Class Reference

Class ilBlogPosting GUI class. More...

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

Public Member Functions

 __construct ($a_node_id, $a_access_handler=null, $a_id=0, $a_old_nr=0, $a_enable_public_notes=true, $a_may_contribute=true, $a_style_sheet_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 setBlogPosting (ilBlogPosting $a_posting)
 Set blog posting. More...
 
 getBlogPosting ()
 Get blog posting. More...
 
 preview ($a_mode=null)
 Preview blog posting. More...
 
 previewEmbedded ()
 Needed for portfolio/blog handling. More...
 
 previewFullscreen ()
 Needed for portfolio/blog handling. More...
 
 showPage ($a_title="")
 Embedded posting in portfolio. More...
 
 postOutputProcessing ($a_output)
 Finalizing output processing. More...
 
 getTabs ($a_activate="")
 Get tabs. More...
 
 deleteBlogPostingConfirmationScreen ()
 Delete blog posting confirmation screen. More...
 
 cancelBlogPostingDeletion ()
 Cancel blog posting deletion. More...
 
 confirmBlogPostingDeletion ()
 Delete the blog posting. More...
 
 editTitle ($a_form=null)
 
 updateTitle ()
 
 initTitleForm ()
 
 editDate ($a_form=null)
 
 updateDate ()
 
 initDateForm ()
 
 observeNoteAction ($a_blog_id, $a_posting_id, $a_type, $a_action, $a_note_id)
 
 deactivatePageToList ()
 
 deactivatePage ($a_to_list=false)
 
 activatePageToList ()
 
 activatePage ($a_to_list=false)
 
 editKeywords (ilPropertyFormGUI $a_form=null)
 
 saveKeywordsForm ()
 
 keywordAutocomplete ()
 
 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...
 
 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...
 
 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
 
- Protected Attributes inherited from ilPageObjectGUI
 $tpl
 
 $lng
 
 $ctrl
 
 $tabs_gui
 
 $access
 
 $plugin_admin
 
 $log
 
 $user
 
 $help
 
 $output_mode
 
 $parent_type = ""
 

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
Returns
ilBlogPostingGUI

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

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

52  {
53  global $DIC;
54 
55  $this->tabs = $DIC->tabs();
56  $this->locator = $DIC["ilLocator"];
57  $this->settings = $DIC->settings();
58  $this->user = $DIC->user();
59  $tpl = $DIC["tpl"];
60  $lng = $DIC->language();
61 
62  $lng->loadLanguageModule("blog");
63 
64  $this->node_id = $a_node_id;
65  $this->access_handler = $a_access_handler;
66  $this->enable_public_notes = (bool) $a_enable_public_notes;
67 
68  parent::__construct("blp", $a_id, $a_old_nr);
69 
70  // needed for notification
71  $this->getBlogPosting()->setBlogNodeId($this->node_id, $this->isInWorkspace());
72  $this->getBlogPosting()->getPageConfig()->setEditLockSupport(!$this->isInWorkspace());
73 
74  // #11151
75  $this->may_contribute = (bool) $a_may_contribute;
76  $this->setEnableEditing($a_may_contribute);
77 
78  // content style
79  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
80 
81  $tpl->setCurrentBlock("SyntaxStyle");
82  $tpl->setVariable(
83  "LOCATION_SYNTAX_STYLESHEET",
85  );
86  $tpl->parseCurrentBlock();
87 
88  // #17814
89  $tpl->setCurrentBlock("ContentStyle");
90  $tpl->setVariable(
91  "LOCATION_CONTENT_STYLESHEET",
92  ilObjStyleSheet::getContentStylePath($a_style_sheet_id)
93  );
94  $tpl->parseCurrentBlock();
95 
96  // needed for editor
97  $this->setStyleId($a_style_sheet_id);
98  }
global $DIC
Definition: saml.php:7
setEnableEditing($a_enableediting)
Set Enable Editing.
user()
Definition: user.php:4
getBlogPosting()
Get blog posting.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
setStyleId($a_styleid)
Set Style Id.
settings()
Definition: settings.php:2
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 638 of file class.ilBlogPostingGUI.php.

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

639  {
640  // send notifications
641  include_once "Modules/Blog/classes/class.ilObjBlog.php";
642  ilObjBlog::sendNotification("new", $this->isInWorkspace(), $this->node_id, $this->getBlogPosting()->getId());
643 
644  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
645  $this->getBlogPosting()->setActive(true);
646  $this->getBlogPosting()->update(true, false, false);
647  }
648  if (!$a_to_list) {
649  $this->ctrl->redirect($this, "edit");
650  } else {
651  $this->ctrl->setParameterByClass("ilobjbloggui", "blpg", "");
652  $this->ctrl->redirectByClass("ilobjbloggui", "");
653  }
654  }
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 633 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\activatePage().

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

◆ cancelBlogPostingDeletion()

ilBlogPostingGUI::cancelBlogPostingDeletion ( )

Cancel blog posting deletion.

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

References ilPageObjectGUI\$ctrl, and $ilCtrl.

444  {
446 
447  $ilCtrl->redirect($this, "preview");
448  }
global $ilCtrl
Definition: ilias.php:18

◆ checkAccess()

ilBlogPostingGUI::checkAccess (   $a_cmd)
protected

Centralized access management.

Parameters
string$a_cmd
Returns
bool

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

References $may_contribute.

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

189  {
190  if ($a_cmd == "contribute") {
191  return $this->may_contribute;
192  }
193  return $this->access_handler->checkAccess($a_cmd, "", $this->node_id);
194  }
+ Here is the caller graph for this function:

◆ confirmBlogPostingDeletion()

ilBlogPostingGUI::confirmBlogPostingDeletion ( )

Delete the blog posting.

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

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

454  {
456  $lng = $this->lng;
457 
458  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
459  // delete all md keywords
460  $md_section = $this->getBlogPosting()->getMDSection();
461  foreach ($md_section->getKeywordIds() as $id) {
462  $md_key = $md_section->getKeyword($id);
463  $md_key->delete();
464  }
465 
466  $this->getBlogPosting()->delete();
467  ilUtil::sendSuccess($lng->txt("blog_posting_deleted"), true);
468  }
469 
470  $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", ""); // #14363
471  $ilCtrl->redirectByClass("ilobjbloggui", "render");
472  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 619 of file class.ilBlogPostingGUI.php.

References checkAccess(), and getBlogPosting().

620  {
621  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
622  $this->getBlogPosting()->unpublish();
623  }
624 
625  if (!$a_to_list) {
626  $this->ctrl->redirect($this, "edit");
627  } else {
628  $this->ctrl->setParameterByClass("ilobjbloggui", "blpg", "");
629  $this->ctrl->redirectByClass("ilobjbloggui", "");
630  }
631  }
getBlogPosting()
Get blog posting.
checkAccess($a_cmd)
Centralized access management.
+ Here is the call graph for this function:

◆ deactivatePageToList()

ilBlogPostingGUI::deactivatePageToList ( )

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

References ilPageObjectGUI\deactivatePage().

615  {
616  $this->deactivatePage(true);
617  }
+ Here is the call graph for this function:

◆ deleteBlogPostingConfirmationScreen()

ilBlogPostingGUI::deleteBlogPostingConfirmationScreen ( )

Delete blog posting confirmation screen.

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

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

399  {
400  $tpl = $this->tpl;
402  $lng = $this->lng;
403 
404  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
405  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
406  $confirmation_gui = new ilConfirmationGUI();
407  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
408  $confirmation_gui->setHeaderText($lng->txt("blog_posting_deletion_confirmation"));
409  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelBlogPostingDeletion");
410  $confirmation_gui->setConfirm($lng->txt("delete"), "confirmBlogPostingDeletion");
411 
412  $dtpl = new ilTemplate(
413  "tpl.blog_posting_deletion_confirmation.html",
414  true,
415  true,
416  "Modules/Blog"
417  );
418 
419  $dtpl->setVariable("PAGE_TITLE", $this->getBlogPosting()->getTitle());
420 
421  // notes/comments
422  include_once("./Services/Notes/classes/class.ilNote.php");
423  $cnt_note_users = ilNote::getUserCount(
424  $this->getBlogPosting()->getParentId(),
425  $this->getBlogPosting()->getId(),
426  "wpg"
427  );
428  $dtpl->setVariable(
429  "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
430  $lng->txt("blog_number_users_notes_or_comments")
431  );
432  $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
433 
434  $confirmation_gui->addItem("", "", $dtpl->get());
435 
436  $tpl->setContent($confirmation_gui->getHTML());
437  }
438  }
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 533 of file class.ilBlogPostingGUI.php.

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

534  {
535  $tpl = $this->tpl;
536  $ilTabs = $this->tabs;
537 
538  $ilTabs->activateTab("edit");
539 
540  if (!$a_form) {
541  $a_form = $this->initDateForm();
542  }
543 
544  $tpl->setContent($a_form->getHTML());
545  }
+ Here is the call graph for this function:

◆ editKeywords()

ilBlogPostingGUI::editKeywords ( ilPropertyFormGUI  $a_form = null)

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

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

Referenced by saveKeywordsForm().

657  {
658  $ilTabs = $this->tabs;
659  $tpl = $this->tpl;
660 
661  if (!$this->checkAccess("contribute")) {
662  return;
663  }
664 
665  $ilTabs->activateTab("pg");
666 
667  if (!$a_form) {
668  $a_form = $this->initKeywordsForm();
669  }
670 
671  $tpl->setContent($a_form->getHTML());
672  }
checkAccess($a_cmd)
Centralized access management.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editTitle()

ilBlogPostingGUI::editTitle (   $a_form = null)

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

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

Referenced by updateDate(), and updateTitle().

475  {
476  $tpl = $this->tpl;
477  $ilTabs = $this->tabs;
478 
479  $ilTabs->activateTab("edit");
480 
481  if (!$a_form) {
482  $a_form = $this->initTitleForm();
483  }
484 
485  $tpl->setContent($a_form->getHTML());
486  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilBlogPostingGUI::executeCommand ( )

execute command

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

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

104  {
106  $ilTabs = $this->tabs;
107  $ilLocator = $this->locator;
108  $tpl = $this->tpl;
109 
110  $next_class = $ilCtrl->getNextClass($this);
111  $cmd = $ilCtrl->getCmd();
112 
113  $posting = $this->getBlogPosting();
114  $ilCtrl->setParameter($this, "blpg", $posting->getId());
115 
116  switch ($next_class) {
117  case "ilnotegui":
118  // $this->getTabs();
119  // $ilTabs->setTabActive("pg");
120  return $this->previewFullscreen();
121 
122  /*
123  case "ilratinggui":
124  include_once("./Services/Rating/classes/class.ilRatingGUI.php");
125  $rating_gui = new ilRatingGUI();
126  $rating_gui->setObject($this->getBlogPosting()->getParentId(), "blog",
127  $this->getBlogPosting()->getId(), "blp");
128  $this->ctrl->forwardCommand($rating_gui);
129  $ilCtrl->redirect($this, "preview");
130  break;
131  */
132 
133  case "ilpageobjectgui":
134  die("Deprecated. Blog Posting gui forwarding to ilpageobject");
135  return;
136 
137  default:
138  if ($posting) {
139  if ($_REQUEST["cmd"] == "deactivatePageToList") {
140  ilUtil::sendSuccess($this->lng->txt("blog_draft_info"), true);
141  } elseif ($_REQUEST["cmd"] == "activatePageToList") {
142  ilUtil::sendSuccess($this->lng->txt("blog_new_posting_info"), true);
143  }
144  $this->setPresentationTitle($posting->getTitle());
145 
146  $tpl->setTitle(ilObject::_lookupTitle($this->getBlogPosting()->getBlogId()) . ": " . // #15017
147  $posting->getTitle());
148  $tpl->setTitleIcon(
149  ilUtil::getImagePath("icon_blog.svg"),
150  $this->lng->txt("obj_blog")
151  ); // #12879
152 
153  $ilLocator->addItem(
154  $posting->getTitle(),
155  $ilCtrl->getLinkTarget($this, "preview")
156  );
157  }
158  return parent::executeCommand();
159  }
160  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 606 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\$lng, and array.

607  {
608  $lng = $this->lng;
609 
610  return array("deactivatePage" => $lng->txt("blog_toggle_draft"),
611  "activatePage" => $lng->txt("blog_toggle_final"));
612  }
Create styles array
The data for the language used.

◆ getBlogPosting()

ilBlogPostingGUI::getBlogPosting ( )

Get blog posting.

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

References ilPageObjectGUI\getPageObject().

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

178  {
179  return $this->getPageObject();
180  }
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 913 of file class.ilBlogPostingGUI.php.

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

◆ getFirstMediaObjectAsTag()

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

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

References $location, and ilObjMediaObject\_getDirectory().

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

◆ getParentObjId()

ilBlogPostingGUI::getParentObjId ( )
protected

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

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

Referenced by keywordAutocomplete().

741  {
742  if ($this->node_id) {
743  if ($this->isInWorkspace()) {
744  return $this->access_handler->getTree()->lookupObjectId($this->node_id);
745  } else {
746  return ilObject::_lookupObjId($this->node_id);
747  }
748  }
749  }
static _lookupObjId($a_id)
isInWorkspace()
Is current page part of personal workspace blog?
+ Here is the call graph for this function:
+ Here is the caller 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 816 of file class.ilBlogPostingGUI.php.

References $img, and ilPageObject\truncateHTML().

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

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

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

387  {
389 
390  $ilCtrl->setParameterByClass("ilobjbloggui", "blpg", $this->getBlogPosting()->getId());
391 
392  parent::getTabs($a_activate);
393  }
global $ilCtrl
Definition: ilias.php:18
getBlogPosting()
Get blog posting.
+ Here is the call graph for this function:

◆ initDateForm()

ilBlogPostingGUI::initDateForm ( )

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

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

Referenced by editDate(), and updateDate().

572  {
573  $lng = $this->lng;
575 
576  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
577  $form = new ilPropertyFormGUI();
578  $form->setFormAction($ilCtrl->getFormAction($this));
579  $form->setTitle($lng->txt('blog_edit_date'));
580 
581  $date = new ilDateTimeInputGUI($lng->txt("date"), "date");
582  $date->setRequired(true);
583  $date->setShowTime(true);
584  $date->setInfo($lng->txt('blog_edit_date_info'));
585  $form->addItem($date);
586 
587  $date->setDate($this->getPageObject()->getCreated());
588 
589  $form->addCommandButton('updateDate', $lng->txt('save'));
590  $form->addCommandButton('preview', $lng->txt('cancel'));
591 
592  return $form;
593  }
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 674 of file class.ilBlogPostingGUI.php.

References $form, $html, $id, $ilUser, $info, $txt, ilPageObjectGUI\$user, array, ilBlogPosting\getAllPostings(), getBlogPosting(), ilPageObjectGUI\getId(), and ilBlogPosting\getKeywords().

Referenced by editKeywords(), and saveKeywordsForm().

675  {
677 
678  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
679  $form = new ilPropertyFormGUI();
680  $form->setFormAction($this->ctrl->getFormAction($this, "saveKeywordsForm"));
681  $form->setTitle($this->lng->txt("blog_edit_keywords"));
682 
683  $txt = new ilTextInputGUI($this->lng->txt("blog_keywords"), "keywords");
684  // $txt->setRequired(true); #10504
685  $txt->setMulti(true);
686  $txt->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
687  $txt->setMaxLength(200);
688  $txt->setSize(50);
689  $txt->setInfo($this->lng->txt("blog_keywords_info"));
690  $form->addItem($txt);
691 
692  $md_section = $this->getBlogPosting()->getMDSection();
693 
694  $keywords = array();
695  foreach ($ids = $md_section->getKeywordIds() as $id) {
696  $md_key = $md_section->getKeyword($id);
697  if (trim($md_key->getKeyword()) != "") {
698  $keywords[$md_key->getKeywordLanguageCode()][]
699  = $md_key->getKeyword();
700  }
701  }
702 
703  // language is not "used" anywhere
704  $ulang = $ilUser->getLanguage();
705  if ($keywords[$ulang]) {
706  asort($keywords[$ulang]);
707  $txt->setValue($keywords[$ulang]);
708  }
709 
710  // other keywords in blog
711  $other = array();
712  foreach (array_keys(ilBlogPosting::getAllPostings($this->getBlogPosting()->getBlogId())) as $posting_id) {
713  if ($posting_id != $this->getBlogPosting()->getId()) {
714  $other = array_merge($other, ilBlogPosting::getKeywords($this->getBlogPosting()->getBlogId(), $posting_id));
715  }
716  }
717  // #17414
718  $other = array_unique($other);
719  sort($other, SORT_LOCALE_STRING);
720  if (is_array($keywords[$ulang])) {
721  $other = array_diff($other, $keywords[$ulang]);
722  }
723  if (sizeof($other)) {
724  $html = "";
725  foreach ($other as $item) {
726  $html .= '<span class="ilTag">' . $item . '</span>';
727  }
728  $info = new ilNonEditableValueGUI($this->lng->txt("blog_keywords_other"), "", true);
729  $info->setInfo($this->lng->txt("blog_keywords_other_info"));
730  $info->setValue($html);
731  $form->addItem($info);
732  }
733 
734  $form->addCommandButton("saveKeywordsForm", $this->lng->txt("save"));
735  $form->addCommandButton("preview", $this->lng->txt("cancel"));
736 
737  return $form;
738  }
This class represents a property form user interface.
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.
if(isset($_POST['submit'])) $form
getBlogPosting()
Get blog posting.
This class represents a text property in a property form.
$ilUser
Definition: imgupload.php:18
$txt
Definition: error.php:11
Create styles array
The data for the language used.
This class represents a non editable value in a property form.
$info
Definition: index.php:5
$html
Definition: example_001.php:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTitleForm()

ilBlogPostingGUI::initTitleForm ( )

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

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

Referenced by editTitle(), and updateTitle().

512  {
513  $lng = $this->lng;
515 
516  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
517  $form = new ilPropertyFormGUI();
518  $form->setFormAction($ilCtrl->getFormAction($this));
519  $form->setTitle($lng->txt('blog_rename_posting'));
520 
521  $title = new ilTextInputGUI($lng->txt("title"), "title");
522  $title->setRequired(true);
523  $form->addItem($title);
524 
525  $title->setValue($this->getPageObject()->getTitle());
526 
527  $form->addCommandButton('updateTitle', $lng->txt('save'));
528  $form->addCommandButton('preview', $lng->txt('cancel'));
529 
530  return $form;
531  }
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 326 of file class.ilBlogPostingGUI.php.

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

327  {
328  $class = '';
329  if (is_object($this->access_handler)) {
330  $class = get_class($this->access_handler);
331  }
332 
333  return stristr($class, "workspace");
334  }
+ Here is the caller graph for this function:

◆ keywordAutocomplete()

ilBlogPostingGUI::keywordAutocomplete ( )

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

References $_GET, $r, $res, $result, ilMDKeyword\_getMatchingKeywords(), array, ilJsonUtil\encode(), exit, ilSearchSettings\getInstance(), getParentObjId(), and ilUtil\stripSlashes().

770  {
771  $force_all = (bool) $_GET["fetchall"];
772 
773  include_once("./Services/MetaData/classes/class.ilMDKeyword.php");
775  ilUtil::stripSlashes($_GET["term"]),
776  "blp",
777  $this->getParentObjId()
778  );
779 
780  include_once("./Services/Search/classes/class.ilSearchSettings.php");
781  $cut = (int) ilSearchSettings::getInstance()->getAutoCompleteLength();
782 
783  $has_more = false;
784  $result = array();
785  foreach ($res as $r) {
786  if (!$force_all &&
787  sizeof($result["items"]) >= $cut) {
788  $has_more = true;
789  break;
790  }
791  $entry = new stdClass();
792  $entry->value = $r;
793  $entry->label = $r;
794  $result["items"][] = $entry;
795  }
796 
797  $result["hasMoreResults"] = $has_more;
798 
799  include_once './Services/JSON/classes/class.ilJsonUtil.php';
801  exit;
802  }
$result
$_GET["client_id"]
$r
Definition: example_031.php:79
static encode($mixed, $suppress_native=false)
foreach($_POST as $key=> $value) $res
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static _getMatchingKeywords($a_query, $a_type, $a_rbac_id=0)
Search for keywords.
+ Here is the call graph for this function:

◆ observeNoteAction()

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

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

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

596  {
597  // #10040 - get note text
598  include_once "Services/Notes/classes/class.ilNote.php";
599  $note = new ilNote($a_note_id);
600  $note = $note->getText();
601 
602  include_once "Modules/Blog/classes/class.ilObjBlog.php";
603  ilObjBlog::sendNotification("comment", $this->isInWorkspace(), $this->node_id, $a_posting_id, $note);
604  }
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 890 of file class.ilBlogPostingGUI.php.

References array.

891  {
892  $ratio_width = $ratio_height = 1;
893  if ($src_width > $tgt_width) {
894  $ratio_width = $tgt_width / $src_width;
895  }
896  if ($src_height > $tgt_height) {
897  $ratio_height = $tgt_height / $src_height;
898  }
899  $shrink_ratio = min($ratio_width, $ratio_height);
900 
901  return array(
902  (int) round($src_width*$shrink_ratio),
903  (int) round($src_height*$shrink_ratio)
904  );
905  }
Create styles array
The data for the language used.

◆ postOutputProcessing()

ilBlogPostingGUI::postOutputProcessing (   $a_output)

Finalizing output processing.

Parameters
string$a_output
Returns
string

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

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

343  {
344  // #8626/#9370
345  if (($this->getOutputMode() == "preview" || $this->getOutputMode() == "offline")
346  && !$this->getAbstractOnly() && $this->add_date) {
347  $author = "";
348  if (!$this->isInWorkspace()) {
349  $authors = array();
350  $author_id = $this->getBlogPosting()->getAuthor();
351  if ($author_id) {
352  include_once "Services/User/classes/class.ilUserUtil.php";
353  $authors[] = ilUserUtil::getNamePresentation($author_id);
354  }
355 
356  foreach (ilBlogPosting::getPageContributors("blp", $this->getBlogPosting()->getId()) as $editor) {
357  if ($editor["user_id"] != $author_id) {
358  $authors[] = ilUserUtil::getNamePresentation($editor["user_id"]);
359  }
360  }
361 
362  if ($authors) {
363  $author = implode(", ", $authors) . " - ";
364  }
365  }
366 
367  // prepend creation date
370  $prefix = "<div class=\"il_BlockInfo\" style=\"text-align:right\">" .
371  $author . ilDatePresentation::formatDate($this->getBlogPosting()->getCreated()) .
372  "</div>";
374 
375  $a_output = $prefix . $a_output;
376  }
377 
378  return $a_output;
379  }
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
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 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.
Create styles array
The data for the language used.
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 199 of file class.ilBlogPostingGUI.php.

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

200  {
201  global $DIC;
202 
204  $tpl = $this->tpl;
206 
207  $toolbar = $DIC->toolbar();
208 
209  $this->getBlogPosting()->increaseViewCnt();
210 
211  $wtpl = new ilTemplate(
212  "tpl.blog_page_view_main_column.html",
213  true,
214  true,
215  "Modules/Blog"
216  );
217 
218  // page commands
219  if (!$a_mode) {
220  if (!$this->getEnableEditing()) {
221  $this->ctrl->redirect($this, "previewFullscreen");
222  }
223  /*
224  // delete
225  $page_commands = false;
226  if ($this->checkAccess("write"))
227  {
228  $wtpl->setCurrentBlock("page_command");
229  $wtpl->setVariable("HREF_PAGE_CMD",
230  $ilCtrl->getLinkTarget($this, "deleteBlogPostingConfirmationScreen"));
231  $wtpl->setVariable("TXT_PAGE_CMD", $lng->txt("delete"));
232  $wtpl->parseCurrentBlock();
233  }
234  if ($page_commands)
235  {
236  $wtpl->setCurrentBlock("page_commands");
237  $wtpl->parseCurrentBlock();
238  }
239  */
240  } else {
241  $callback = array($this, "observeNoteAction");
242 
243  // notes
244 
245  $may_delete_comments = ($this->checkAccess("contribute") &&
246  $ilSetting->get("comments_del_tutor", 1));
247 
248  $wtpl->setVariable("TOOLBAR", $toolbar->getHTML());
249 
250  $wtpl->setVariable("NOTES", $this->getNotesHTML(
251  $this->getBlogPosting(),
252  false,
253  $this->enable_public_notes,
254  $may_delete_comments,
255  $callback
256  ));
257  }
258 
259  // permanent link
260  if ($a_mode != "embedded") {
261  $append = ($_GET["blpg"] != "")
262  ? "_" . ilUtil::stripSlashes($_GET["blpg"])
263  : "";
264  if ($this->isInWorkspace()) {
265  $append .= "_wsp";
266  }
267  $tpl->setPermanentLink("blog", $this->node_id, $append);
268  }
269 
270  $wtpl->setVariable("PAGE", parent::preview());
271 
272  $tpl->setLoginTargetPar("blog_" . $this->node_id . $append);
273 
274  $ilCtrl->setParameter($this, "blpg", $this->getBlogPosting()->getId());
275 
276  return $wtpl->get();
277  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
getEnableEditing()
Get Enable Editing.
getBlogPosting()
Get blog posting.
special template class to simplify handling of ITX/PEAR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
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 284 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\preview().

285  {
286  return $this->preview("embedded");
287  }
+ Here is the call graph for this function:

◆ previewFullscreen()

ilBlogPostingGUI::previewFullscreen ( )

Needed for portfolio/blog handling.

Returns
string

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

References ilPageObjectGUI\preview().

Referenced by executeCommand().

295  {
296  $this->add_date = true;
297  return $this->preview("fullscreen");
298  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveKeywordsForm()

ilBlogPostingGUI::saveKeywordsForm ( )

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

References $form, checkAccess(), editKeywords(), getBlogPosting(), and initKeywordsForm().

752  {
753  $form = $this->initKeywordsForm();
754  if ($form->checkInput()) {
755  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
756  $keywords = $form->getInput("keywords");
757  if (is_array($keywords)) {
758  $this->getBlogPosting()->updateKeywords($keywords);
759  }
760  }
761 
762  $this->ctrl->redirect($this, "preview");
763  }
764 
765  $form->setValuesByPost();
766  $this->editKeywords($form);
767  }
if(isset($_POST['submit'])) $form
getBlogPosting()
Get blog posting.
editKeywords(ilPropertyFormGUI $a_form=null)
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 167 of file class.ilBlogPostingGUI.php.

References ilPageObjectGUI\setPageObject().

168  {
169  $this->setPageObject($a_posting);
170  }
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 305 of file class.ilBlogPostingGUI.php.

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

306  {
307  $this->setTemplateOutput(false);
308 
309  if (!$this->getAbstractOnly()) {
310  if ($a_title != "") {
311  $this->setPresentationTitle($a_title);
312  } else {
313  $this->setPresentationTitle($this->getBlogPosting()->getTitle());
314  }
315  }
316  $this->getBlogPosting()->increaseViewCnt();
317 
318  return parent::showPage();
319  }
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 547 of file class.ilBlogPostingGUI.php.

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

548  {
550  $lng = $this->lng;
551 
552  $form = $this->initDateForm();
553  if ($form->checkInput()) {
554  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
555  $dt = $form->getItemByPostVar("date");
556  $dt = $dt->getDate();
557 
558  $page = $this->getPageObject();
559  $page->setCreated($dt);
560  $page->update();
561 
562  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
563  $ilCtrl->redirect($this, "preview");
564  }
565  }
566 
567  $form->setValuesByPost();
568  $this->editTitle($form);
569  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 488 of file class.ilBlogPostingGUI.php.

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

489  {
491  $lng = $this->lng;
492 
493  $form = $this->initTitleForm();
494  if ($form->checkInput()) {
495  if ($this->checkAccess("write") || $this->checkAccess("contribute")) {
496  $page = $this->getPageObject();
497  $page->setTitle($form->getInput("title"));
498  $page->update();
499 
500  $page->handleNews(true);
501 
502  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
503  $ilCtrl->redirect($this, "preview");
504  }
505  }
506 
507  $form->setValuesByPost();
508  $this->editTitle($form);
509  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 36 of file class.ilBlogPostingGUI.php.

◆ $enable_public_notes

ilBlogPostingGUI::$enable_public_notes
protected

Definition at line 37 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 38 of file class.ilBlogPostingGUI.php.

Referenced by checkAccess().

◆ $node_id

ilBlogPostingGUI::$node_id
protected

Definition at line 35 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().


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