121 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
126 $this->
help = $DIC[
"ilHelp"];
127 $this->tabs = $DIC->tabs();
128 $this->nav_history = $DIC[
"ilNavigationHistory"];
129 $this->
user = $DIC->user();
130 $this->toolbar = $DIC->toolbar();
131 $this->tree = $DIC->repositoryTree();
132 $this->locator = $DIC[
"ilLocator"];
133 $this->main_menu = $DIC[
"ilMainMenu"];
134 $this->rbacreview = $DIC->rbac()->review();
135 $this->rbacadmin = $DIC->rbac()->admin();
137 $lng = $DIC->language();
140 $this->gtp = (int)
$_GET[
"gtp"];
141 $this->edt =
$_GET[
"edt"];
142 $this->blpg = (int) $_REQUEST[
"blpg"];
143 $this->old_nr = (int)
$_GET[
"old_nr"];
144 $this->ppage = (int)
$_GET[
"ppage"];
145 $this->user_page = (int) $_REQUEST[
"user_page"];
148 $this->ntf = (int)
$_GET[
"ntf"];
149 $this->apid = (int)
$_GET[
"apid"];
152 $this->author = (int) $_REQUEST[
"ath"];
153 $this->prt_id = (int) $_REQUEST[
"prt_id"];
155 $this->tool_context = $DIC->globalScreen()->tool()->context();
160 throw new ilException(
"Posting ID does not match blog.");
168 if (!$this->month || !$this->items[$this->month]) {
169 $this->month = array_keys($this->items);
170 $this->month = array_shift($this->month);
171 $this->month_default =
true;
175 $ilCtrl->setParameter($this,
"bmn", $this->month);
178 $lng->loadLanguageModule(
"blog");
179 $ilCtrl->saveParameter($this,
"prvm");
200 $forms = parent::initCreationForms($a_new_type);
202 if ($this->id_type == self::WORKSPACE_NODE_ID) {
203 unset($forms[self::CFORM_IMPORT]);
204 unset($forms[self::CFORM_CLONE]);
214 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
222 $tree = $DIC->repositoryTree();
226 $this->tabs_gui->addSubTab(
228 $this->lng->txt(
"blog_properties"),
229 $this->ctrl->getLinkTarget($this,
'edit')
232 $this->tabs_gui->addSubTab(
234 $this->lng->txt(
"obj_sty"),
235 $this->ctrl->getLinkTarget($this,
'editStyleProperties')
239 if ($this->id_type == self::REPOSITORY_NODE_ID) {
240 $grp_ref_id =
$tree->checkForParentType($this->object->getRefId(),
'grp');
241 $crs_ref_id =
$tree->checkForParentType($this->object->getRefId(),
'crs');
243 if ((
int) $grp_ref_id > 0 || (int) $crs_ref_id > 0) {
244 if (
$access->checkAccess(
'write',
'', $this->ref_id)) {
245 $this->tabs_gui->addSubTab(
247 $this->lng->txt(
"notifications"),
248 $this->ctrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
254 $this->tabs_gui->activateSubTab($a_active);
265 if ($this->id_type == self::REPOSITORY_NODE_ID) {
267 $appr->
setInfo(
$lng->txt(
"blog_enable_approval_info"));
274 if (
$ilSetting->get(
'enable_global_profiles')) {
284 $nav->setTitle(
$lng->txt(
"blog_settings_navigation"));
292 $opt->
setInfo(
$lng->txt(
"blog_nav_mode_month_list_info"));
293 $nav_mode->addOption($opt);
296 $mon_num =
new ilNumberInputGUI(
$lng->txt(
"blog_nav_mode_month_list_num_month"),
"nav_list_mon");
297 $mon_num->
setInfo(
$lng->txt(
"blog_nav_mode_month_list_num_month_info"));
298 $mon_num->setSize(3);
299 $mon_num->setMinValue(1);
300 $opt->addSubItem($mon_num);
302 $detail_num =
new ilNumberInputGUI(
$lng->txt(
"blog_nav_mode_month_list_num_month_with_post"),
"nav_list_mon_with_post");
303 $detail_num->
setInfo(
$lng->txt(
"blog_nav_mode_month_list_num_month_with_post_info"));
305 $detail_num->setSize(3);
307 $opt->addSubItem($detail_num);
310 $opt->
setInfo(
$lng->txt(
"blog_nav_mode_month_single_info"));
311 $nav_mode->addOption($opt);
313 $order_options = array();
314 if ($this->object->getOrder()) {
315 foreach ($this->object->getOrder() as $item) {
316 $order_options[] =
$lng->txt(
"blog_" . $item);
320 if (!in_array(
$lng->txt(
"blog_navigation"), $order_options)) {
321 $order_options[] =
$lng->txt(
"blog_navigation");
324 if ($this->id_type == self::REPOSITORY_NODE_ID) {
325 if (!in_array(
$lng->txt(
"blog_authors"), $order_options)) {
326 $order_options[] =
$lng->txt(
"blog_authors");
330 $auth->setInfo(
$lng->txt(
"blog_enable_nav_authors_info"));
335 $keyw->
setInfo(
$lng->txt(
"blog_enable_keywords_info"));
338 if (!in_array(
$lng->txt(
"blog_keywords"), $order_options)) {
339 $order_options[] =
$lng->txt(
"blog_keywords");
344 $order->setValue(array_shift($order_options));
345 $order->setMulti(
true,
true,
false);
352 $pres->setTitle(
$lng->txt(
"blog_presentation_frame"));
355 if ($this->id_type == self::REPOSITORY_NODE_ID) {
356 $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
362 if ($this->id_type == self::REPOSITORY_NODE_ID) {
363 $ppic->setInfo(
$lng->txt(
"blog_profile_picture_repository_info"));
367 if ($blga_set->get(
"banner")) {
370 $dimensions =
" (" . $blga_set->get(
"banner_width") .
"x" .
371 $blga_set->get(
"banner_height") .
")";
377 $file = $this->
object->getImageFullPath(
true);
379 $img->setImage($file);
394 $list->setTitle(
$lng->txt(
"blog_presentation_overview"));
399 $post_num->
setInfo(
$lng->txt(
"blog_list_num_postings_info"));
400 $post_num->setSize(3);
401 $post_num->setMinValue(1);
402 $post_num->setRequired(
true);
406 $a_form->
addItem($abs_shorten);
410 $abs_shorten_len->setRequired(
true);
411 $abs_shorten_len->setSuffix(
$lng->txt(
"blog_abstract_shorten_characters"));
412 $abs_shorten_len->setMinValue(50,
true);
413 $abs_shorten->addSubItem($abs_shorten_len);
416 $abs_img->
setInfo(
$lng->txt(
"blog_abstract_image_info"));
421 $abs_img_width->setRequired(
true);
422 $abs_img_width->setSuffix(
$lng->txt(
"blog_abstract_image_pixels"));
423 $abs_img_width->setMinValue(32,
true);
424 $abs_img->addSubItem($abs_img_width);
428 $abs_img_height->setRequired(
true);
429 $abs_img_height->setSuffix(
$lng->txt(
"blog_abstract_image_pixels"));
430 $abs_img_height->setMinValue(32,
true);
431 $abs_img->addSubItem($abs_img_height);
436 if ($this->id_type == self::REPOSITORY_NODE_ID) {
437 $a_values[
"approval"] = $this->
object->hasApproval();
438 $a_values[
"nav_authors"] = $this->
object->hasAuthors();
440 $a_values[
"keywords"] = $this->
object->hasKeywords();
441 $a_values[
"notes"] = $this->
object->getNotesStatus();
442 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
447 $a_values[
"banner"] = $this->
object->getImage();
448 $a_values[
"rss"] = $this->
object->hasRSS();
449 $a_values[
"abss"] = $this->
object->hasAbstractShorten();
450 $a_values[
"absi"] = $this->
object->hasAbstractImage();
451 $a_values[
"nav"] = $this->
object->getNavMode();
452 $a_values[
"nav_list_mon_with_post"] = $this->
object->getNavModeListMonthsWithPostings();
453 $a_values[
"nav_list_mon"] = $this->
object->getNavModeListMonths();
454 $a_values[
"ov_list_post_num"] = $this->
object->getOverviewPostings();
467 if ($this->id_type == self::REPOSITORY_NODE_ID) {
468 $this->
object->setApproval($a_form->
getInput(
"approval"));
469 $this->
object->setAuthors($a_form->
getInput(
"nav_authors"));
470 $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->saveTileImage();
472 $this->
object->setKeywords($a_form->
getInput(
"keywords"));
473 $this->
object->setNotesStatus($a_form->
getInput(
"notes"));
474 $this->
object->setProfilePicture($a_form->
getInput(
"ppic"));
479 $this->
object->setRSS($a_form->
getInput(
"rss"));
480 $this->
object->setAbstractShorten($a_form->
getInput(
"abss"));
481 $this->
object->setAbstractShortenLength($a_form->
getInput(
"abssl"));
482 $this->
object->setAbstractImage($a_form->
getInput(
"absi"));
483 $this->
object->setAbstractImageWidth($a_form->
getInput(
"absiw"));
484 $this->
object->setAbstractImageHeight($a_form->
getInput(
"absih"));
485 $this->
object->setNavMode($a_form->
getInput(
"nav"));
486 $this->
object->setNavModeListMonthsWithPostings($a_form->
getInput(
"nav_list_mon_with_post"));
487 $this->
object->setNavModeListMonths($a_form->
getInput(
"nav_list_mon"));
488 $this->
object->setOverviewPostings($a_form->
getInput(
"ov_list_post_num"));
490 $order = $a_form->
getInput(
"order");
491 foreach ($order as $idx => $value) {
492 if ($value ==
$lng->txt(
"blog_navigation")) {
493 $order[$idx] =
"navigation";
494 } elseif ($value ==
$lng->txt(
"blog_keywords")) {
495 $order[$idx] =
"keywords";
497 $order[$idx] =
"authors";
500 $this->
object->setOrder($order);
504 if ($_FILES[
"banner"][
"tmp_name"]) {
505 $this->
object->uploadImage($_FILES[
"banner"]);
506 } elseif ($banner->getDeletionFlag()) {
507 $this->
object->deleteImage();
517 if ($this->id_type == self::WORKSPACE_NODE_ID) {
518 $this->ctrl->setParameter($this,
"wsp_id", $this->node_id);
521 $ilHelp->setScreenIdComponent(
"blog");
524 $this->tabs_gui->addTab(
526 $lng->txt(
"content"),
527 $this->ctrl->getLinkTarget($this,
"")
531 $this->tabs_gui->addTab(
533 $lng->txt(
"info_short"),
534 $this->ctrl->getLinkTargetByClass(array(
"ilobjbloggui",
"ilinfoscreengui"),
"showSummary")
539 $this->tabs_gui->addTab(
541 $lng->txt(
"settings"),
542 $this->ctrl->getLinkTarget($this,
"edit")
545 if (!$this->prtf_embed) {
546 if ($this->id_type == self::REPOSITORY_NODE_ID) {
547 $this->tabs_gui->addTab(
549 $lng->txt(
"blog_contributors"),
550 $this->ctrl->getLinkTarget($this,
"contributors")
554 if ($this->id_type == self::REPOSITORY_NODE_ID) {
555 $this->tabs_gui->addTab(
558 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
564 if (!$this->prtf_embed) {
566 $this->tabs_gui->addNonTabbedLink(
568 $lng->txt(
"blog_preview"),
569 $this->ctrl->getLinkTarget($this,
"preview")
587 if ($this->gtp > 0) {
591 $ilCtrl->setCmdClass(
"ilblogpostinggui");
592 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $page_id);
593 if ($this->edt ==
"edit") {
594 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"edit");
596 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"previewFullscreen");
603 $next_class =
$ilCtrl->getNextClass($this);
606 if ($this->id_type == self::REPOSITORY_NODE_ID) {
611 $link =
$ilCtrl->getLinkTargetByClass([
"ilrepositorygui",
"ilObjBlogGUI"],
"preview");
612 $ilNavigationHistory->addItem($this->node_id, $link,
"blog");
616 switch ($next_class) {
617 case 'ilblogpostinggui':
618 if (!$this->prtf_embed) {
619 $tpl->loadStandardTemplate();
628 if ($this->id_type == self::REPOSITORY_NODE_ID) {
633 $ilTabs->setBackTarget(
635 $ilCtrl->getLinkTarget($this,
"")
639 $this->object->getStyleSheetId(),
648 ($this->object->getNotesStatus() && !$this->disable_notes),
656 case "previewFullscreen":
657 $ilCtrl->setParameter($this,
"prvm",
"fsc");
661 case "previewEmbedded":
662 $ilCtrl->setParameter($this,
"prvm",
"emb");
670 if (!$this->prtf_embed) {
671 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
672 $this->tabs_gui->addNonTabbedLink(
674 $lng->txt(
"blog_preview"),
675 $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"previewFullscreen")
677 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
"");
679 $this->ctrl->setParameterByClass(
"ilobjportfoliogui",
"user_page", $this->ppage);
680 $this->tabs_gui->addNonTabbedLink(
682 $lng->txt(
"blog_preview"),
683 $this->ctrl->getLinkTargetByClass(
"ilobjportfoliogui",
"preview")
685 $this->ctrl->setParameterByClass(
"ilobjportfoliogui",
"user_page",
"");
692 $cmd =
"preview" . (($this->prvm ==
"fsc") ?
"Fullscreen" :
"Embedded");
695 if (in_array($cmd, array(
"previewFullscreen",
"previewEmbedded"))) {
703 $is_active = $bpost_gui->getBlogPosting()->getActive();
706 if (($cmd ==
"previewFullscreen" || $cmd ==
"previewEmbedded")
707 && !$is_owner && !$is_active) {
708 $this->ctrl->redirect($this,
"preview");
713 case "previewFullscreen":
721 case "previewEmbedded":
732 if ($this->id_type == self::WORKSPACE_NODE_ID) {
733 $info[] =
$lng->txt(
"blog_draft_info");
735 $info[] =
$lng->txt(
"blog_draft_info_contributors");
738 if ($cmd !=
"history" && $is_active && empty($info)) {
739 $info[] =
$lng->txt(
"blog_new_posting_info");
740 $public_action =
true;
742 if ($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved()) {
744 $info[] =
$lng->txt(
"blog_posting_edit_approval_info");
749 if ($public_action) {
750 ilUtil::sendSuccess(implode(
"<br />", $info));
759 $tpl->setRightContent($nav);
765 case "ilinfoscreengui":
775 case "ilcommonactiondispatchergui":
777 $this->ctrl->forwardCommand($gui);
780 case "ilpermissiongui":
782 $ilTabs->activateTab(
"id_permissions");
784 $this->ctrl->forwardCommand($perm_gui);
787 case "ilobjectcopygui":
790 $cp->setType(
"blog");
791 $this->ctrl->forwardCommand($cp);
794 case 'ilrepositorysearchgui':
796 $ilTabs->activateTab(
"contributors");
798 $rep_search->setTitle($this->lng->txt(
"blog_add_contributor"));
799 $rep_search->setCallback($this,
'addContributor', $this->object->getAllLocalRoles($this->node_id));
800 $this->ctrl->setReturn($this,
'contributors');
801 $ret = &$this->ctrl->forwardCommand($rep_search);
806 $ilTabs->activateTab(
"export");
808 $exp_gui->addFormat(
"xml");
809 $exp_gui->addFormat(
"html", null, $this,
"buildExportFile");
813 case "ilobjstylesheetgui":
814 $this->ctrl->setReturn($this,
"editStyleProperties");
815 $style_gui =
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
817 if ($cmd ==
"create" || $this->new_type ==
"sty") {
818 $style_gui->setCreationMode(
true);
821 if ($cmd ==
"confirmedDelete") {
822 $this->
object->setStyleSheetId(0);
823 $this->
object->update();
826 $ret = $this->ctrl->forwardCommand($style_gui);
828 if ($cmd ==
"save" || $cmd ==
"copyStyle" || $cmd ==
"importStyle") {
830 $this->
object->setStyleSheetId($style_id);
831 $this->
object->update();
832 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
836 case "ilblogexercisegui":
837 $this->ctrl->setReturn($this,
"render");
839 $this->ctrl->forwardCommand($gui);
842 case 'ilobjnotificationsettingsgui':
844 $ilTabs->activateTab(
"settings");
847 $this->ctrl->forwardCommand($gui);
851 if ($cmd !=
"gethtml") {
853 if ($cmd ==
"addToDesk" || $cmd ==
"removeFromDesk") {
854 $this->{$cmd .
"Object"}();
864 if (!$this->prtf_embed) {
865 return parent::executeCommand();
872 return $this->$cmd();
888 $assignments = $be->getAssignmentsOfBlog();
889 if (count($assignments) > 0) {
890 $ass_ids = array_map(
function (
$i) {
895 $this->tool_context->current()->addAdditionalData(
897 $be_gui->getActionButtons()
909 $this->ctrl->setCmd(
"showSummary");
910 $this->ctrl->setCmdClass(
"ilinfoscreengui");
921 $ilTabs->activateTab(
"id_info");
927 if ($this->id_type != self::WORKSPACE_NODE_ID) {
928 $info->enablePrivateNotes();
936 $info->enableNewsEditing(
false);
939 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
941 if ($enable_internal_rss) {
942 $info->setBlockProperty(
"news",
"settings",
true);
943 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
948 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
950 if ($this->id_type == self::WORKSPACE_NODE_ID) {
954 $this->ctrl->forwardCommand($info);
969 $posting->setTitle($title);
970 $posting->setBlogId($this->object->getId());
971 $posting->setActive(
false);
972 $posting->setAuthor(
$ilUser->getId());
976 $ilCtrl->setParameter($this,
"bmn", date(
"Y-m"));
978 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $posting->getId());
979 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"edit");
982 $ilCtrl->redirect($this,
"render");
1007 $ilTabs->activateTab(
"content");
1011 $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this,
"createPosting"));
1014 $ilToolbar->addStickyItem($title,
$lng->txt(
"title"));
1017 $button->setCaption(
"blog_add_posting");
1018 $button->setCommand(
"createPosting");
1019 $ilToolbar->addStickyItem($button);
1022 $first = array_shift((array_keys($this->items)));
1023 if ($first != $this->month) {
1024 $ilToolbar->addSeparator();
1026 $ilCtrl->setParameter($this,
"bmn", $first);
1028 $ilCtrl->setParameter($this,
"bmn", $this->month);
1031 $button->setCaption(
"blog_show_latest");
1032 $button->setUrl(
$url);
1033 $ilToolbar->addButtonInstance($button);
1044 $list = $this->
renderList($list_items,
"preview", null, $is_owner);
1050 $tpl->setContent(
$message . $ilToolbar->getHTML() . $list);
1051 $tpl->setRightContent($nav);
1066 if ($this->id_type == self::REPOSITORY_NODE_ID) {
1078 $list = $this->
renderList($list_items,
"previewEmbedded");
1082 elseif ($this->prt_id) {
1086 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage", $this->user_page);
1087 $link =
$ilCtrl->getLinkTargetByClass(array(
"ilportfoliopagegui",
"ilobjbloggui"),
"render");
1088 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage",
"");
1091 $btn->setCaption(sprintf(
$lng->txt(
"prtf_edit_embedded_blog"), $this->
object->getTitle()),
false);
1092 $btn->setUrl($link);
1093 $btn->setPrimary(
true);
1095 $list = $btn->render();
1110 if ($this->author) {
1111 $list_items = array();
1113 foreach (
$items as $id => $item) {
1114 if ($item[
"author"] == $this->author ||
1115 (is_array($item[
"editors"]) && in_array($this->author, $item[
"editors"]))) {
1116 $list_items[$id] = $item;
1120 } elseif ($this->keyword) {
1121 $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
1123 $max = $this->
object->getOverviewPostings();
1124 if ($this->month_default && $max) {
1125 $list_items = array();
1126 foreach ($this->items as
$month => $postings) {
1127 foreach ($postings as $id => $item) {
1128 if (!$a_show_inactive &&
1132 $list_items[$id] = $item;
1134 if (
sizeof($list_items) >= $max) {
1153 $lng = $DIC->language();
1167 $list = $this->
renderList($list_items,
"previewFullscreen");
1198 $wtpl =
new ilTemplate(
"tpl.blog_embedded.html",
true,
true,
"Modules/Blog");
1200 $wtpl->setVariable(
"VAL_NAVIGATION", $a_nav);
1201 return $wtpl->get();
1217 $owner = $this->
object->getOwner();
1219 $ilTabs->clearTargets();
1225 if ($owner ==
$ilUser->getId()) {
1227 if ($this->id_type == self::WORKSPACE_NODE_ID) {
1228 $back =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&wsp_id=" .
$this->node_id;
1232 $this->ctrl->setParameter($this,
"prvm",
"");
1233 if ($this->blpg == 0) {
1234 $back = $this->ctrl->getLinkTarget($this,
"");
1236 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1237 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
1238 $back = $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"preview");
1240 $this->ctrl->setParameter($this,
"prvm", $this->prvm);
1243 $back_caption = $this->lng->txt(
"blog_back_to_blog_owner");
1246 elseif (
$ilUser->getId() &&
$ilUser->getId() != ANONYMOUS_USER_ID) {
1248 if ($this->id_type == self::WORKSPACE_NODE_ID) {
1249 $back =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&dsh=" . $owner;
1253 $back = $this->ctrl->getLinkTarget($this,
"");
1254 $back_caption = $this->lng->txt(
"blog_back_to_blog_owner");
1266 $ilMainMenu->setTopBarBack($back, $back_caption);
1271 $this->ctrl->setParameter($this,
"bmn",
"");
1273 $this->ctrl->setParameter($this,
"bmn", $this->month);
1279 $tpl->setRightContent($a_navigation);
1295 $this->object->getType(),
1297 $this->
object->getId(),
1304 if ($this->id_type != self::REPOSITORY_NODE_ID) {
1306 $name = $name[
"lastname"] .
", " . ($t = $name[
"title"] ? $t .
" " :
"") . $name[
"firstname"];
1312 if ($blga_set->get(
"banner")) {
1314 $banner_width = $blga_set->get(
"banner_width");
1315 $banner_height = $blga_set->get(
"banner_height");
1317 $banner = basename($banner);
1322 if ($this->object->hasProfilePicture()) {
1324 if ($this->id_type == self::REPOSITORY_NODE_ID) {
1326 if ($this->blpg > 0 && !$a_export) {
1328 $author_id = $post->getAuthor();
1333 $name = $name[
"lastname"] .
", " . ($t = $name[
"title"] ? $t .
" " :
"") . $name[
"firstname"];
1341 $ppic = basename($ppic);
1346 $a_tpl->resetHeaderBlock(
false);
1347 $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
1348 $a_tpl->setTitleIcon($ppic);
1349 $a_tpl->setTitle($this->object->getTitle());
1350 $a_tpl->setDescription($name);
1361 $author_found =
false;
1365 if ($this->author &&
1366 ($posting[
"author"] == $this->author ||
1367 (is_array($posting[
"editors"]) && in_array($this->author, $posting[
"editors"])))) {
1368 $author_found =
true;
1375 if ($this->author && !$author_found) {
1376 $this->author = null;
1392 public function renderList(array
$items, $a_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false, $a_export_directory = null)
1398 $wtpl =
new ilTemplate(
"tpl.blog_list.html",
true,
true,
"Modules/Blog");
1401 if ($this->prt_id > 0 &&
1402 stristr($a_cmd,
"embedded")) {
1405 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage", $this->user_page);
1406 $link =
$ilCtrl->getLinkTargetByClass(array(
"ilportfoliopagegui",
"ilobjbloggui"),
"render");
1407 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage",
"");
1410 $list->setListTitle(
$lng->txt(
"action"));
1412 sprintf(
$lng->txt(
"prtf_edit_embedded_blog"), $this->
object->getTitle()),
1417 $wtpl->setCurrentBlock(
"prtf_edit_bl");
1418 $wtpl->setVariable(
"PRTF_BLOG_EDIT", $list->getHTML());
1419 $wtpl->parseCurrentBlock();
1427 foreach ($items as $item) {
1430 if (!$is_active && !$a_show_inactive) {
1436 if (!$this->keyword && !$this->author) {
1440 if (!$last_month || $last_month !=
$month) {
1442 $wtpl->setCurrentBlock(
"month_bl");
1443 $wtpl->parseCurrentBlock();
1447 if ($this->keyword) {
1449 } elseif ($this->author) {
1453 " " . substr(
$month, 0, 4);
1458 $wtpl->setVariable(
"TXT_CURRENT_MONTH", $title);
1461 if (!$a_link_template) {
1462 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1463 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $item[
"id"]);
1470 $posting_edit = $this->
mayEditPosting($item[
"id"], $item[
"author"]);
1471 if (($posting_edit || $is_admin) && !$a_link_template && $a_cmd ==
"preview") {
1473 $alist->setId($item[
"id"]);
1474 $alist->setListTitle(
$lng->txt(
"actions"));
1476 if ($is_active && $this->object->hasApproval() && !$item[
"approved"]) {
1478 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1480 $lng->txt(
"blog_approve"),
1482 $ilCtrl->getLinkTarget($this,
"approve")
1484 $ilCtrl->setParameter($this,
"apid",
"");
1487 $wtpl->setVariable(
"APPROVAL",
$lng->txt(
"blog_needs_approval"));
1490 if ($posting_edit) {
1492 $lng->txt(
"edit_content"),
1494 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit")
1500 $lng->txt(
"blog_toggle_draft"),
1502 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deactivatePageToList")
1506 $lng->txt(
"blog_toggle_final"),
1508 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"activatePageToList")
1513 $lng->txt(
"rename"),
1515 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edittitle")
1518 if ($this->object->hasKeywords()) {
1520 $lng->txt(
"blog_edit_keywords"),
1522 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords")
1527 $lng->txt(
"blog_edit_date"),
1529 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editdate")
1532 $lng->txt(
"delete"),
1534 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen")
1536 } elseif ($is_admin) {
1539 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1541 $lng->txt(
"blog_toggle_draft_admin"),
1543 $ilCtrl->getLinkTarget($this,
"deactivateAdmin")
1545 $ilCtrl->setParameter($this,
"apid",
"");
1549 $lng->txt(
"delete"),
1551 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen")
1555 $wtpl->setCurrentBlock(
"actions");
1556 $wtpl->setVariable(
"ACTION_SELECTOR", $alist->getHTML());
1557 $wtpl->parseCurrentBlock();
1561 if ($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes) {
1570 if ($a_cmd !=
"preview") {
1571 $wtpl->setCurrentBlock(
"comments");
1572 $wtpl->setVariable(
"TEXT_COMMENTS",
$lng->txt(
"blog_comments"));
1573 $wtpl->setVariable(
"URL_COMMENTS",
$preview);
1574 $wtpl->setVariable(
"COUNT_COMMENTS", $count);
1575 $wtpl->parseCurrentBlock();
1588 if ($a_cmd !=
"preview" && $a_cmd !=
"previewEmbedded") {
1589 if ($this->id_type == self::WORKSPACE_NODE_ID) {
1590 $goto = $this->
getAccessHandler()->getGotoLink($this->node_id, $this->obj_id,
"_" . $item[
"id"]);
1594 $wtpl->setCurrentBlock(
"permalink");
1595 $wtpl->setVariable(
"URL_PERMALINK", $goto);
1596 $wtpl->setVariable(
"TEXT_PERMALINK",
$lng->txt(
"blog_permanent_link"));
1597 $wtpl->parseCurrentBlock();
1602 $this->object->hasAbstractShorten(),
1603 $this->
object->getAbstractShortenLength(),
1605 $this->
object->hasAbstractImage(),
1606 $this->
object->getAbstractImageWidth(),
1607 $this->
object->getAbstractImageHeight(),
1612 $wtpl->setCurrentBlock(
"more");
1613 $wtpl->setVariable(
"URL_MORE",
$preview);
1614 $wtpl->setVariable(
"TEXT_MORE",
$lng->txt(
"blog_list_more"));
1615 $wtpl->parseCurrentBlock();
1621 $wtpl->setCurrentBlock(
"draft_text");
1622 $wtpl->setVariable(
"DRAFT_TEXT",
$lng->txt(
"blog_draft_text"));
1623 $wtpl->parseCurrentBlock();
1624 $wtpl->setVariable(
"DRAFT_CLASS",
" ilBlogListItemDraft");
1627 $wtpl->setCurrentBlock(
"posting");
1630 if ($this->id_type == self::REPOSITORY_NODE_ID) {
1633 $author_id = $item[
"author"];
1638 if (is_array($item[
"editors"])) {
1639 foreach ($item[
"editors"] as $editor_id) {
1645 $author = implode(
", ", $authors) .
" - ";
1650 $wtpl->setVariable(
"URL_TITLE",
$preview);
1651 $wtpl->setVariable(
"TITLE", $item[
"title"]);
1655 $keywords = (count($kw) > 0)
1656 ?
"<br>" . $this->lng->txt(
"keywords") .
": " . implode(
", ", $kw)
1659 $wtpl->setVariable(
"DATETIME",
$author .
1663 $wtpl->setVariable(
"CONTENT", $snippet);
1665 $wtpl->parseCurrentBlock();
1669 if ($a_cmd ==
"previewFullscreen") {
1670 $this->tpl->setPermanentLink(
1673 ($this->id_type == self::WORKSPACE_NODE_ID)
1679 if (!$is_empty || $a_show_inactive) {
1680 return $wtpl->get();
1692 return \ILIAS\Blog\Export\BlogHtmlExport::buildExportLink($a_template,
$a_type, $a_id, $this->
getKeywords(
false));
1706 protected function renderNavigationByDate(array $a_items, $a_list_cmd =
"render", $a_posting_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false, $a_blpg = 0)
1710 $blpg = ($a_blpg > 0)
1716 foreach ($a_items as
$month => $postings) {
1717 foreach (array_keys($postings) as $id) {
1719 if (!$a_show_inactive && !$active) {
1720 unset($a_items[
$month][$id]);
1722 $a_items[
$month][$id][
"active"] = $active;
1725 if (!
sizeof($a_items[
$month])) {
1726 unset($a_items[$month]);
1733 $max_months = $this->
object->getNavModeListMonths();
1735 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_by_date.html",
true,
true,
"Modules/Blog");
1737 $ilCtrl->setParameter($this,
"blpg",
"");
1739 $counter = $mon_counter = $last_year = 0;
1740 foreach ($a_items as
$month => $postings) {
1741 if (!$a_link_template && $max_months && $mon_counter >= $max_months) {
1746 $year = substr(
$month, 0, 4);
1747 if (!$last_year || $year != $last_year) {
1757 if (!$a_link_template) {
1759 $month_url =
$ilCtrl->getLinkTarget($this, $a_list_cmd);
1766 if ($mon_counter <= $this->object->getNavModeListMonthsWithPostings()) {
1768 $wtpl->setCurrentBlock(
"navigation_year_details");
1769 $wtpl->setVariable(
"YEAR", $year);
1770 $wtpl->parseCurrentBlock();
1773 foreach ($postings as $id => $posting) {
1784 if (!$a_link_template) {
1785 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
$month);
1786 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $id);
1787 $url =
$ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1792 if (!$posting[
"active"]) {
1793 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
1794 } elseif ($this->object->hasApproval() && !$posting[
"approved"]) {
1795 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
1798 $wtpl->setCurrentBlock(
"navigation_item");
1799 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1800 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1801 $wtpl->parseCurrentBlock();
1804 $wtpl->setCurrentBlock(
"navigation_month_details");
1805 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1806 $wtpl->setVariable(
"URL_MONTH", $month_url);
1807 $wtpl->parseCurrentBlock();
1812 $wtpl->setCurrentBlock(
"navigation_year");
1813 $wtpl->setVariable(
"YEAR", $year);
1814 $wtpl->parseCurrentBlock();
1817 $wtpl->setCurrentBlock(
"navigation_month");
1818 $wtpl->setVariable(
"MONTH_NAME", $month_name);
1819 $wtpl->setVariable(
"URL_MONTH", $month_url);
1820 $wtpl->setVariable(
"MONTH_COUNT",
sizeof($postings));
1821 $wtpl->parseCurrentBlock();
1825 $ilCtrl->setParameter($this,
"bmn", $this->month);
1826 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1828 return $wtpl->get();
1832 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_month.html",
true,
true,
"Modules/Blog");
1834 $ilCtrl->setParameter($this,
"blpg",
"");
1836 $month_options = array();
1837 foreach ($a_items as
$month => $postings) {
1839 " " . substr(
$month, 0, 4);
1841 $month_options[
$month] = $month_name;
1843 if (
$month == $this->month) {
1844 if (!$a_link_template) {
1846 $month_url =
$ilCtrl->getLinkTarget($this, $a_list_cmd);
1851 foreach ($postings as $id => $posting) {
1855 if (!$a_link_template) {
1856 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
$month);
1857 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $id);
1858 $url =
$ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1863 if (!$posting[
"active"]) {
1864 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
1865 } elseif ($this->object->hasApproval() && !$posting[
"approved"]) {
1866 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
1869 $wtpl->setCurrentBlock(
"navigation_item");
1870 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1871 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1872 $wtpl->parseCurrentBlock();
1875 $wtpl->setCurrentBlock(
"navigation_month_details");
1877 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1878 $wtpl->setVariable(
"URL_MONTH", $month_url);
1880 $wtpl->parseCurrentBlock();
1885 $wtpl->setCurrentBlock(
"option_bl");
1886 foreach ($month_options as $value => $caption) {
1887 $wtpl->setVariable(
"OPTION_VALUE", $value);
1888 $wtpl->setVariable(
"OPTION_CAPTION", $caption);
1889 if ($value == $this->month) {
1890 $wtpl->setVariable(
"OPTION_SEL",
' selected="selected"');
1892 $wtpl->parseCurrentBlock();
1895 $wtpl->setVariable(
"FORM_ACTION",
$ilCtrl->getFormAction($this, $a_list_cmd));
1898 $ilCtrl->setParameter($this,
"bmn", $this->month);
1899 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1901 return $wtpl->get();
1913 $a_list_cmd =
"render",
1914 $a_show_inactive =
false,
1915 $a_link_template =
false,
1920 $blpg = ($a_blpg > 0)
1926 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_keywords.html",
true,
true,
"Modules/Blog");
1928 $max = max($keywords);
1930 $wtpl->setCurrentBlock(
"keyword");
1931 foreach ($keywords as
$keyword => $counter) {
1932 if (!$a_link_template) {
1934 $url =
$ilCtrl->getLinkTarget($this, $a_list_cmd);
1935 $ilCtrl->setParameter($this,
"kwd",
"");
1940 $wtpl->setVariable(
"TXT_KEYWORD",
$keyword);
1942 $wtpl->setVariable(
"URL_KEYWORD",
$url);
1943 $wtpl->parseCurrentBlock();
1946 return $wtpl->get();
1956 foreach (
$items as $item) {
1958 if ($item[
"author"]) {
1959 $authors[] = $item[
"author"];
1962 if (is_array($item[
"editors"])) {
1963 foreach ($item[
"editors"] as $editor_id) {
1964 if ($editor_id != $item[
"author"]) {
1965 $authors[] = $editor_id;
1973 $authors = array_unique($authors);
1974 if (
sizeof($authors) > 1) {
1976 foreach ($authors as $user_id) {
1978 $ilCtrl->setParameter($this,
"ath", $user_id);
1979 $url =
$ilCtrl->getLinkTarget($this, $a_list_cmd);
1980 $ilCtrl->setParameter($this,
"ath",
"");
1983 $idx = trim(strip_tags(
$name)) .
"///" . $user_id;
1989 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_authors.html",
true,
true,
"Modules/Blog");
1991 $wtpl->setCurrentBlock(
"author");
1993 $wtpl->setVariable(
"TXT_AUTHOR", $author[0]);
1994 $wtpl->setVariable(
"URL_AUTHOR", $author[1]);
1995 $wtpl->parseCurrentBlock();
1998 return $wtpl->get();
2013 $lng = $DIC->language();
2014 $ctrl = $DIC->ctrl();
2016 $f = $DIC->ui()->factory();
2020 :
"previewFullscreen";
2022 if ($single_posting) {
2024 if ($latest_posting !=
"" && $this->blpg != $latest_posting) {
2025 $ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $latest_posting);
2026 $mb =
$f->button()->standard(
2027 $lng->txt(
"blog_latest_posting"),
2028 $ctrl->getLinkTargetByClass(
"ilblogpostinggui", $cmd)
2031 $mb =
$f->button()->standard(
$lng->txt(
"blog_latest_posting"),
"#")->withUnavailableAction();
2035 if ($prev_posting !=
"") {
2036 $ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $prev_posting);
2037 $pb =
$f->button()->standard(
2038 $lng->txt(
"previous"),
2039 $ctrl->getLinkTargetByClass(
"ilblogpostinggui", $cmd)
2042 $pb =
$f->button()->standard(
$lng->txt(
"previous"),
"#")->withUnavailableAction();
2046 if ($next_posting !=
"") {
2047 $ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $next_posting);
2048 $nb =
$f->button()->standard(
2050 $ctrl->getLinkTargetByClass(
"ilblogpostinggui", $cmd)
2053 $nb =
$f->button()->standard(
$lng->txt(
"next"),
"#")->withUnavailableAction();
2055 $ctrl->setParameter($this,
"blpg", $this->blpg);
2056 $vc =
$f->viewControl()->section($pb, $mb, $nb);
2059 $ctrl->setParameter($this,
"prvm",
"");
2060 $ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
2061 $link = $link =
$ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
2063 $toolbar->addComponent(
$f->button()->standard(
$lng->txt(
"blog_edit_posting"), $link));
2067 if ($latest_month !=
"" && $this->month != $latest_month) {
2068 $ctrl->setParameter($this,
"bmn", $latest_month);
2069 $mb =
$f->button()->standard(
2070 $lng->txt(
"blog_latest_posting"),
2071 $ctrl->getLinkTarget($this,
"preview")
2074 $mb =
$f->button()->standard(
$lng->txt(
"blog_latest_posting"),
"#")->withUnavailableAction();
2078 if ($prev_month !=
"") {
2079 $ctrl->setParameter($this,
"bmn", $prev_month);
2080 $pb =
$f->button()->standard(
$lng->txt(
"previous"),
$ctrl->getLinkTarget($this,
"preview"));
2082 $pb =
$f->button()->standard(
$lng->txt(
"previous"),
"#")->withUnavailableAction();
2086 if ($next_month !=
"") {
2087 $ctrl->setParameter($this,
"bmn", $next_month);
2088 $nb =
$f->button()->standard(
$lng->txt(
"next"),
$ctrl->getLinkTarget($this,
"preview"));
2090 $nb =
$f->button()->standard(
$lng->txt(
"next"),
"#")->withUnavailableAction();
2092 $ctrl->setParameter($this,
"bmn", $this->month);
2093 $vc =
$f->viewControl()->section($pb, $mb, $nb);
2097 $ctrl->setParameter($this,
"prvm",
"");
2099 $ctrl->setParameter($this,
"bmn",
"");
2100 $ctrl->setParameter($this,
"blpg",
"");
2101 $link =
$ctrl->getLinkTarget($this,
"");
2102 $ctrl->setParameter($this,
"blpg", $this->blpg);
2103 $ctrl->setParameter($this,
"bmn", $this->month);
2105 $toolbar->addComponent(
$f->button()->standard(
$lng->txt(
"edit"), $link));
2121 if (
$month > $this->month) {
2139 if ($month < $this->month && $found ==
"") {
2155 return key($a_items);
2170 foreach (
$items as $item) {
2171 if ($item[
"id"] == $this->blpg) {
2175 $next_blpg = $item[
"id"];
2194 foreach (
$items as $item) {
2195 if ($found && $prev_blpg ==
"") {
2196 $prev_blpg = $item[
"id"];
2198 if ($item[
"id"] == $this->blpg) {
2215 $month = current($a_items);
2217 return current(
$month)[
"id"];
2232 public function renderNavigation($a_list_cmd =
"render", $a_posting_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false, $a_blpg = 0)
2238 $blpg = ($a_blpg > 0)
2242 if ($this->object->getOrder()) {
2243 $order = array_flip($this->object->getOrder());
2252 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation.html",
true,
true,
"Modules/Blog");
2257 if (
sizeof($a_items)) {
2258 $blocks[$order[
"navigation"]] = array(
2259 $this->lng->txt(
"blog_navigation"),
2260 $this->
renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive, $a_blpg)
2264 if ($this->object->hasKeywords()) {
2266 $may_edit_keywords = (
$blpg > 0 &&
2268 $a_list_cmd !=
"preview" &&
2269 $a_list_cmd !=
"gethtml" &&
2272 if ($keywords || $may_edit_keywords) {
2274 $keywords = $this->lng->txt(
"blog_no_keywords");
2277 $blocks[$order[
"keywords"]] = array(
2278 $this->lng->txt(
"blog_keywords"),
2281 ? array($cmd, $this->lng->txt(
"blog_edit_keywords"))
2288 if (!$a_link_template) {
2290 if ($this->id_type == self::REPOSITORY_NODE_ID &&
2291 $this->object->hasAuthors()) {
2294 $blocks[$order[
"authors"]] = array($this->lng->txt(
"blog_authors"), $authors);
2299 if ($this->object->hasRSS() &&
2301 $a_list_cmd ==
"preview") {
2304 if ($this->id_type != self::WORKSPACE_NODE_ID) {
2308 "&client_id=" . rawurlencode(CLIENT_ID);
2314 if (
sizeof($blocks)) {
2317 $ui_factory = $DIC->ui()->factory();
2318 $ui_renderer = $DIC->ui()->renderer();
2321 foreach ($blocks as $block) {
2324 $content = $block[1];
2326 $secondary_panel = $ui_factory->panel()->secondary()->legacy($title, $ui_factory->legacy($content));
2328 if (isset($block[2]) && is_array($block[2])) {
2329 $link = $ui_factory->button()->shy($block[2][1], $block[2][0]);
2330 $secondary_panel = $secondary_panel->withFooter($link);
2333 $wtpl->setCurrentBlock(
"block_bl");
2334 $wtpl->setVariable(
"BLOCK", $ui_renderer->render($secondary_panel));
2335 $wtpl->parseCurrentBlock();
2339 return $wtpl->get();
2351 $keywords = array();
2352 if ($a_posting_id) {
2358 foreach (
$items as $item) {
2370 foreach ($keywords as
$keyword => $counter) {
2371 $tmp[] = array(
"keyword" =>
$keyword,
"counter" => $counter);
2375 $keywords = array();
2376 foreach ($tmp as $item) {
2377 $keywords[$item[
"keyword"]] = $item[
"counter"];
2393 $subdir = $this->
object->getType() .
"_" . $this->
object->getId();
2395 $blog_export = new \ILIAS\Blog\Export\BlogHtmlExport($this, $exp_dir, $subdir);
2396 return $blog_export->exportHTML();
2406 $this->disable_notes = (bool) $a_value;
2415 if ($a_cmd ==
"preview" || $a_cmd ==
"previewFullscreen" || $this->prvm) {
2417 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
2419 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2423 $ilCtrl->setParameter($this,
"prvm",
"");
2427 return parent::addHeaderAction();
2436 if (!$this->obj_id) {
2440 $sub_type = $sub_id = null;
2441 if ($this->blpg > 0) {
2446 $lg = parent::initHeaderAction($sub_type, $sub_id);
2448 if ($a_is_preview) {
2449 $lg->enableComments(
false);
2450 $lg->enableNotes(
false);
2451 $lg->enableTags(
false);
2454 $ilCtrl->setParameter($this,
"ntf", 1);
2455 $link =
$ilCtrl->getLinkTarget($this,
"setNotification");
2456 $ilCtrl->setParameter($this,
"ntf",
"");
2458 $lg->addCustomCommand($link,
"blog_notification_toggle_off");
2464 $this->lng->txt(
"blog_notification_activated")
2467 $ilCtrl->setParameter($this,
"ntf", 2);
2468 $link =
$ilCtrl->getLinkTarget($this,
"setNotification");
2469 $ilCtrl->setParameter($this,
"ntf",
"");
2470 $lg->addCustomCommand($link,
"blog_notification_toggle_on");
2475 $this->lng->txt(
"blog_notification_deactivated")
2481 $ilCtrl->setParameter($this,
"prvm",
"");
2483 $ilCtrl->setParameter($this,
"bmn",
"");
2484 $ilCtrl->setParameter($this,
"blpg",
"");
2485 $link =
$ilCtrl->getLinkTarget($this,
"");
2486 $ilCtrl->setParameter($this,
"blpg", $sub_id);
2487 $ilCtrl->setParameter($this,
"bmn", $this->month);
2488 $lg->addCustomCommand($link,
"blog_edit");
2491 $link =
$ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
2492 $lg->addCustomCommand($link,
"blog_edit_posting");
2495 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2498 $ilCtrl->setParameter($this,
"ntf",
"");
2509 switch ($this->ntf) {
2519 $ilCtrl->redirect($this,
"preview");
2533 if ($post->getBlogId() == $a_blog_id) {
2534 return $post->getTitle();
2545 foreach ($this->items as
$month => $postings) {
2546 foreach ($postings as $id => $item) {
2548 unset($this->items[
$month][$id]);
2549 } elseif ($this->object->hasApproval() && !$item[
"approved"]) {
2550 unset($this->items[
$month][$id]);
2553 if (!
sizeof($this->items[
$month])) {
2554 unset($this->items[$month]);
2558 if ($this->items && !isset($this->items[$this->month])) {
2559 $this->month = array_shift(array_keys($this->items));
2567 foreach (
$items as $item) {
2602 if ($this->id_type == self::WORKSPACE_NODE_ID) {
2616 if (!$a_author_id) {
2618 $a_author_id = $post->getAuthor();
2620 if (
$ilUser->getId() == $a_author_id) {
2639 if ($this->id_type == self::WORKSPACE_NODE_ID) {
2651 if (is_object($this->
object)) {
2652 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"preview"),
"",
$this->node_id);
2658 if ($this->
isAdmin() && $this->apid > 0) {
2660 $post->setApproved(
true);
2661 $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2662 $post->update(
true,
false,
true,
"new");
2664 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
2667 $this->ctrl->redirect($this,
"render");
2687 $ilTabs->activateTab(
"contributors");
2689 $local_roles = $this->
object->getAllLocalRoles($this->node_id);
2696 'auto_complete_name' =>
$lng->txt(
'user'),
2697 'submit_name' =>
$lng->txt(
'add'),
2698 'add_search' =>
true,
2700 'user_type' => $local_roles
2705 $other_roles = $this->
object->getRolesWithContributeOrRedact($this->node_id);
2707 ilUtil::sendInfo(sprintf(
$lng->txt(
"blog_contribute_other_roles"), implode(
", ", $other_roles)));
2710 $tbl =
new ilContributorTableGUI($this,
"contributors", $this->object->getAllLocalRoles($this->node_id));
2712 $tpl->setContent($tbl->getHTML());
2725 if (!strlen(trim($user_login))) {
2729 $users = explode(
',', $user_login);
2731 $user_ids = array();
2732 foreach ($users as
$user) {
2740 $user_ids[] = $user_id;
2762 if (!count($a_user_ids) || !$a_user_type) {
2768 $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2769 if (!in_array($a_user_type, $local_roles)) {
2774 foreach ($a_user_ids as $user_id) {
2775 if (!
$rbacreview->isAssigned($user_id, $a_user_type)) {
2776 $rbacadmin->assignUser($a_user_type, $user_id);
2780 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
2781 $ilCtrl->redirect($this,
"contributors");
2791 if (!is_array($ids)) {
2793 $this->ctrl->redirect($this,
"contributors");
2797 $confirm->setHeaderText($this->lng->txt(
'blog_confirm_delete_contributors'));
2798 $confirm->setFormAction($this->ctrl->getFormAction($this,
'removeContributor'));
2799 $confirm->setConfirm($this->lng->txt(
'delete'),
'removeContributor');
2800 $confirm->setCancel($this->lng->txt(
'cancel'),
'contributors');
2802 foreach ($ids as $user_id) {
2810 $this->tpl->setContent($confirm->getHTML());
2824 if (!is_array($ids)) {
2826 $ilCtrl->redirect($this,
"contributors");
2830 $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2831 if (!$local_roles) {
2836 foreach ($ids as $user_id) {
2837 foreach ($local_roles as $role_id) {
2838 $rbacadmin->deassignUser($role_id, $user_id);
2842 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
2843 $this->ctrl->redirect($this,
"contributors");
2851 $post->setApproved(
false);
2852 $post->setActive(
false);
2853 $post->update(
true,
false,
false);
2855 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
2858 $this->ctrl->redirect($this,
"render");
2870 if ($a_tpl != null) {
2876 $ctpl->setCurrentBlock(
"ContentStyle");
2878 "LOCATION_CONTENT_STYLESHEET",
2881 $ctpl->parseCurrentBlock();
2888 $this->tabs_gui->activateTab(
"settings");
2892 $this->tpl->setContent($form->getHTML());
2899 $this->lng->loadLanguageModule(
"style");
2903 $fixed_style =
$ilSetting->get(
"fixed_content_style_id");
2904 $style_id = $this->
object->getStyleSheetId();
2906 if ($fixed_style > 0) {
2909 $this->lng->txt(
"global_fixed") .
")");
2910 $form->addItem($st);
2918 $st_styles[0] = $this->lng->txt(
"default");
2921 if ($style_id > 0) {
2926 $form->addItem($st);
2929 $form->addCommandButton(
"editStyle", $this->lng->txt(
"style_edit_style"));
2930 $form->addCommandButton(
"deleteStyle", $this->lng->txt(
"style_delete_style"));
2936 $this->lng->txt(
"style_current_style"),
2939 $style_sel->setOptions($st_styles);
2940 $style_sel->setValue($style_id);
2941 $form->addItem($style_sel);
2943 $form->addCommandButton(
"saveStyleSettings", $this->lng->txt(
"save"));
2944 $form->addCommandButton(
"createStyle", $this->lng->txt(
"sty_create_ind_style"));
2948 $form->setTitle($this->lng->txt(
"blog_style"));
2949 $form->setFormAction($this->ctrl->getFormAction($this));
2956 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"create");
2961 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
2966 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
2973 if (
$ilSetting->get(
"fixed_content_style_id") <= 0 &&
2975 || $this->object->getStyleSheetId() == 0)) {
2976 $this->
object->setStyleSheetId((
int)
$_POST[
"style_id"]);
2977 $this->
object->update();
2979 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
2981 $this->ctrl->redirect($this,
"editStyleProperties");
2996 if (substr($a_target, -3) ==
"wsp") {
2997 $id = explode(
"_", $a_target);
2999 $ilCtrl->setTargetScript(
"ilias.php");
3000 $ilCtrl->initBaseClass(
"ilSharedResourceGUI");
3001 $ilCtrl->setParameterByClass(
"ilSharedResourceGUI",
"wsp_id", $id[0]);
3003 if (
sizeof($id) >= 2) {
3004 if (is_numeric($id[1])) {
3005 $ilCtrl->setParameterByClass(
"ilSharedResourceGUI",
"gtp", $id[1]);
3007 $ilCtrl->setParameterByClass(
"ilSharedResourceGUI",
"kwd", $id[1]);
3009 if ($id[2] ==
"edit") {
3010 $ilCtrl->setParameterByClass(
"ilSharedResourceGUI",
"edt", $id[2]);
3013 $ilCtrl->redirectByClass(
"ilSharedResourceGUI",
"");
3015 $id = explode(
"_", $a_target);
3017 $ilCtrl->setTargetScript(
"ilias.php");
3018 $ilCtrl->initBaseClass(
"ilRepositoryGUI");
3019 $ilCtrl->setParameterByClass(
"ilRepositoryGUI",
"ref_id", $id[0]);
3021 if (
sizeof($id) >= 2) {
3022 if (is_numeric($id[1])) {
3023 $ilCtrl->setParameterByClass(
"ilRepositoryGUI",
"gtp", $id[1]);
3025 $ilCtrl->setParameterByClass(
"ilRepositoryGUI",
"kwd", $id[1]);
3028 if ($id[2] ==
"edit") {
3029 $ilCtrl->setParameterByClass(
"ilRepositoryGUI",
"edt", $id[2]);
3032 if (
$access->checkAccess(
"read",
"", $id[0])) {
3033 $ilCtrl->redirectByClass(
"ilRepositoryGUI",
"preview");
3035 if (
$access->checkAccess(
"visible",
"", $id[0])) {
3036 $ilCtrl->redirectByClass(
"ilRepositoryGUI",
"infoScreen");
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _lookupName($a_user_id)
lookup user name
getLatestPosting($a_items)
Get previous posting.
filterInactivePostings()
Filter inactive items from items list.
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
const ABSTRACT_DEFAULT_IMAGE_WIDTH
This class represents an option in a radio group.
addUserFromAutoComplete()
Autocomplete submit.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
disableNotes($a_value=false)
mayContribute()
Check if user may contribute at all.
renderFullscreenHeader($a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
static lookupBlogId($a_posting_id)
Lookup blog id.
getNextPosting($a_items)
Get next posting.
setValue($a_value)
Set Value.
preview()
Render fullscreen presentation.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
New implementation of ilObjectGUI.
GUI class for the workflow of copying objects.
static _goto($a_target)
Deep link.
static lookupSubObjectTitle($a_blog_id, $a_posting_id)
Get title for blog posting (used in ilNotesGUI)
Class ilBlogPosting GUI class.
getAccessHandler()
Get access handler.
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
getPermanentLinkWidget($a_append=null, $a_center=false)
initStylePropertiesForm()
getPreviousMonth($a_items)
Get next month.
static hasOptOut($obj_id)
Is opt out (disable notification) allowed?
static _lookupId($a_user_str)
Lookup id by login.
static _lookupTitle($a_id)
lookup object title
static _getNotesOfObject( $a_rep_obj_id, $a_obj_id, $a_obj_type, $a_type=IL_NOTE_PRIVATE, $a_incl_sub=false, $a_filter="", $a_all_public="y", $a_repository_mode=true, $a_sort_ascending=false, $a_news_id=0)
get all notes related to a specific object
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static getKeywords($a_obj_id, $a_posting_id)
export()
Build and deliver export file.
const ABSTRACT_DEFAULT_SHORTEN_LENGTH
setInfo($a_info)
Set Info.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
updateCustom(ilPropertyFormGUI $a_form)
static _numericMonthToString($a_month, $a_long=true)
numeric month to string
initEditCustomForm(ilPropertyFormGUI $a_form)
filterItemsByKeyWord(array $a_items, $a_keyword)
static _lookupStandard($a_id)
Lookup standard flag.
renderNavigationByKeywords( $a_list_cmd="render", $a_show_inactive=false, $a_link_template=false, $a_blpg=0)
Build navigation by keywords block.
getEditFormCustomValues(array &$a_values)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
renderNavigationByDate(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation by date block.
Export User Interface Class.
getListItems($a_show_inactive=false)
Filter blog postings by month, keyword or author.
buildEmbedded($a_content, $a_nav)
Combine content (list/posting) and navigation to html chunk.
renderList(array $items, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_export_directory=null)
Build posting month list.
static exists($a_blog_id, $a_posting_id)
Checks whether a posting exists.
buildExportFile()
Build export file.
getNextMonth($a_items)
Get next month.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
foreach($_POST as $key=> $value) $res
triggerAssignmentTool()
Trigger assignment tool.
renderFullScreen($a_content, $a_navigation)
Build fullscreen context.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
const ABSTRACT_DEFAULT_IMAGE_HEIGHT
buildPostingList($a_obj_id)
Gather all blog postings.
confirmRemoveContributor()
Used in ilContributorTableGUI.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
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.
omitLocator($a_omit=true)
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
render()
Render object context.
static _lookupOwner($a_id)
lookup object owner
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
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:
static signFile($path_to_file)
static getRelevanceClass($cnt, $max)
Get style class for tag relevance.
addContributor($a_user_ids=array(), $a_user_type=null)
Centralized method to add contributors.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
createPosting()
Create new posting.
infoScreenForward()
show information screen
buildExportLink($a_template, $a_type, $a_id)
Build export link.
removeContributor()
Used in ilContributorTableGUI.
getKeywords($a_show_inactive, $a_posting_id=null)
Get keywords for single posting or complete blog.
renderNavigationByAuthors(array $a_items, $a_list_cmd="render", $a_show_inactive=false)
setContentStyleSheet($a_tpl=null)
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
isAdmin()
Check if user has admin access (approve, may edit & deactivate all postings)
This class represents a non editable value in a property form.
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
Class ilObjStyleSheetGUI.
setSettingsSubTabs($a_active)
__construct(Container $dic, ilPlugin $plugin)
Handles general notification settings, see e.g.
static _getPersonalPicturePath( $a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
insertHeaderAction($a_list_gui)
Insert header action into main template.
initCreationForms($a_new_type)
initHeaderAction($sub_type=null, $sub_id=null, $a_is_preview=false)
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
prepareOutput($a_show_subobjects=true)
getPreviousPosting($a_items)
Get previous posting.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
getObjectService()
Get object service.
getLatestMonth($a_items)
Get next month.
List all contributors members of a blog.
addHeaderActionForCommand($a_cmd)
afterSave(ilObject $a_new_object)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
renderToolbarNavigation($a_items, $single_posting=false)
Toolbar navigation.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Confirmation screen class.
renderNavigation($a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation blocks.
getHTML()
Return embeddable HTML chunk.
mayEditPosting($a_posting_id, $a_author_id=null)
Check if user may edit posting.