5 require_once
"./Services/Object/classes/class.ilObject2GUI.php";
6 require_once
"./Modules/Blog/classes/class.ilBlogPosting.php";
7 require_once
"./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php";
32 function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
36 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
41 $this->keyword = (string)
$_REQUEST[
"kwd"];
49 if(!$this->month || !$this->items[$this->month])
51 $this->month = array_keys($this->items);
52 $this->month = array_shift($this->month);
53 $this->month_default =
true;
57 $ilCtrl->setParameter($this,
"bmn", $this->month);
60 $lng->loadLanguageModule(
"blog");
61 $ilCtrl->saveParameter($this,
"prvm");
71 $forms = parent::initCreationForms($a_new_type);
73 if($this->id_type == self::WORKSPACE_NODE_ID)
75 unset($forms[self::CFORM_IMPORT]);
76 unset($forms[self::CFORM_CLONE]);
87 $ilCtrl->redirect($this,
"");
93 $this->tabs_gui->addSubTab(
"properties",
94 $this->lng->txt(
"blog_properties"),
95 $this->ctrl->getLinkTarget($this,
'edit'));
97 $this->tabs_gui->addSubTab(
"style",
98 $this->lng->txt(
"obj_sty"),
99 $this->ctrl->getLinkTarget($this,
'editStyleProperties'));
101 $this->tabs_gui->activateSubTab($a_active);
110 if($this->id_type == self::REPOSITORY_NODE_ID)
113 $appr->
setInfo($lng->txt(
"blog_enable_approval_info"));
120 if($ilSetting->get(
'enable_global_profiles'))
123 $rss->
setInfo($lng->txt(
"blog_enable_rss_info"));
131 $nav->setTitle($lng->txt(
"blog_settings_navigation"));
139 $opt->
setInfo($lng->txt(
"blog_nav_mode_month_list_info"));
140 $nav_mode->addOption($opt);
142 $detail_num =
new ilNumberInputGUI($lng->txt(
"blog_nav_mode_month_list_num_detail"),
"nav_list_detail");
143 $detail_num->
setInfo($lng->txt(
"blog_nav_mode_month_list_num_detail_info"));
144 $detail_num->setRequired(
true);
145 $detail_num->setSize(3);
146 $detail_num->setMinValue(0);
147 $opt->addSubItem($detail_num);
149 $mon_num =
new ilNumberInputGUI($lng->txt(
"blog_nav_mode_month_list_num_month"),
"nav_list_mon");
150 $mon_num->
setInfo($lng->txt(
"blog_nav_mode_month_list_num_month_info"));
151 $mon_num->setSize(3);
152 $mon_num->setMinValue(1);
153 $opt->addSubItem($mon_num);
156 $opt->
setInfo($lng->txt(
"blog_nav_mode_month_single_info"));
157 $nav_mode->addOption($opt);
159 $order_options = array();
160 if($this->object->getOrder())
162 foreach($this->object->getOrder() as $item)
164 $order_options[] = $lng->txt(
"blog_".$item);
168 if(!in_array($lng->txt(
"blog_navigation"), $order_options))
170 $order_options[] = $lng->txt(
"blog_navigation");
173 if($this->id_type == self::REPOSITORY_NODE_ID)
175 if(!in_array($lng->txt(
"blog_authors"), $order_options))
177 $order_options[] = $lng->txt(
"blog_authors");
181 $auth->setInfo($lng->txt(
"blog_enable_nav_authors_info"));
186 $keyw->
setInfo($lng->txt(
"blog_enable_keywords_info"));
189 if(!in_array($lng->txt(
"blog_keywords"), $order_options))
191 $order_options[] = $lng->txt(
"blog_keywords");
196 $order->setValue(array_shift($order_options));
197 $order->setMulti(
true,
true,
false);
204 $pres->setTitle($lng->txt(
"blog_presentation_frame"));
210 if($this->id_type == self::REPOSITORY_NODE_ID)
212 $ppic->setInfo($lng->txt(
"blog_profile_picture_repository_info"));
216 if($blga_set->get(
"banner"))
218 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
221 $dimensions =
" (".$blga_set->get(
"banner_width").
"x".
222 $blga_set->get(
"banner_height").
")";
228 $file = $this->
object->getImageFullPath(
true);
246 $list->setTitle($lng->txt(
"blog_presentation_overview"));
249 $post_num =
new ilNumberInputGUI($lng->txt(
"blog_list_num_postings"),
"ov_list_post_num");
250 $post_num->
setInfo($lng->txt(
"blog_list_num_postings_info"));
251 $post_num->setSize(3);
252 $post_num->setMinValue(1);
253 $post_num->setRequired(
true);
257 $a_form->
addItem($abs_shorten);
259 $abs_shorten_len =
new ilNumberInputGUI($lng->txt(
"blog_abstract_shorten_length"),
"abssl");
261 $abs_shorten_len->setRequired(
true);
262 $abs_shorten_len->setSuffix($lng->txt(
"blog_abstract_shorten_characters"));
263 $abs_shorten_len->setMinValue(50,
true);
264 $abs_shorten->addSubItem($abs_shorten_len);
267 $abs_img->
setInfo($lng->txt(
"blog_abstract_image_info"));
270 $abs_img_width =
new ilNumberInputGUI($lng->txt(
"blog_abstract_image_width"),
"absiw");
272 $abs_img_width->setRequired(
true);
273 $abs_img_width->setSuffix($lng->txt(
"blog_abstract_image_pixels"));
274 $abs_img_width->setMinValue(32,
true);
275 $abs_img->addSubItem($abs_img_width);
277 $abs_img_height =
new ilNumberInputGUI($lng->txt(
"blog_abstract_image_height"),
"absih");
279 $abs_img_height->setRequired(
true);
280 $abs_img_height->setSuffix($lng->txt(
"blog_abstract_image_pixels"));
281 $abs_img_height->setMinValue(32,
true);
282 $abs_img->addSubItem($abs_img_height);
287 if($this->id_type == self::REPOSITORY_NODE_ID)
289 $a_values[
"approval"] = $this->
object->hasApproval();
290 $a_values[
"nav_authors"] = $this->
object->hasAuthors();
292 $a_values[
"keywords"] = $this->
object->hasKeywords();
293 $a_values[
"notes"] = $this->
object->getNotesStatus();
294 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
299 $a_values[
"banner"] = $this->
object->getImage();
300 $a_values[
"rss"] = $this->
object->hasRSS();
301 $a_values[
"abss"] = $this->
object->hasAbstractShorten();
302 $a_values[
"absi"] = $this->
object->hasAbstractImage();
303 $a_values[
"nav"] = $this->
object->getNavMode();
304 $a_values[
"nav_list_detail"] = $this->
object->getNavModeListPostings();
305 $a_values[
"nav_list_mon"] = $this->
object->getNavModeListMonths();
306 $a_values[
"ov_list_post_num"] = $this->
object->getOverviewPostings();
318 if($this->id_type == self::REPOSITORY_NODE_ID)
320 $this->
object->setApproval($a_form->
getInput(
"approval"));
321 $this->
object->setAuthors($a_form->
getInput(
"nav_authors"));
323 $this->
object->setKeywords($a_form->
getInput(
"keywords"));
324 $this->
object->setNotesStatus($a_form->
getInput(
"notes"));
325 $this->
object->setProfilePicture($a_form->
getInput(
"ppic"));
330 $this->
object->setRSS($a_form->
getInput(
"rss"));
331 $this->
object->setAbstractShorten($a_form->
getInput(
"abss"));
332 $this->
object->setAbstractShortenLength($a_form->
getInput(
"abssl"));
333 $this->
object->setAbstractImage($a_form->
getInput(
"absi"));
334 $this->
object->setAbstractImageWidth($a_form->
getInput(
"absiw"));
335 $this->
object->setAbstractImageHeight($a_form->
getInput(
"absih"));
336 $this->
object->setNavMode($a_form->
getInput(
"nav"));
337 $this->
object->setNavModeListPostings($a_form->
getInput(
"nav_list_detail"));
338 $this->
object->setNavModeListMonths($a_form->
getInput(
"nav_list_mon"));
339 $this->
object->setOverviewPostings($a_form->
getInput(
"ov_list_post_num"));
341 $order = $a_form->
getInput(
"order");
342 foreach($order as $idx => $value)
344 if($value == $lng->txt(
"blog_navigation"))
346 $order[$idx] =
"navigation";
348 else if($value == $lng->txt(
"blog_keywords"))
350 $order[$idx] =
"keywords";
354 $order[$idx]=
"authors";
357 $this->
object->setOrder($order);
363 if($_FILES[
"banner"][
"tmp_name"])
365 $this->
object->uploadImage($_FILES[
"banner"]);
367 else if($banner->getDeletionFlag())
369 $this->
object->deleteImage();
376 global
$lng, $ilHelp;
378 if($this->id_type == self::WORKSPACE_NODE_ID)
380 $this->ctrl->setParameter($this,
"wsp_id",$this->node_id);
383 $ilHelp->setScreenIdComponent(
"blog");
387 $this->tabs_gui->addTab(
"content",
388 $lng->txt(
"content"),
389 $this->ctrl->getLinkTarget($this,
""));
394 $this->tabs_gui->addTab(
"id_info",
395 $lng->txt(
"info_short"),
396 $this->ctrl->getLinkTargetByClass(array(
"ilobjbloggui",
"ilinfoscreengui"),
"showSummary"));
401 $this->tabs_gui->addTab(
"settings",
402 $lng->txt(
"settings"),
403 $this->ctrl->getLinkTarget($this,
"edit"));
405 if($this->id_type == self::REPOSITORY_NODE_ID)
407 $this->tabs_gui->addTab(
"contributors",
408 $lng->txt(
"blog_contributors"),
409 $this->ctrl->getLinkTarget($this,
"contributors"));
412 if($this->id_type == self::REPOSITORY_NODE_ID)
414 $this->tabs_gui->addTab(
"export",
416 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
422 $this->tabs_gui->addNonTabbedLink(
"preview", $lng->txt(
"blog_preview"),
423 $this->ctrl->getLinkTarget($this,
"preview"));
437 $page_id = (int)
$_GET[
"gtp"];
438 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
442 $ilCtrl->setCmdClass(
"ilblogpostinggui");
443 $_GET[
"blpg"] = $page_id;
444 $ilCtrl->setCmd(
"previewFullscreen");
452 $next_class = $ilCtrl->getNextClass($this);
453 $cmd = $ilCtrl->getCmd();
455 if($this->id_type == self::REPOSITORY_NODE_ID)
457 $tpl->getStandardTemplate();
463 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"frameset");
464 $ilNavigationHistory->addItem($this->node_id, $link,
"blog");
470 case 'ilblogpostinggui':
472 if($this->id_type == self::REPOSITORY_NODE_ID)
478 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
481 $ilTabs->setBackTarget($lng->txt(
"back"),
482 $ilCtrl->getLinkTarget($this,
""));
485 $this->object->getStyleSheetId(),
"blog");
487 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
492 ($this->object->getNotesStatus() && !$this->disable_notes),
500 case "previewFullscreen":
501 $ilCtrl->setParameter($this,
"prvm",
"fsc");
505 case "previewEmbedded":
506 $ilCtrl->setParameter($this,
"prvm",
"emb");
513 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$_GET[
"blpg"]);
514 $this->tabs_gui->addNonTabbedLink(
"preview", $lng->txt(
"blog_preview"),
515 $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"previewFullscreen"));
516 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
"");
520 $ret = $ilCtrl->forwardCommand($bpost_gui);
526 $cmd =
"preview".(($_REQUEST[
"prvm"] ==
"fsc") ?
"Fullscreen" :
"Embedded");
531 $is_active = $bpost_gui->getBlogPosting()->getActive();
534 if((
$cmd ==
"previewFullscreen" ||
$cmd ==
"previewEmbedded")
535 && !$is_owner && !$is_active)
537 $this->ctrl->redirect($this,
"preview");
543 case "previewFullscreen":
551 case "previewEmbedded":
563 if($this->id_type == self::WORKSPACE_NODE_ID)
565 $info[] = $lng->txt(
"blog_draft_info");
569 $info[] = $lng->txt(
"blog_draft_info_contributors");
572 if(
$cmd !=
"history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText())
574 $info[] = $lng->txt(
"blog_new_posting_info");
576 if($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved())
579 $info[] = $lng->txt(
"blog_posting_edit_approval_info");
581 if(
sizeof(
$info) && !$tpl->hasMessage(
"info"))
587 $tpl->setContent(
$ret);
589 $tpl->setRightContent($nav);
595 case "ilinfoscreengui":
605 case "ilcommonactiondispatchergui":
606 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
608 $this->ctrl->forwardCommand($gui);
611 case "ilpermissiongui":
613 $ilTabs->activateTab(
"id_permissions");
614 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
616 $this->ctrl->forwardCommand($perm_gui);
619 case "ilobjectcopygui":
620 include_once
"./Services/Object/classes/class.ilObjectCopyGUI.php";
622 $cp->setType(
"blog");
623 $this->ctrl->forwardCommand($cp);
626 case 'ilrepositorysearchgui':
628 $ilTabs->activateTab(
"contributors");
629 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
631 $rep_search->setTitle($this->lng->txt(
"blog_add_contributor"));
632 $rep_search->setCallback($this,
'addContributor',$this->object->getAllLocalRoles($this->node_id));
633 $this->ctrl->setReturn($this,
'contributors');
634 $ret =& $this->ctrl->forwardCommand($rep_search);
639 $ilTabs->activateTab(
"export");
640 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
642 $exp_gui->addFormat(
"xml");
643 $exp_gui->addFormat(
"html", null, $this,
"buildExportFile");
644 $ret = $ilCtrl->forwardCommand($exp_gui);
647 case "ilobjstylesheetgui":
648 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
649 $this->ctrl->setReturn($this,
"editStyleProperties");
650 $style_gui =
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
652 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
654 $style_gui->setCreationMode(
true);
657 if (
$cmd ==
"confirmedDelete")
659 $this->
object->setStyleSheetId(0);
660 $this->
object->update();
663 $ret = $this->ctrl->forwardCommand($style_gui);
665 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
668 $this->
object->setStyleSheetId($style_id);
669 $this->
object->update();
670 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
674 case "ilblogexercisegui":
675 $this->ctrl->setReturn($this,
"render");
676 include_once
"Modules/Blog/classes/class.ilBlogExerciseGUI.php";
678 $this->ctrl->forwardCommand($gui);
682 if(
$cmd !=
"gethtml")
685 if(
$cmd ==
"addToDesk" ||
$cmd ==
"removeFromDesk")
687 $this->{
$cmd.
"Object"}();
696 $ilCtrl->setCmd(
$cmd);
700 return parent::executeCommand();
713 $this->ctrl->setCmd(
"showSummary");
714 $this->ctrl->setCmdClass(
"ilinfoscreengui");
725 $ilTabs->activateTab(
"id_info");
729 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
732 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
735 if($this->id_type != self::WORKSPACE_NODE_ID)
737 $info->enablePrivateNotes();
746 $info->enableNewsEditing(
false);
750 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
752 if ($enable_internal_rss)
754 $info->setBlockProperty(
"news",
"settings",
true);
755 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
760 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
762 if($this->id_type == self::WORKSPACE_NODE_ID)
767 $this->ctrl->forwardCommand(
$info);
781 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
783 $posting->setTitle($title);
784 $posting->setBlogId($this->object->getId());
785 $posting->setActive(
false);
786 $posting->setAuthor($ilUser->getId());
790 $ilCtrl->setParameter($this,
"bmn", date(
"Y-m"));
792 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $posting->getId());
793 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"edit");
798 $ilCtrl->redirect($this,
"render");
818 $ilTabs->activateTab(
"content");
823 $ilToolbar->setFormAction($ilCtrl->getFormAction($this,
"createPosting"));
825 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
827 $ilToolbar->addStickyItem($title, $lng->txt(
"title"));
829 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
831 $button->setCaption(
"blog_add_posting");
832 $button->setCommand(
"createPosting");
833 $ilToolbar->addStickyItem($button);
836 $first = array_shift((array_keys($this->items)));
837 if($first != $this->month)
839 $ilToolbar->addSeparator();
841 $ilCtrl->setParameter($this,
"bmn", $first);
842 $url = $ilCtrl->getLinkTarget($this,
"");
843 $ilCtrl->setParameter($this,
"bmn", $this->month);
845 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
847 $button->setCaption(
"blog_show_latest");
848 $button->setUrl(
$url);
849 $ilToolbar->addButtonInstance($button);
853 include_once
"Modules/Blog/classes/class.ilBlogExerciseGUI.php";
869 $list = $this->
renderList($list_items,
"preview", null, $is_owner);
870 $nav = $this->
renderNavigation($this->items,
"render",
"preview", null, $is_owner);
875 $tpl->setContent($list);
876 $tpl->setRightContent($nav);
887 if($this->id_type == self::REPOSITORY_NODE_ID)
901 $list = $this->
renderList($list_items,
"previewEmbedded");
913 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage", (
int)
$_REQUEST[
"user_page"]);
914 $link = $ilCtrl->getLinkTargetByClass(array(
"ilportfoliopagegui",
"ilobjbloggui"),
"render");
915 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage",
"");
917 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
919 $btn->setCaption(sprintf($lng->txt(
"prtf_edit_embedded_blog"), $this->
object->getTitle()),
false);
921 $btn->setPrimary(
true);
923 $list = $btn->render();
940 $list_items = array();
943 foreach(
$items as $id => $item)
945 if($item[
"author"] == $this->author ||
946 (is_array($item[
"editors"]) && in_array($this->author, $item[
"editors"])))
948 $list_items[$id] = $item;
953 else if($this->keyword)
955 $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
959 $max = $this->
object->getOverviewPostings();
960 if($this->month_default && $max)
962 $list_items = array();
963 foreach($this->items as
$month => $postings)
965 foreach($postings as $id => $item)
967 if(!$a_show_inactive &&
972 $list_items[$id] = $item;
974 if(
sizeof($list_items) >= $max)
1009 $list = $this->
renderList($list_items,
"previewFullscreen");
1010 $nav = $this->
renderNavigation($this->items,
"preview",
"previewFullscreen");
1038 $wtpl =
new ilTemplate(
"tpl.blog_embedded.html",
true,
true,
"Modules/Blog");
1039 $wtpl->setVariable(
"VAL_LIST", $a_content);
1040 $wtpl->setVariable(
"VAL_NAVIGATION", $a_nav);
1041 return $wtpl->get();
1054 $owner = $this->
object->getOwner();
1056 $ilTabs->clearTargets();
1057 $ilLocator->clearItems();
1063 if($owner == $ilUser->getId())
1066 if($this->id_type == self::WORKSPACE_NODE_ID)
1068 $back =
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=".$this->node_id;
1073 $prvm =
$_GET[
"prvm"];
1074 $this->ctrl->setParameter($this,
"prvm",
"");
1077 $back = $this->ctrl->getLinkTarget($this,
"");
1081 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1082 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$_GET[
"blpg"]);
1083 $back = $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"preview");
1085 $this->ctrl->setParameter($this,
"prvm", $prvm);
1088 $back_caption = $this->lng->txt(
"blog_back_to_blog_owner");
1091 else if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
1094 if($this->id_type == self::WORKSPACE_NODE_ID)
1096 $back =
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner;
1101 $back = $this->ctrl->getLinkTarget($this,
"");
1102 $back_caption = $this->lng->txt(
"blog_back_to_blog_owner");
1108 $parent_id = $tree->getParentId($this->node_id);
1109 include_once
"Services/Link/classes/class.ilLink.php";
1116 $ilMainMenu->setTopBarBack($back, $back_caption);
1121 $this->ctrl->setParameter($this,
"bmn",
"");
1122 $tpl->setTitleUrl($this->ctrl->getLinkTarget($this,
"preview"));
1123 $this->ctrl->setParameter($this,
"bmn", $this->month);
1128 $tpl->setContent($a_content);
1129 $tpl->setRightContent($a_navigation);
1143 if($this->id_type != self::REPOSITORY_NODE_ID)
1146 $name = $name[
"lastname"].
", ".(
$t = $name[
"title"] ?
$t .
" " :
"").$name[
"firstname"];
1152 if($blga_set->get(
"banner"))
1154 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
1156 $banner_width = $blga_set->get(
"banner_width");
1157 $banner_height = $blga_set->get(
"banner_height");
1160 $banner = basename($banner);
1165 if($this->object->hasProfilePicture())
1168 if($this->id_type == self::REPOSITORY_NODE_ID)
1171 if(
$_GET[
"blpg"] && !$a_export)
1173 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
1175 $author_id = $post->getAuthor();
1181 $name = $name[
"lastname"].
", ".(
$t = $name[
"title"] ?
$t .
" " :
"").$name[
"firstname"];
1191 $ppic = basename($ppic);
1196 $a_tpl->resetHeaderBlock(
false);
1198 $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
1199 $a_tpl->setTitleIcon($ppic);
1200 $a_tpl->setTitle($this->object->getTitle());
1202 $a_tpl->setDescription($name);
1205 $a_tpl->setVariable(
"LOCATOR",
"");
1219 $author_found =
false;
1225 ($posting[
"author"] == $this->author ||
1226 (is_array($posting[
"editors"]) && in_array($this->author, $posting[
"editors"]))))
1228 $author_found =
true;
1235 if($this->author && !$author_found)
1237 $this->author = null;
1253 function renderList(array
$items, $a_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false, $a_export_directory = null)
1257 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1258 $wtpl =
new ilTemplate(
"tpl.blog_list.html",
true,
true,
"Modules/Blog");
1262 stristr($a_cmd,
"embedded"))
1268 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage", (
int)
$_REQUEST[
"user_page"]);
1269 $link = $ilCtrl->getLinkTargetByClass(array(
"ilportfoliopagegui",
"ilobjbloggui"),
"render");
1270 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage",
"");
1272 include_once
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
1274 $list->setListTitle($lng->txt(
"action"));
1276 sprintf($lng->txt(
"prtf_edit_embedded_blog"), $this->
object->getTitle()),
1287 $wtpl->setCurrentBlock(
"prtf_edit_bl");
1288 $wtpl->setVariable(
"PRTF_BLOG_EDIT", $list->getHTML());
1289 $wtpl->parseCurrentBlock();
1295 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
1298 foreach($items as $item)
1302 if(!$is_active && !$a_show_inactive)
1309 if(!$this->keyword && !$this->author)
1314 if(!$last_month || $last_month !=
$month)
1318 $wtpl->setCurrentBlock(
"month_bl");
1319 $wtpl->parseCurrentBlock();
1327 else if($this->author)
1329 include_once
"Services/User/classes/class.ilUserUtil.php";
1334 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1336 " ".substr(
$month, 0, 4);
1341 $wtpl->setVariable(
"TXT_CURRENT_MONTH", $title);
1344 if(!$a_link_template)
1346 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1347 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $item[
"id"]);
1348 $preview = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_cmd);
1356 $posting_edit = $this->
mayEditPosting($item[
"id"], $item[
"author"]);
1357 if(($posting_edit || $is_admin) && !$a_link_template && $a_cmd ==
"preview")
1359 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
1361 $alist->setId($item[
"id"]);
1362 $alist->setListTitle($lng->txt(
"actions"));
1364 if($is_active && $this->object->hasApproval() && !$item[
"approved"])
1368 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1369 $alist->addItem($lng->txt(
"blog_approve"),
"approve",
1370 $ilCtrl->getLinkTarget($this,
"approve"));
1371 $ilCtrl->setParameter($this,
"apid",
"");
1374 $wtpl->setVariable(
"APPROVAL", $lng->txt(
"blog_needs_approval"));
1379 $alist->addItem($lng->txt(
"edit_content"),
"edit",
1380 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit"));
1385 $alist->addItem($lng->txt(
"blog_toggle_draft"),
"deactivate",
1386 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deactivatePageToList"));
1390 $alist->addItem($lng->txt(
"blog_toggle_final"),
"activate",
1391 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"activatePageToList"));
1394 $alist->addItem($lng->txt(
"rename"),
"rename",
1395 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edittitle"));
1397 if($this->object->hasKeywords())
1399 $alist->addItem($lng->txt(
"blog_edit_keywords"),
"keywords",
1400 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords"));
1403 $alist->addItem($lng->txt(
"blog_edit_date"),
"editdate",
1404 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editdate"));
1405 $alist->addItem($lng->txt(
"delete"),
"delete",
1406 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen"));
1413 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1414 $alist->addItem($lng->txt(
"blog_toggle_draft_admin"),
"deactivate",
1415 $ilCtrl->getLinkTarget($this,
"deactivateAdmin"));
1416 $ilCtrl->setParameter($this,
"apid",
"");
1419 $alist->addItem($lng->txt(
"delete"),
"delete",
1420 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen"));
1423 $wtpl->setCurrentBlock(
"actions");
1424 $wtpl->setVariable(
"ACTION_SELECTOR", $alist->getHTML());
1425 $wtpl->parseCurrentBlock();
1429 if($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes)
1432 include_once(
"Services/Notes/classes/class.ilNote.php");
1436 if($a_cmd !=
"preview")
1438 $wtpl->setCurrentBlock(
"comments");
1439 $wtpl->setVariable(
"TEXT_COMMENTS", $lng->txt(
"blog_comments"));
1440 $wtpl->setVariable(
"URL_COMMENTS",
$preview);
1441 $wtpl->setVariable(
"COUNT_COMMENTS", $count);
1442 $wtpl->parseCurrentBlock();
1455 if($a_cmd !=
"preview" && $a_cmd !=
"previewEmbedded")
1457 if($this->id_type == self::WORKSPACE_NODE_ID)
1459 $goto = $this->
getAccessHandler()->getGotoLink($this->node_id, $this->obj_id,
"_".$item[
"id"]);
1463 include_once
"Services/Link/classes/class.ilLink.php";
1466 $wtpl->setCurrentBlock(
"permalink");
1467 $wtpl->setVariable(
"URL_PERMALINK", $goto);
1468 $wtpl->setVariable(
"TEXT_PERMALINK", $lng->txt(
"blog_permanent_link"));
1469 $wtpl->parseCurrentBlock();
1473 $this->object->hasAbstractShorten(),
1474 $this->
object->getAbstractShortenLength(),
1476 $this->
object->hasAbstractImage(),
1477 $this->
object->getAbstractImageWidth(),
1478 $this->
object->getAbstractImageHeight(),
1479 $a_export_directory);
1483 $wtpl->setCurrentBlock(
"more");
1484 $wtpl->setVariable(
"URL_MORE",
$preview);
1485 $wtpl->setVariable(
"TEXT_MORE", $lng->txt(
"blog_list_more"));
1486 $wtpl->parseCurrentBlock();
1489 $wtpl->setCurrentBlock(
"posting");
1493 $wtpl->setVariable(
"DRAFT_CLASS",
" ilBlogListItemDraft");
1497 if($this->id_type == self::REPOSITORY_NODE_ID)
1501 $author_id = $item[
"author"];
1504 include_once
"Services/User/classes/class.ilUserUtil.php";
1508 if(is_array($item[
"editors"]))
1510 foreach($item[
"editors"] as $editor_id)
1518 $author = implode(
", ", $authors).
" - ";
1523 $wtpl->setVariable(
"URL_TITLE",
$preview);
1524 $wtpl->setVariable(
"TITLE", $item[
"title"]);
1525 $wtpl->setVariable(
"DATETIME",
$author.
1529 $wtpl->setVariable(
"CONTENT", $snippet);
1531 $wtpl->parseCurrentBlock();
1535 if($a_cmd ==
"previewFullscreen")
1537 $this->tpl->setPermanentLink(
"blog", $this->node_id,
1538 ($this->id_type == self::WORKSPACE_NODE_ID)
1543 if(!$is_empty || $a_show_inactive)
1545 return $wtpl->get();
1559 protected function renderNavigationByDate(array $a_items, $a_list_cmd =
"render", $a_posting_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false)
1564 foreach($a_items as
$month => $postings)
1566 foreach(array_keys($postings) as $id)
1569 if(!$a_show_inactive && !$active)
1571 unset($a_items[
$month][$id]);
1575 $a_items[
$month][$id][
"active"] = $active;
1578 if(!
sizeof($a_items[
$month]))
1580 unset($a_items[$month]);
1587 $max_detail_postings = $this->
object->getNavModeListPostings();
1588 $max_months = $this->
object->getNavModeListMonths();
1590 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_by_date.html",
true,
true,
"Modules/Blog");
1592 $ilCtrl->setParameter($this,
"blpg",
"");
1594 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1595 $counter = $mon_counter = $last_year = 0;
1596 foreach($a_items as
$month => $postings)
1598 if(!$a_link_template && $max_months && $mon_counter >= $max_months)
1604 $year = substr(
$month, 0, 4);
1605 if(!$last_year || $year != $last_year)
1616 if(!$a_link_template)
1618 $ilCtrl->setParameter($this,
"bmn",
$month);
1619 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1627 if($counter < $max_detail_postings)
1631 $wtpl->setCurrentBlock(
"navigation_year_details");
1632 $wtpl->setVariable(
"YEAR", $year);
1633 $wtpl->parseCurrentBlock();
1636 foreach($postings as $id => $posting)
1638 if($max_detail_postings && $counter >= $max_detail_postings)
1648 if(!$a_link_template)
1650 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
$month);
1651 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $id);
1652 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1659 if(!$posting[
"active"])
1661 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
1663 else if($this->object->hasApproval() && !$posting[
"approved"])
1665 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
1668 $wtpl->setCurrentBlock(
"navigation_item");
1669 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1670 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1671 $wtpl->parseCurrentBlock();
1674 $wtpl->setCurrentBlock(
"navigation_month_details");
1675 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1676 $wtpl->setVariable(
"URL_MONTH", $month_url);
1677 $wtpl->parseCurrentBlock();
1684 $wtpl->setCurrentBlock(
"navigation_year");
1685 $wtpl->setVariable(
"YEAR", $year);
1686 $wtpl->parseCurrentBlock();
1689 $wtpl->setCurrentBlock(
"navigation_month");
1690 $wtpl->setVariable(
"MONTH_NAME", $month_name);
1691 $wtpl->setVariable(
"URL_MONTH", $month_url);
1692 $wtpl->setVariable(
"MONTH_COUNT",
sizeof($postings));
1693 $wtpl->parseCurrentBlock();
1697 $ilCtrl->setParameter($this,
"bmn", $this->month);
1698 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1700 return $wtpl->get();
1705 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_month.html",
true,
true,
"Modules/Blog");
1707 $ilCtrl->setParameter($this,
"blpg",
"");
1709 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1710 $month_options = array();
1711 foreach($a_items as
$month => $postings)
1714 " ".substr(
$month, 0, 4);
1716 $month_options[
$month] = $month_name;
1718 if(
$month == $this->month)
1720 if(!$a_link_template)
1722 $ilCtrl->setParameter($this,
"bmn",
$month);
1723 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1730 foreach($postings as $id => $posting)
1735 if(!$a_link_template)
1737 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
$month);
1738 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $id);
1739 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1746 if(!$posting[
"active"])
1748 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
1750 else if($this->object->hasApproval() && !$posting[
"approved"])
1752 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
1755 $wtpl->setCurrentBlock(
"navigation_item");
1756 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1757 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1758 $wtpl->parseCurrentBlock();
1761 $wtpl->setCurrentBlock(
"navigation_month_details");
1764 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1765 $wtpl->setVariable(
"URL_MONTH", $month_url);
1767 $wtpl->parseCurrentBlock();
1773 $wtpl->setCurrentBlock(
"option_bl");
1774 foreach($month_options as $value => $caption)
1776 $wtpl->setVariable(
"OPTION_VALUE", $value);
1777 $wtpl->setVariable(
"OPTION_CAPTION", $caption);
1778 if($value == $this->month)
1780 $wtpl->setVariable(
"OPTION_SEL",
' selected="selected"');
1782 $wtpl->parseCurrentBlock();
1785 $wtpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this, $a_list_cmd));
1788 $ilCtrl->setParameter($this,
"bmn", $this->month);
1789 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1791 return $wtpl->get();
1809 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_keywords.html",
true,
true,
"Modules/Blog");
1811 $max = max($keywords);
1812 include_once
"Services/Tagging/classes/class.ilTagging.php";
1814 $wtpl->setCurrentBlock(
"keyword");
1815 foreach($keywords as
$keyword => $counter)
1817 if(!$a_link_template)
1819 $ilCtrl->setParameter($this,
"kwd", urlencode(
$keyword));
1820 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1821 $ilCtrl->setParameter($this,
"kwd",
"");
1828 $wtpl->setVariable(
"TXT_KEYWORD",
$keyword);
1830 $wtpl->setVariable(
"URL_KEYWORD",
$url);
1831 $wtpl->parseCurrentBlock();
1834 return $wtpl->get();
1851 $authors[] = $item[
"author"];
1854 if(is_array($item[
"editors"]))
1856 foreach($item[
"editors"] as $editor_id)
1858 if($editor_id != $item[
"author"])
1860 $authors[] = $editor_id;
1868 $authors = array_unique($authors);
1869 if(
sizeof($authors) > 1)
1871 include_once
"Services/User/classes/class.ilUserUtil.php";
1874 foreach($authors as $user_id)
1878 $ilCtrl->setParameter($this,
"ath", $user_id);
1879 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1880 $ilCtrl->setParameter($this,
"ath",
"");
1883 $idx = trim(strip_tags($name)).
"///".$user_id;
1884 $list[$idx] = array($name,
$url);
1889 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_authors.html",
true,
true,
"Modules/Blog");
1891 $wtpl->setCurrentBlock(
"author");
1894 $wtpl->setVariable(
"TXT_AUTHOR", $author[0]);
1895 $wtpl->setVariable(
"URL_AUTHOR", $author[1]);
1896 $wtpl->parseCurrentBlock();
1899 return $wtpl->get();
1913 function renderNavigation(array $a_items, $a_list_cmd =
"render", $a_posting_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false)
1917 if($this->object->getOrder())
1919 $order = array_flip($this->object->getOrder());
1930 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation.html",
true,
true,
"Modules/Blog");
1935 if(
sizeof($a_items))
1937 $blocks[$order[
"navigation"]] = array(
1938 $this->lng->txt(
"blog_navigation"),
1943 if($this->object->hasKeywords())
1946 $may_edit_keywords = (
$_GET[
"blpg"] &&
1948 $a_list_cmd !=
"preview" &&
1949 $a_list_cmd !=
"gethtml" &&
1952 if($keywords || $may_edit_keywords)
1956 $keywords = $this->lng->txt(
"blog_no_keywords");
1959 if($may_edit_keywords)
1961 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$_GET[
"blpg"]);
1962 $cmd = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords");
1963 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
"");
1965 $blocks[$order[
"keywords"]] = array(
1966 $this->lng->txt(
"blog_keywords"),
1969 ? array(
$cmd, $this->lng->txt(
"blog_edit_keywords"))
1976 if(!$a_link_template)
1979 if($this->id_type == self::REPOSITORY_NODE_ID &&
1980 $this->object->hasAuthors())
1985 $blocks[$order[
"authors"]] = array($this->lng->txt(
"blog_authors"), $authors);
1990 if($this->object->hasRSS() &&
1991 $ilSetting->get(
'enable_global_profiles') &&
1992 $a_list_cmd ==
"preview")
1996 if($this->id_type != self::WORKSPACE_NODE_ID)
2000 $url = ILIAS_HTTP_PATH.
"/feed.php?blog_id=".$blog_id.
2001 "&client_id=".rawurlencode(CLIENT_ID);
2003 include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
2010 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
2013 foreach($blocks as $block)
2018 $panel->setHeading($block[0]);
2019 $panel->setBody($block[1]);
2021 if(isset($block[2]) && is_array($block[2]))
2023 $panel->setFooter(
'<a href="'.$block[2][0].
'">'.$block[2][1].
'</a>');
2026 $wtpl->setCurrentBlock(
"block_bl");
2027 $wtpl->setVariable(
"BLOCK", $panel->getHTML());
2028 $wtpl->parseCurrentBlock();
2032 return $wtpl->get();
2044 $keywords = array();
2045 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
2072 foreach($keywords as
$keyword => $counter)
2074 $tmp[] = array(
"keyword"=>
$keyword,
"counter"=>$counter);
2078 $keywords = array();
2079 foreach($tmp as $item)
2081 $keywords[$item[
"keyword"]] = $item[
"counter"];
2094 include_once(
"./Services/Export/classes/class.ilExport.php");
2098 $subdir = $this->
object->getType().
"_".$this->
object->getId();
2099 $export_dir = $exp_dir.
"/".$subdir;
2106 include_once(
"./Services/Style/classes/class.ilSystemStyleHTMLExport.php");
2108 $this->sys_style_html_export->addImage(
"icon_blog.svg");
2109 $this->sys_style_html_export->export();
2112 include_once(
"./Services/COPage/classes/class.ilCOPageHTMLExport.php");
2114 $this->co_page_html_export->setContentStyleId($this->object->getStyleSheetId());
2115 $this->co_page_html_export->createDirectories();
2116 $this->co_page_html_export->exportStyles();
2117 $this->co_page_html_export->exportSupportScripts();
2121 if($blga_set->get(
"banner"))
2123 $banner = $this->
object->getImageFullPath();
2126 copy($banner, $export_dir.
"/".basename($banner));
2132 $ppic = array_shift(explode(
"?", $ppic));
2133 copy($ppic, $export_dir.
"/".basename($ppic));
2145 "/".$date.
"__".IL_INST_ID.
"__".
2146 $this->object->getType().
"_".$this->
object->getId().
".zip";
2163 function exportHTMLPages($a_target_directory, $a_link_template = null, $a_tpl_callback = null, $a_co_page_html_export = null, $a_index_name =
"index.html")
2165 if(!$a_link_template)
2167 $a_link_template =
"bl{TYPE}_{ID}.html";
2170 if($a_co_page_html_export)
2172 $this->co_page_html_export = $a_co_page_html_export;
2183 foreach(array_keys($this->items) as
$month)
2186 $list = $this->
renderList($this->items[$month],
"render", $a_link_template,
false, $a_target_directory);
2193 if(!$a_tpl_callback)
2199 $tpl = call_user_func($a_tpl_callback);
2207 copy(
$file, $a_target_directory.
"/".$a_index_name);
2216 $list_items = $this->filterItemsByKeyword($this->items, $keyword);
2217 $list = $this->
renderList($list_items,
"render", $a_link_template,
false, $a_target_directory);
2224 if(!$a_tpl_callback)
2230 $tpl = call_user_func($a_tpl_callback);
2241 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
2242 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2244 foreach ($pages as $page)
2248 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
2250 $blp_gui->setOutputMode(
"offline");
2251 $blp_gui->setFullscreenLink(
"fullscreen.html");
2252 $blp_gui->add_date =
true;
2253 $page_content = $blp_gui->showPage();
2256 substr($page[
"created"]->
get(
IL_CAL_DATE), 0, 7));
2260 if(!$a_tpl_callback)
2266 $tpl = call_user_func($a_tpl_callback);
2270 $_GET[
"blpg"] = $page[
"id"];
2272 $_GET[
"blpg"] = null;
2275 $page_content, $nav, $back);
2277 $this->co_page_html_export->collectPageElements(
"blp:pg", $page[
"id"]);
2280 $this->co_page_html_export->exportPageElements();
2301 if(!self::$keyword_export_map)
2303 self::$keyword_export_map = array_flip(array_keys($this->
getKeywords(
false)));
2305 $a_id = self::$keyword_export_map[$a_id];
2314 $link = str_replace(
"{TYPE}", $a_type, $a_template);
2315 return str_replace(
"{ID}", $a_id, $link);
2326 global $ilTabs,
$lng;
2328 $tpl = $this->co_page_html_export->getPreparedMainTemplate();
2330 $tpl->getStandardTemplate();
2332 $ilTabs->clearTargets();
2335 $ilTabs->setBackTarget($lng->txt(
"back"), $a_back_url);
2353 protected function writeExportFile($a_target_directory, $a_file, $a_tpl, $a_content, $a_right_content = null, $a_back = null)
2355 $file = $a_target_directory.
"/".$a_file;
2357 if (@is_file(
$file))
2363 $ep_tpl =
new ilTemplate(
"tpl.export_page.html",
true,
true,
2367 $ep_tpl->setVariable(
"PAGE_CONTENT", $a_content);
2371 $ep_tpl->setVariable(
"LIST", $a_content);
2374 $a_tpl->setContent($ep_tpl->get());
2378 if($a_right_content)
2380 $a_tpl->setRightContent($a_right_content);
2381 unset($a_right_content);
2384 $content = $a_tpl->get(
"DEFAULT",
false,
false,
false,
2388 if (!file_put_contents(
$file, $content))
2390 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
2391 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
2411 $this->disable_notes = (bool)$a_value;
2419 if($a_cmd ==
"preview" || $a_cmd ==
"previewFullscreen" ||
$_GET[
"prvm"])
2422 if($ilUser->getId() != ANONYMOUS_USER_ID)
2426 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2431 $ilCtrl->setParameter($this,
"prvm",
"");
2437 return parent::addHeaderAction();
2450 $sub_type = $sub_id = null;
2454 $sub_id =
$_GET[
"blpg"];
2457 $lg = parent::initHeaderAction($sub_type, $sub_id);
2461 $lg->enableComments(
false);
2462 $lg->enableNotes(
false);
2463 $lg->enableTags(
false);
2465 include_once
"./Services/Notification/classes/class.ilNotification.php";
2468 $ilCtrl->setParameter($this,
"ntf", 1);
2469 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
2470 $ilCtrl->setParameter($this,
"ntf",
"");
2471 $lg->addCustomCommand($link,
"blog_notification_toggle_off");
2473 $lg->addHeaderIcon(
"not_icon",
2475 $this->lng->txt(
"blog_notification_activated"));
2479 $ilCtrl->setParameter($this,
"ntf", 2);
2480 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
2481 $ilCtrl->setParameter($this,
"ntf",
"");
2482 $lg->addCustomCommand($link,
"blog_notification_toggle_on");
2484 $lg->addHeaderIcon(
"not_icon",
2486 $this->lng->txt(
"blog_notification_deactivated"));
2492 $ilCtrl->setParameter($this,
"prvm",
"");
2494 $ilCtrl->setParameter($this,
"bmn",
"");
2495 $ilCtrl->setParameter($this,
"blpg",
"");
2496 $link = $ilCtrl->getLinkTarget($this,
"");
2497 $ilCtrl->setParameter($this,
"blpg", $sub_id);
2498 $ilCtrl->setParameter($this,
"bmn", $this->month);
2499 $lg->addCustomCommand($link,
"blog_edit");
2503 $link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
2504 $lg->addCustomCommand($link,
"blog_edit_posting");
2507 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2510 $ilCtrl->setParameter($this,
"ntf",
"");
2520 include_once
"./Services/Notification/classes/class.ilNotification.php";
2521 switch(
$_GET[
"ntf"])
2532 $ilCtrl->redirect($this,
"preview");
2545 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2547 if($post->getBlogId() == $a_blog_id)
2549 return $post->getTitle();
2560 foreach($this->items as
$month => $postings)
2562 foreach($postings as $id => $item)
2566 unset($this->items[
$month][$id]);
2568 else if($this->object->hasApproval() && !$item[
"approved"])
2570 unset($this->items[
$month][$id]);
2573 if(!
sizeof($this->items[
$month]))
2575 unset($this->items[$month]);
2579 if($this->items && !isset($this->items[$this->month]))
2581 $this->month = array_shift(array_keys($this->items));
2588 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
2593 if(in_array($a_keyword,
2626 if($this->id_type == self::WORKSPACE_NODE_ID)
2645 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2647 $a_author_id = $post->getAuthor();
2649 if($ilUser->getId() == $a_author_id)
2671 if($this->id_type == self::WORKSPACE_NODE_ID)
2684 if (is_object($this->
object))
2686 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$this->node_id);
2694 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2696 $post->setApproved(
true);
2697 $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2698 $post->update(
true,
false,
true,
"new");
2703 $this->ctrl->redirect($this,
"render");
2720 $ilTabs->activateTab(
"contributors");
2722 $local_roles = $this->
object->getAllLocalRoles($this->node_id);
2725 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
2730 'auto_complete_name' => $lng->txt(
'user'),
2731 'submit_name' => $lng->txt(
'add'),
2732 'add_search' =>
true,
2734 'user_type' => $local_roles
2739 $other_roles = $this->
object->getRolesWithContributeOrRedact($this->node_id);
2742 ilUtil::sendInfo(sprintf($lng->txt(
"blog_contribute_other_roles"), implode(
", ", $other_roles)));
2745 include_once
"Modules/Blog/classes/class.ilContributorTableGUI.php";
2748 $tpl->setContent(
$tbl->getHTML());
2758 if(!strlen(trim(
$_POST[
'user_login'])))
2763 $users = explode(
',',
$_POST[
'user_login']);
2765 $user_ids = array();
2766 foreach($users as $user)
2776 $user_ids[] = $user_id;
2796 if(!count($a_user_ids) || !$a_user_type)
2803 $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2804 if(!in_array($a_user_type, $local_roles))
2810 foreach($a_user_ids as $user_id)
2812 if(!$rbacreview->isAssigned($user_id, $a_user_type))
2814 $rbacadmin->assignUser($a_user_type, $user_id);
2819 $ilCtrl->redirect($this,
"contributors");
2832 $this->ctrl->redirect($this,
"contributors");
2835 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
2837 $confirm->setHeaderText($this->lng->txt(
'blog_confirm_delete_contributors'));
2838 $confirm->setFormAction($this->ctrl->getFormAction($this,
'removeContributor'));
2839 $confirm->setConfirm($this->lng->txt(
'delete'),
'removeContributor');
2840 $confirm->setCancel($this->lng->txt(
'cancel'),
'contributors');
2842 include_once
'Services/User/classes/class.ilUserUtil.php';
2844 foreach($ids as $user_id)
2846 $confirm->addItem(
'id[]', $user_id,
2850 $this->tpl->setContent($confirm->getHTML());
2865 $ilCtrl->redirect($this,
"contributors");
2869 $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2876 foreach($ids as $user_id)
2878 foreach($local_roles as $role_id)
2880 $rbacadmin->deassignUser($role_id, $user_id);
2885 $this->ctrl->redirect($this,
"contributors");
2895 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
2907 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
2917 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2919 $post->setApproved(
false);
2920 $post->setActive(
false);
2921 $post->update(
true,
false,
false);
2926 $this->ctrl->redirect($this,
"render");
2947 $ctpl->setCurrentBlock(
"ContentStyle");
2948 $ctpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2950 $ctpl->parseCurrentBlock();
2957 $this->tabs_gui->activateTab(
"settings");
2961 $this->tpl->setContent($form->getHTML());
2968 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
2969 $this->lng->loadLanguageModule(
"style");
2971 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2974 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
2975 $style_id = $this->
object->getStyleSheetId();
2977 if ($fixed_style > 0)
2981 $this->lng->txt(
"global_fixed").
")");
2982 $form->addItem($st);
2989 $st_styles[0] = $this->lng->txt(
"default");
2999 $form->addItem($st);
3002 $form->addCommandButton(
"editStyle", $this->lng->txt(
"style_edit_style"));
3003 $form->addCommandButton(
"deleteStyle", $this->lng->txt(
"style_delete_style"));
3012 $style_sel->setValue($style_id);
3013 $form->addItem($style_sel);
3015 $form->addCommandButton(
"saveStyleSettings", $this->lng->txt(
"save"));
3016 $form->addCommandButton(
"createStyle", $this->lng->txt(
"sty_create_ind_style"));
3020 $form->setTitle($this->lng->txt(
"blog_style"));
3021 $form->setFormAction($this->ctrl->getFormAction($this));
3028 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"create");
3033 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
3038 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
3045 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3046 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
3048 || $this->object->getStyleSheetId() == 0))
3051 $this->
object->update();
3055 $this->ctrl->redirect($this,
"editStyleProperties");
3065 if(substr($a_target, -3) ==
"wsp")
3067 $id = explode(
"_", $a_target);
3069 $_GET[
"baseClass"] =
"ilSharedResourceGUI";
3070 $_GET[
"wsp_id"] = $id[0];
3071 if(
sizeof($id) == 3)
3073 $_GET[
"gtp"] = $id[1];
3078 $id = explode(
"_", $a_target);
3080 $_GET[
"baseClass"] =
"ilRepositoryGUI";
3081 $_GET[
"ref_id"] = $id[0];
3082 $_GET[
"cmd"] =
"preview";
3083 if(
sizeof($id) == 2)
3085 if(is_numeric($id[1]))
3087 $_GET[
"gtp"] = $id[1];
3096 include(
"ilias.php");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation blocks.
static _lookupName($a_user_id)
lookup user name
filterInactivePostings()
Filter inactive items from items list.
const ABSTRACT_DEFAULT_IMAGE_WIDTH
This class represents an option in a radio group.
addUserFromAutoComplete()
Autocomplete submit.
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.
_lookupOwner($a_id)
lookup object owner
renderFullscreenHeader($a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
setValue($a_value)
Set Value.
renderNavigationByDate(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation by date block.
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.
HTML export class for pages.
static _goto($a_target)
Deep link.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static 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.
Class ilObject Basic functions for all objects.
getPermanentLinkWidget($a_append=null, $a_center=false)
HTML export class for system styles.
initStylePropertiesForm()
_createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
Create export directory.
buildExportTemplate($a_back_url="")
Build export "frame".
static _lookupId($a_user_str)
Lookup id by login.
static _lookupTitle($a_id)
lookup object title
static getKeywords($a_obj_id, $a_posting_id)
export()
Build and deliver export file.
const ABSTRACT_DEFAULT_SHORTEN_LENGTH
static addToDesktop()
Add desktop item public.
setInfo($a_info)
Set Info.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
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)
_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)
get all notes related to a specific object
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.
Export User Interface Class.
checkPermission($a_perm, $a_cmd="")
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.
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)
Default behaviour is:
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.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
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.
special template class to simplify handling of ITX/PEAR
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.
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
_getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
render()
Render object context.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static signFile($path_to_file)
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
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 zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
createPosting()
Create new posting.
infoScreenForward()
show information screen
User interface class for advanced drop-down selection lists.
buildExportLink($a_template, $a_type, $a_id)
Build static export link.
removeContributor()
Used in ilContributorTableGUI.
static removeFromDesktop()
Remove item from personal desktop public.
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)
_lookupStandard($a_id)
Lookup standard flag.
static getInstance()
Get instance.
setContentStyleSheet($a_tpl=null)
renderNavigationByKeywords($a_list_cmd="render", $a_show_inactive=false, $a_link_template=false)
Build navigation by keywords block.
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.
getContentStylePath($a_style_id)
get content style path
static $keyword_export_map
Class ilObjStyleSheetGUI.
setSettingsSubTabs($a_active)
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)
const PANEL_STYLE_SECONDARY
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
const HEADING_STYLE_BLOCK
List all contributors members of a blog.
writeExportFile($a_target_directory, $a_file, $a_tpl, $a_content, $a_right_content=null, $a_back=null)
Write HTML to file.
static checkExercise($a_node_id)
addHeaderAction()
Add header action menu.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
afterSave(ilObject $a_new_object)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
getHTML()
Return embeddable HTML chunk.
exportHTMLPages($a_target_directory, $a_link_template=null, $a_tpl_callback=null, $a_co_page_html_export=null, $a_index_name="index.html")
Export all pages.
mayEditPosting($a_posting_id, $a_author_id=null)
Check if user may edit posting.