ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilBlogPostingGUI Class Reference

Class ilBlogPosting GUI class. More...

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

Public Member Functions

 __construct ($a_node_id, $a_access_handler=null, $a_id=0, $a_old_nr=0, $a_enable_public_notes=true, $a_may_contribute=true, $a_style_sheet_id=0)
 Constructor.
 executeCommand ()
 execute command
 setBlogPosting (ilBlogPosting $a_posting)
 Set blog posting.
 getBlogPosting ()
 Get blog posting.
 preview ($a_mode=null)
 Preview blog posting.
 previewEmbedded ()
 Needed for portfolio/blog handling.
 previewFullscreen ()
 Needed for portfolio/blog handling.
 showPage ()
 Embedded posting in portfolio.
 postOutputProcessing ($a_output)
 Finalizing output processing.
 getTabs ($a_activate="")
 Get tabs.
 deleteBlogPostingConfirmationScreen ()
 Delete blog posting confirmation screen.
 cancelBlogPostingDeletion ()
 Cancel blog posting deletion.
 confirmBlogPostingDeletion ()
 Delete the blog posting.
 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 ()
- Public Member Functions inherited from ilPageObjectGUI
 ilPageObjectGUI ($a_parent_type, $a_id, $a_old_nr=0, $a_prevent_get_id=false, $a_lang="")
 Constructor.
 afterConstructor ()
 After constructor.
 setParentType ($a_val)
 Set parent type.
 getParentType ()
 Get parent type.
 setId ($a_val)
 Set ID.
 getId ()
 Get ID.
 setOldNr ($a_val)
 Set old nr (historic page)
 getOldNr ()
 Get old nr (historic page)
 setLanguage ($a_val)
 Set language.
 getLanguage ()
 Get language.
 setEnablePCType ($a_pc_type, $a_val)
 Set enable pc type.
 getEnablePCType ($a_pc_type)
 Get enable pc type.
 setPageConfig ($a_val)
 Set page config object.
 getPageConfig ()
 Get page config object.
 setBibId ($a_id)
 Set Bib Id.
 getBibId ()
 Get Bib Id.
 setPageObject ($a_pg_obj)
 Set Page Object.
 getPageObject ()
 Get Page Object.
 setOutputMode ($a_mode=IL_PAGE_PRESENTATION)
 Set Output Mode.
 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)
 getSourcecodeDownloadScript ()
 enableCitation ($a_enabled)
 isEnabledCitation ()
 setLocator (&$a_locator)
 setTabs ($a_tabs)
 setPageBackTitle ($a_title)
 setFileDownloadLink ($a_download_link)
 getFileDownloadLink ()
 setFullscreenLink ($a_fullscreen_link)
 getFullscreenLink ()
 setIntLinkReturn ($a_return)
 enableChangeComments ($a_enabled)
 isEnabledChangeComments ()
 enableNotes ($a_enabled, $a_parent_id)
 isEnabledNotes ()
 setOfflineDirectory ($offdir)
 set offline directory to offdir
 getOfflineDirectory ()
 get offline directory
 setViewPageLink ($a_link, $a_target="")
 set link for "view page" button
 getViewPageLink ()
 get view page link
 getViewPageTarget ()
 get view page target frame
 setActivationListener (&$a_obj, $a_meth)
 setEnabledNews ($a_enabled, $a_news_obj_id=0, $a_news_obj_type=0)
 Set enabled news.
 getEnabledNews ()
 Get enabled news.
 setTabHook ($a_object, $a_function)
 Set tab hook.
 setEditPreview ($a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit.
 getEditPreview ()
 Get Display first Edit tab, then Preview tab, instead of Page and Edit.
 setEnabledTabs ($a_enabledtabs)
 Set Output tabs.
 getEnabledTabs ()
 Get Output tabs.
 setEnabledPageFocus ($a_enabledpagefocus)
 Set Enable page focus.
 getEnabledPageFocus ()
 Get Enable page focus.
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater.
 setPrependingHtml ($a_prependinghtml)
 Set Prepending HTML.
 getPrependingHtml ()
 Get Prepending HTML.
 setEnableEditing ($a_enableediting)
 Set Enable Editing.
 getEnableEditing ()
 Get Enable Editing.
 setRawPageContent ($a_rawpagecontent)
 Set Get raw page content only.
 getRawPageContent ()
 Get Get raw page content only.
 setStyleId ($a_styleid)
 Set Style Id.
 getStyleId ()
 Get Style Id.
 setCompareMode ($a_val)
 Set compare mode.
 getCompareMode ()
 Get compare mode.
 setAbstractOnly ($a_val)
 Set abstract only.
 getAbstractOnly ()
 Get abstract only.
 setRenderPageContainer ($a_val)
 Set render page container.
 getRenderPageContainer ()
 Get render page container.
 activateMetaDataEditor ($a_rep_obj_id, $a_sub_obj_id, $a_type, $a_observer_obj=NULL, $a_observer_func="")
 Activate meda data editor.
 determineFileDownloadLink ()
 Determine file download link.
 determineFullscreenLink ()
 Determine fullscreen link.
 determineSourcecodeDownloadScript ()
 Determine source code download script.
 getComponentPluginsXML ()
 Put information about activated plugins into XML.
 setQEditTabs ($a_active)
 Set question editing tabs.
 onFeedbackEditingForwarding ()
 On feedback editing forwarding.
 deactivatePage ()
 activatePage ()
 replaceCurlyBrackets ($output)
 Replace curly brackets.
 addActionsMenu ($a_tpl, $sel_media_mode, $sel_html_mode, $sel_js_mode)
 Add actions menu.
 addMultiLangActionsAndInfo ($a_list, $a_tpl)
 Add multi-language actions to menu.
 setEditMode ()
 Set edit mode.
 setDefaultLinkXml ()
 Set standard link xml.
 downloadFile ()
 Download file of file lists.
 displayMediaFullscreen ()
 Show media in fullscreen mode.
 displayMedia ($a_fullscreen=false)
 Display media.
 download_paragraph ()
 download source code paragraph
 insertContentIncludes ($a_html)
 Insert content includes.
 insertPageToc ($a_output)
 Insert page toc.
 insertResources ($a_output)
 Insert resources.
 insertAdvTrigger ($a_output)
 Insert adv content trigger.
 insertHelp ($a_tpl)
 Insert help texts.
 previewHistory ()
 Preview history.
 preview ()
 preview
 edit ()
 edit ("view" before)
 insertJSAtPlaceholder ()
 InsertJS at placeholder.
 presentation ($a_mode=IL_PAGE_PRESENTATION)
 getHTML ()
 showMediaFullscreen ($a_style_id=0)
 show fullscreen view of media object
 displayValidationError ($a_error)
 display validation error
 history ()
 Get history table as HTML.
 rollbackConfirmation ()
 Rollback confirmation.
 rollback ()
 Rollback to a previous version.
 setScreenIdComponent ()
 Set screen id component.
 compareVersion ()
 Compares two revisions of the page.
 replaceDiffTags ($a_html)
 editActivation ()
 Edit activation (only, if scheduled page activation is activated in administration)
 initActivationForm ()
 Init activation form.
 getActivationFormValues ()
 Get values for activation form.
 saveActivation ()
 Save Activation.
 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.
 processAnswer ()
 Process answer.
 initialOpenedContent ()
 Initially opened content.
 initOpenedContentForm ()
 Init form for initially opened content.
 saveInitialOpenedContent ()
 Save initial opened content.
 switchToLanguage ()
 Switch to language.
 confirmPageTranslationCreation ()
 Confirm page translation creation.
 editMasterLanguage ()
 Edit master language.
 createPageTranslation ()
 Create page translation.
 releasePageLock ()
 Release page lock.

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.
- 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)
 Get Tiny Menu.

Protected Member Functions

 checkAccess ($a_cmd)
 Centralized access management.
 isInWorkspace ()
 Is current page part of personal workspace blog?
 getActivationCaptions ()
 Get captions for activation action menu entries.
 initKeywordsForm ()
 getParentObjId ()
 getFirstMediaObjectAsTag ($a_width=144, $a_height=144, $a_export_directory=null)
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object.
 isPageContainerToBeRendered ()

Static Protected Member Functions

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

Protected Attributes

 $node_id
 $access_handler
 $enable_public_notes
 $may_contribute
- Protected Attributes inherited from ilPageObjectGUI
 $parent_type = ""

Additional Inherited Members

- Data Fields inherited from ilPageObjectGUI
 $tpl
 $lng
 $ctrl
 $obj
 $output_mode
 $presentation_title
 $target_script
 $return_location
 $target_var
 $template_output_var
 $output2template
 $link_params
 $bib_id
 $citation
 $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

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 36 of file class.ilBlogPostingGUI.php.

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

{
global $tpl, $lng;
$lng->loadLanguageModule("blog");
$this->node_id = $a_node_id;
$this->access_handler = $a_access_handler;
$this->enable_public_notes = (bool)$a_enable_public_notes;
parent::__construct("blp", $a_id, $a_old_nr);
// needed for notification
$this->getBlogPosting()->setBlogNodeId($this->node_id, $this->isInWorkspace());
// #11151
$this->may_contribute = (bool)$a_may_contribute;
$this->setEnableEditing($a_may_contribute);
// content style
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$tpl->setCurrentBlock("SyntaxStyle");
$tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
$tpl->parseCurrentBlock();
// #17814
$tpl->setCurrentBlock("ContentStyle");
$tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
$tpl->parseCurrentBlock();
// needed for editor
$this->setStyleId($a_style_sheet_id);
}

+ Here is the call graph for this function:

Member Function Documentation

ilBlogPostingGUI::activatePage (   $a_to_list = false)

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

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

{
// send notifications
include_once "Modules/Blog/classes/class.ilObjBlog.php";
ilObjBlog::sendNotification("new", $this->isInWorkspace(), $this->node_id, $this->getBlogPosting()->getId());
$this->getBlogPosting()->setActive(true);
$this->getBlogPosting()->update(true, false, false);
if(!$a_to_list)
{
$this->ctrl->redirect($this, "edit");
}
else
{
$this->ctrl->redirectByClass("ilobjbloggui", "");
}
}

+ Here is the call graph for this function:

ilBlogPostingGUI::activatePageToList ( )

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

References ilPageObjectGUI\activatePage().

{
$this->activatePage(true);
}

+ Here is the call graph for this function:

ilBlogPostingGUI::cancelBlogPostingDeletion ( )

Cancel blog posting deletion.

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirect($this, "preview");
}
ilBlogPostingGUI::checkAccess (   $a_cmd)
protected

Centralized access management.

Parameters
string$a_cmd
Returns
bool

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

References $may_contribute.

Referenced by confirmBlogPostingDeletion(), deleteBlogPostingConfirmationScreen(), editKeywords(), and preview().

{
if($a_cmd == "contribute")
{
}
return $this->access_handler->checkAccess($a_cmd, "", $this->node_id);
}

+ Here is the caller graph for this function:

ilBlogPostingGUI::confirmBlogPostingDeletion ( )

Delete the blog posting.

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

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

{
global $ilCtrl, $lng;
if ($this->checkAccess("write") || $this->checkAccess("contribute"))
{
// delete all md keywords
$md_section = $this->getBlogPosting()->getMDSection();
foreach($md_section->getKeywordIds() as $id)
{
$md_key = $md_section->getKeyword($id);
$md_key->delete();
}
$this->getBlogPosting()->delete();
ilUtil::sendSuccess($lng->txt("blog_posting_deleted"), true);
}
$ilCtrl->setParameterByClass("ilobjbloggui", "blpg", ""); // #14363
$ilCtrl->redirectByClass("ilobjbloggui", "render");
}

+ Here is the call graph for this function:

ilBlogPostingGUI::deactivatePage (   $a_to_list = false)

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

References getBlogPosting().

{
$this->getBlogPosting()->setApproved(false);
$this->getBlogPosting()->setActive(false);
$this->getBlogPosting()->update(true, false, false);
if(!$a_to_list)
{
$this->ctrl->redirect($this, "edit");
}
else
{
$this->ctrl->redirectByClass("ilobjbloggui", "");
}
}

+ Here is the call graph for this function:

ilBlogPostingGUI::deactivatePageToList ( )

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

References ilPageObjectGUI\deactivatePage().

{
$this->deactivatePage(true);
}

+ Here is the call graph for this function:

ilBlogPostingGUI::deleteBlogPostingConfirmationScreen ( )

Delete blog posting confirmation screen.

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

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

{
global $tpl, $ilCtrl, $lng;
if ($this->checkAccess("write") || $this->checkAccess("contribute"))
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$confirmation_gui = new ilConfirmationGUI();
$confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
$confirmation_gui->setHeaderText($lng->txt("blog_posting_deletion_confirmation"));
$confirmation_gui->setCancel($lng->txt("cancel"), "cancelBlogPostingDeletion");
$confirmation_gui->setConfirm($lng->txt("delete"), "confirmBlogPostingDeletion");
$dtpl = new ilTemplate("tpl.blog_posting_deletion_confirmation.html", true,
true, "Modules/Blog");
$dtpl->setVariable("PAGE_TITLE", $this->getBlogPosting()->getTitle());
// notes/comments
include_once("./Services/Notes/classes/class.ilNote.php");
$cnt_note_users = ilNote::getUserCount($this->getBlogPosting()->getParentId(),
$this->getBlogPosting()->getId(), "wpg");
$dtpl->setVariable("TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
$lng->txt("blog_number_users_notes_or_comments"));
$dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
$confirmation_gui->addItem("", "", $dtpl->get());
$tpl->setContent($confirmation_gui->getHTML());
}
}

+ Here is the call graph for this function:

ilBlogPostingGUI::editDate (   $a_form = null)

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

References ilPageObjectGUI\$tpl, and initDateForm().

{
global $tpl, $ilTabs;
$ilTabs->activateTab("edit");
if(!$a_form)
{
$a_form = $this->initDateForm();
}
$tpl->setContent($a_form->getHTML());
}

+ Here is the call graph for this function:

ilBlogPostingGUI::editKeywords ( ilPropertyFormGUI  $a_form = null)

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

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

Referenced by saveKeywordsForm().

{
global $ilTabs, $tpl;
if (!$this->checkAccess("contribute"))
{
return;
}
$ilTabs->activateTab("pg");
if(!$a_form)
{
$a_form = $this->initKeywordsForm();
}
$tpl->setContent($a_form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPostingGUI::editTitle (   $a_form = null)

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

References ilPageObjectGUI\$tpl, and initTitleForm().

Referenced by updateDate(), and updateTitle().

{
global $tpl, $ilTabs;
$ilTabs->activateTab("edit");
if(!$a_form)
{
$a_form = $this->initTitleForm();
}
$tpl->setContent($a_form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPostingGUI::executeCommand ( )

execute command

Reimplemented from ilPageObjectGUI.

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

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

{
global $ilCtrl, $ilTabs, $ilLocator, $tpl;
$next_class = $ilCtrl->getNextClass($this);
$cmd = $ilCtrl->getCmd();
$posting = $this->getBlogPosting();
$ilCtrl->setParameter($this, "blpg", $posting->getId());
switch($next_class)
{
case "ilnotegui":
// $this->getTabs();
// $ilTabs->setTabActive("pg");
return $this->previewFullscreen();
/*
case "ilratinggui":
include_once("./Services/Rating/classes/class.ilRatingGUI.php");
$rating_gui = new ilRatingGUI();
$rating_gui->setObject($this->getBlogPosting()->getParentId(), "blog",
$this->getBlogPosting()->getId(), "blp");
$this->ctrl->forwardCommand($rating_gui);
$ilCtrl->redirect($this, "preview");
break;
*/
case "ilpageobjectgui":
die("Deprecated. Blog Posting gui forwarding to ilpageobject");
return;
default:
if($posting)
{
$this->setPresentationTitle($posting->getTitle());
$tpl->setTitle(ilObject::_lookupTitle($this->getBlogPosting()->getBlogId()).": ". // #15017
$posting->getTitle());
$tpl->setTitleIcon(ilUtil::getImagePath("icon_blog.svg"),
$this->lng->txt("obj_blog")); // #12879
$ilLocator->addItem($posting->getTitle(),
$ilCtrl->getLinkTarget($this, "preview"));
}
}
}

+ Here is the call graph for this function:

ilBlogPostingGUI::getActivationCaptions ( )
protected

Get captions for activation action menu entries.

Reimplemented from ilPageObjectGUI.

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

References ilPageObjectGUI\$lng.

{
global $lng;
return array("deactivatePage" => $lng->txt("blog_toggle_draft"),
"activatePage" => $lng->txt("blog_toggle_final"));
}
ilBlogPostingGUI::getBlogPosting ( )

Get blog posting.

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

References ilPageObjectGUI\getPageObject().

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

{
return $this->getPageObject();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

{
$this->obj->buildDom();
$mob_ids = $this->obj->collectMediaObjects();
if($mob_ids)
{
require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
foreach($mob_ids as $mob_id)
{
$mob_obj = new ilObjMediaObject($mob_id);
$mob_item = $mob_obj->getMediaItem("Standard");
if(stristr($mob_item->getFormat(), "image"))
{
$mob_size = $mob_item->getOriginalSize();
if($mob_size["width"] >= $a_width ||
$mob_size["height"] >= $a_height)
{
if(!$a_export_directory)
{
$mob_dir = ilObjMediaObject::_getDirectory($mob_obj->getId());
}
else
{
// see ilCOPageHTMLExport::exportHTMLMOB()
$mob_dir = "./mobs/mm_".$mob_obj->getId();
}
$mob_res = self::parseImage($mob_size["width"],
$mob_size["height"], $a_width, $a_height);
return '<img'.
' src="'.$mob_dir."/".$mob_item->getLocation().'"'.
' width="'.$mob_res[0].'"'.
' height="'.$mob_res[1].'"'.
' class="ilBlogListItemSnippetPreviewImage ilFloatLeft noMirror"'.
' />';
}
}
}
}
}

+ Here is the call graph for this function:

ilBlogPostingGUI::getParentObjId ( )
protected

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

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

Referenced by keywordAutocomplete().

{
if($this->node_id)
{
if($this->isInWorkspace())
{
return $this->access_handler->getTree()->lookupObjectId($this->node_id);
}
else
{
return ilObject::_lookupObjId($this->node_id);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 745 of file class.ilBlogPostingGUI.php.

References $img, and ilPageObject\truncateHTML().

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

{
$bpgui = new self(0, null, $a_id);
// scan the full page for media objects
if($a_include_picture)
{
$img = $bpgui->getFirstMediaObjectAsTag($a_picture_width, $a_picture_height, $a_export_directory);
}
$bpgui->setRawPageContent(true);
$bpgui->setAbstractOnly(true);
// #8627: export won't work - should we set offline mode?
$bpgui->setFileDownloadLink(".");
$bpgui->setFullscreenLink(".");
$bpgui->setSourcecodeDownloadScript(".");
// render without title
$page = $bpgui->showPage();
if($a_truncate)
{
$page = ilPageObject::truncateHTML($page, $a_truncate_length, $a_truncate_sign);
}
if($img)
{
$page = '<div>'.$img.$page.'</div><div style="clear:both;"></div>';
}
return $page;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPostingGUI::getTabs (   $a_activate = "")

Get tabs.

Parameters
string$a_activate

Reimplemented from ilPageObjectGUI.

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

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

{
global $ilCtrl;
$ilCtrl->setParameterByClass("ilobjbloggui", "blpg", $this->getBlogPosting()->getId());
parent::getTabs($a_activate);
}

+ Here is the call graph for this function:

ilBlogPostingGUI::initDateForm ( )

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

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

Referenced by editDate(), and updateDate().

{
global $lng, $ilCtrl;
include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($lng->txt('blog_edit_date'));
$date = new ilDateTimeInputGUI($lng->txt("date"), "date");
$date->setRequired(true);
$date->setShowTime(true);
$date->setInfo($lng->txt('blog_edit_date_info'));
$form->addItem($date);
$date->setDate($this->getPageObject()->getCreated());
$form->addCommandButton('updateDate', $lng->txt('save'));
$form->addCommandButton('preview', $lng->txt('cancel'));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPostingGUI::initKeywordsForm ( )
protected

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

References $ilUser, $txt, ilBlogPosting\getAllPostings(), getBlogPosting(), ilPageObjectGUI\getId(), ilBlogPosting\getKeywords(), and ilNonEditableValueGUI\setInfo().

Referenced by editKeywords(), and saveKeywordsForm().

{
global $ilUser;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "saveKeywordsForm"));
$form->setTitle($this->lng->txt("blog_edit_keywords"));
$txt = new ilTextInputGUI($this->lng->txt("blog_keywords"), "keywords");
// $txt->setRequired(true); #10504
$txt->setMulti(true);
$txt->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
$txt->setMaxLength(200);
$txt->setSize(50);
$txt->setInfo($this->lng->txt("blog_keywords_info"));
$form->addItem($txt);
$md_section = $this->getBlogPosting()->getMDSection();
$keywords = array();
foreach($ids = $md_section->getKeywordIds() as $id)
{
$md_key = $md_section->getKeyword($id);
if (trim($md_key->getKeyword()) != "")
{
$keywords[$md_key->getKeywordLanguageCode()][]
= $md_key->getKeyword();
}
}
// language is not "used" anywhere
$ulang = $ilUser->getLanguage();
if($keywords[$ulang])
{
asort($keywords[$ulang]);
$txt->setValue($keywords[$ulang]);
}
// other keywords in blog
$other = array();
foreach(array_keys(ilBlogPosting::getAllPostings($this->getBlogPosting()->getBlogId())) as $posting_id)
{
if($posting_id != $this->getBlogPosting()->getId())
{
$other = array_merge($other, ilBlogPosting::getKeywords($this->getBlogPosting()->getBlogId(), $posting_id));
}
}
// #17414
$other = array_unique($other);
sort($other, SORT_LOCALE_STRING);
if(is_array($keywords[$ulang]))
{
$other = array_diff($other, $keywords[$ulang]);
}
if(sizeof($other))
{
$html = "";
foreach($other as $item)
{
$html .= '<span class="ilTag">'.$item.'</span>';
}
$info = new ilNonEditableValueGUI($this->lng->txt("blog_keywords_other"), "", true);
$info->setInfo($this->lng->txt("blog_keywords_other_info"));
$info->setValue($html);
$form->addItem($info);
}
$form->addCommandButton("saveKeywordsForm", $this->lng->txt("save"));
$form->addCommandButton("preview", $this->lng->txt("cancel"));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPostingGUI::initTitleForm ( )

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

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

Referenced by editTitle(), and updateTitle().

{
global $lng, $ilCtrl;
include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($lng->txt('blog_rename_posting'));
$title = new ilTextInputGUI($lng->txt("title"), "title");
$title->setRequired(true);
$form->addItem($title);
$title->setValue($this->getPageObject()->getTitle());
$form->addCommandButton('updateTitle', $lng->txt('save'));
$form->addCommandButton('preview', $lng->txt('cancel'));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPostingGUI::isInWorkspace ( )
protected

Is current page part of personal workspace blog?

Returns
bool

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

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

{
return stristr(get_class($this->access_handler), "workspace");
}

+ Here is the caller graph for this function:

ilBlogPostingGUI::keywordAutocomplete ( )

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

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

{
$force_all = (bool)$_GET["fetchall"];
include_once("./Services/MetaData/classes/class.ilMDKeyword.php");
"blp", $this->getParentObjId());
include_once("./Services/Search/classes/class.ilSearchSettings.php");
$cut = (int)ilSearchSettings::getInstance()->getAutoCompleteLength();
$has_more = false;
$result = array();
foreach ($res as $r)
{
if(!$force_all &&
sizeof($result["items"]) >= $cut)
{
$has_more = true;
break;
}
$entry = new stdClass();
$entry->value = $r;
$entry->label = $r;
$result["items"][] = $entry;
}
$result["hasMoreResults"] = $has_more;
include_once './Services/JSON/classes/class.ilJsonUtil.php';
}

+ Here is the call graph for this function:

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

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

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

{
// #10040 - get note text
include_once "Services/Notes/classes/class.ilNote.php";
$note = new ilNote($a_note_id);
$note = $note->getText();
include_once "Modules/Blog/classes/class.ilObjBlog.php";
ilObjBlog::sendNotification("comment", $this->isInWorkspace(), $this->node_id, $a_posting_id, $note);
}

+ Here is the call graph for this function:

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

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

Referenced by getFirstMediaObjectAsTag().

{
$ratio_width = $ratio_height = 1;
if($src_width > $tgt_width)
{
$ratio_width = $tgt_width / $src_width;
}
if($src_height > $tgt_height)
{
$ratio_height = $tgt_height / $src_height;
}
$shrink_ratio = min($ratio_width, $ratio_height);
return array(
(int)round($src_width*$shrink_ratio),
(int)round($src_height*$shrink_ratio)
);
}

+ Here is the caller graph for this function:

ilBlogPostingGUI::postOutputProcessing (   $a_output)

Finalizing output processing.

Parameters
string$a_output
Returns
string

Reimplemented from ilPageObjectGUI.

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

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

{
// #8626/#9370
if(($this->getOutputMode() == "preview" || $this->getOutputMode() == "offline")
&& !$this->getAbstractOnly() && $this->add_date)
{
if(!$this->isInWorkspace())
{
$author = "";
$author_id = $this->getBlogPosting()->getAuthor();
if($author_id)
{
include_once "Services/User/classes/class.ilUserUtil.php";
$author = ilUserUtil::getNamePresentation($author_id)." - ";
}
}
// prepend creation date
$prefix = "<div class=\"il_BlockInfo\" style=\"text-align:right\">".
$author.ilDatePresentation::formatDate($this->getBlogPosting()->getCreated()).
"</div>";
$a_output = $prefix.$a_output;
}
return $a_output;
}

+ Here is the call graph for this function:

ilBlogPostingGUI::preview (   $a_mode = null)

Preview blog posting.

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

References $_GET, $ilCtrl, $ilSetting, ilPageObjectGUI\$tpl, checkAccess(), getBlogPosting(), ilPageObjectGUI\getId(), ilPageObjectGUI\getNotesHTML(), and isInWorkspace().

{
$this->getBlogPosting()->increaseViewCnt();
$wtpl = new ilTemplate("tpl.blog_page_view_main_column.html",
true, true, "Modules/Blog");
// page commands
if(!$a_mode)
{
/*
// delete
$page_commands = false;
if ($this->checkAccess("write"))
{
$wtpl->setCurrentBlock("page_command");
$wtpl->setVariable("HREF_PAGE_CMD",
$ilCtrl->getLinkTarget($this, "deleteBlogPostingConfirmationScreen"));
$wtpl->setVariable("TXT_PAGE_CMD", $lng->txt("delete"));
$wtpl->parseCurrentBlock();
}
if ($page_commands)
{
$wtpl->setCurrentBlock("page_commands");
$wtpl->parseCurrentBlock();
}
*/
}
else
{
$callback = array($this, "observeNoteAction");
// notes
$may_delete_comments = ($this->checkAccess("contribute") &&
$ilSetting->get("comments_del_tutor", 1));
$wtpl->setVariable("NOTES", $this->getNotesHTML($this->getBlogPosting(),
false, $this->enable_public_notes, $may_delete_comments, $callback));
}
// permanent link
if($a_mode != "embedded")
{
$append = ($_GET["blpg"] != "")
? "_".$_GET["blpg"]
: "";
if($this->isInWorkspace())
{
$append .= "_wsp";
}
$tpl->setPermanentLink("blog", $this->node_id, $append);
}
$wtpl->setVariable("PAGE", parent::preview());
$tpl->setLoginTargetPar("blog_".$this->node_id.$append);
$ilCtrl->setParameter($this, "blpg", $this->getBlogPosting()->getId());
return $wtpl->get();
}

+ Here is the call graph for this function:

ilBlogPostingGUI::previewEmbedded ( )

Needed for portfolio/blog handling.

Returns
string

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

References ilPageObjectGUI\preview().

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

+ Here is the call graph for this function:

ilBlogPostingGUI::previewFullscreen ( )

Needed for portfolio/blog handling.

Returns
string

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

References ilPageObjectGUI\preview().

Referenced by executeCommand().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPostingGUI::saveKeywordsForm ( )

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

References editKeywords(), getBlogPosting(), and initKeywordsForm().

{
$form = $this->initKeywordsForm();
if($form->checkInput())
{
$keywords = $form->getInput("keywords");
if(is_array($keywords))
{
$this->getBlogPosting()->updateKeywords($keywords);
}
$this->ctrl->redirect($this, "preview");
}
$form->setValuesByPost();
$this->editKeywords($form);
}

+ Here is the call graph for this function:

ilBlogPostingGUI::setBlogPosting ( ilBlogPosting  $a_posting)

Set blog posting.

Parameters
ilBlogPosting$a_posting

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

References ilPageObjectGUI\setPageObject().

{
$this->setPageObject($a_posting);
}

+ Here is the call graph for this function:

ilBlogPostingGUI::showPage ( )

Embedded posting in portfolio.

Returns
string

Reimplemented from ilPageObjectGUI.

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

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

{
$this->setTemplateOutput(false);
if (!$this->getAbstractOnly())
{
$this->setPresentationTitle($this->getBlogPosting()->getTitle());
}
$this->getBlogPosting()->increaseViewCnt();
return parent::showPage();
}

+ Here is the call graph for this function:

ilBlogPostingGUI::updateDate ( )

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

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

{
global $ilCtrl, $lng;
$form = $this->initDateForm();
if($form->checkInput())
{
$dt = $form->getInput("date");
$dt = new ilDateTime($dt["date"]." ".$dt["time"], IL_CAL_DATETIME);
$page = $this->getPageObject();
$page->setCreated($dt);
$page->update();
ilUtil::sendSuccess($lng->txt("settings_saved"), true);
$ilCtrl->redirect($this, "preview");
}
$form->setValuesByPost();
$this->editTitle($form);
}

+ Here is the call graph for this function:

ilBlogPostingGUI::updateTitle ( )

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

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

{
global $ilCtrl, $lng;
$form = $this->initTitleForm();
if($form->checkInput())
{
$page = $this->getPageObject();
$page->setTitle($form->getInput("title"));
$page->update();
ilUtil::sendSuccess($lng->txt("settings_saved"), true);
$ilCtrl->redirect($this, "preview");
}
$form->setValuesByPost();
$this->editTitle($form);
}

+ Here is the call graph for this function:

Field Documentation

ilBlogPostingGUI::$access_handler
protected

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

ilBlogPostingGUI::$enable_public_notes
protected

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

ilBlogPostingGUI::$may_contribute
protected

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

Referenced by checkAccess().

ilBlogPostingGUI::$node_id
protected

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


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