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";
30 function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
39 $this->keyword = (string)
$_REQUEST[
"kwd"];
47 if(!$this->month || !$this->items[$this->month])
49 $this->month = array_keys($this->items);
50 $this->month = array_shift($this->month);
51 $this->month_default =
true;
55 $ilCtrl->setParameter($this,
"bmn", $this->month);
58 $lng->loadLanguageModule(
"blog");
59 $ilCtrl->saveParameter($this,
"prvm");
71 if($this->id_type == self::WORKSPACE_NODE_ID)
73 unset($forms[self::CFORM_IMPORT]);
74 unset($forms[self::CFORM_CLONE]);
85 $ilCtrl->redirect($this,
"");
91 $this->tabs_gui->addSubTab(
"properties",
92 $this->lng->txt(
"blog_properties"),
93 $this->ctrl->getLinkTarget($this,
'edit'));
95 $this->tabs_gui->addSubTab(
"style",
96 $this->lng->txt(
"obj_sty"),
97 $this->ctrl->getLinkTarget($this,
'editStyleProperties'));
99 $this->tabs_gui->activateSubTab($a_active);
108 if($this->id_type == self::REPOSITORY_NODE_ID)
111 $appr->
setInfo($lng->txt(
"blog_enable_approval_info"));
118 if($ilSetting->get(
'enable_global_profiles'))
121 $rss->
setInfo($lng->txt(
"blog_enable_rss_info"));
129 $nav->setTitle($lng->txt(
"blog_settings_navigation"));
137 $opt->
setInfo($lng->txt(
"blog_nav_mode_month_list_info"));
138 $nav_mode->addOption($opt);
140 $detail_num =
new ilNumberInputGUI($lng->txt(
"blog_nav_mode_month_list_num_detail"),
"nav_list_detail");
141 $detail_num->
setInfo($lng->txt(
"blog_nav_mode_month_list_num_detail_info"));
142 $detail_num->setRequired(
true);
143 $detail_num->setSize(3);
144 $detail_num->setMinValue(0);
145 $opt->addSubItem($detail_num);
147 $mon_num =
new ilNumberInputGUI($lng->txt(
"blog_nav_mode_month_list_num_month"),
"nav_list_mon");
148 $mon_num->
setInfo($lng->txt(
"blog_nav_mode_month_list_num_month_info"));
149 $mon_num->setSize(3);
150 $mon_num->setMinValue(1);
151 $opt->addSubItem($mon_num);
154 $opt->
setInfo($lng->txt(
"blog_nav_mode_month_single_info"));
155 $nav_mode->addOption($opt);
157 $order_options = array();
158 if($this->object->getOrder())
160 foreach($this->object->getOrder() as $item)
162 $order_options[] = $lng->txt(
"blog_".$item);
166 if(!in_array($lng->txt(
"blog_navigation"), $order_options))
168 $order_options[] = $lng->txt(
"blog_navigation");
171 if($this->id_type == self::REPOSITORY_NODE_ID)
173 if(!in_array($lng->txt(
"blog_authors"), $order_options))
175 $order_options[] = $lng->txt(
"blog_authors");
179 $auth->setInfo($lng->txt(
"blog_enable_nav_authors_info"));
184 $keyw->
setInfo($lng->txt(
"blog_enable_keywords_info"));
187 if(!in_array($lng->txt(
"blog_keywords"), $order_options))
189 $order_options[] = $lng->txt(
"blog_keywords");
194 $order->setValue(array_shift($order_options));
195 $order->setMulti(
true,
true,
false);
202 $pres->setTitle($lng->txt(
"blog_presentation_frame"));
208 if($this->id_type == self::REPOSITORY_NODE_ID)
210 $ppic->setInfo($lng->txt(
"blog_profile_picture_repository_info"));
214 if($blga_set->get(
"banner"))
216 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
219 $dimensions =
" (".$blga_set->get(
"banner_width").
"x".
220 $blga_set->get(
"banner_height").
")";
226 $file = $this->
object->getImageFullPath(
true);
244 $list->setTitle($lng->txt(
"blog_presentation_overview"));
247 $post_num =
new ilNumberInputGUI($lng->txt(
"blog_list_num_postings"),
"ov_list_post_num");
248 $post_num->
setInfo($lng->txt(
"blog_list_num_postings_info"));
249 $post_num->setSize(3);
250 $post_num->setMinValue(1);
251 $post_num->setRequired(
true);
255 $a_form->
addItem($abs_shorten);
257 $abs_shorten_len =
new ilNumberInputGUI($lng->txt(
"blog_abstract_shorten_length"),
"abssl");
259 $abs_shorten_len->setRequired(
true);
260 $abs_shorten_len->setSuffix($lng->txt(
"blog_abstract_shorten_characters"));
261 $abs_shorten_len->setMinValue(50,
true);
262 $abs_shorten->addSubItem($abs_shorten_len);
265 $abs_img->
setInfo($lng->txt(
"blog_abstract_image_info"));
268 $abs_img_width =
new ilNumberInputGUI($lng->txt(
"blog_abstract_image_width"),
"absiw");
270 $abs_img_width->setRequired(
true);
271 $abs_img_width->setSuffix($lng->txt(
"blog_abstract_image_pixels"));
272 $abs_img_width->setMinValue(32,
true);
273 $abs_img->addSubItem($abs_img_width);
275 $abs_img_height =
new ilNumberInputGUI($lng->txt(
"blog_abstract_image_height"),
"absih");
277 $abs_img_height->setRequired(
true);
278 $abs_img_height->setSuffix($lng->txt(
"blog_abstract_image_pixels"));
279 $abs_img_height->setMinValue(32,
true);
280 $abs_img->addSubItem($abs_img_height);
285 if($this->id_type == self::REPOSITORY_NODE_ID)
287 $a_values[
"approval"] = $this->
object->hasApproval();
288 $a_values[
"nav_authors"] = $this->
object->hasAuthors();
290 $a_values[
"keywords"] = $this->
object->hasKeywords();
291 $a_values[
"notes"] = $this->
object->getNotesStatus();
292 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
297 $a_values[
"banner"] = $this->
object->getImage();
298 $a_values[
"rss"] = $this->
object->hasRSS();
299 $a_values[
"abss"] = $this->
object->hasAbstractShorten();
300 $a_values[
"absi"] = $this->
object->hasAbstractImage();
301 $a_values[
"nav"] = $this->
object->getNavMode();
302 $a_values[
"nav_list_detail"] = $this->
object->getNavModeListPostings();
303 $a_values[
"nav_list_mon"] = $this->
object->getNavModeListMonths();
304 $a_values[
"ov_list_post_num"] = $this->
object->getOverviewPostings();
316 if($this->id_type == self::REPOSITORY_NODE_ID)
318 $this->
object->setApproval($a_form->
getInput(
"approval"));
319 $this->
object->setAuthors($a_form->
getInput(
"nav_authors"));
321 $this->
object->setKeywords($a_form->
getInput(
"keywords"));
322 $this->
object->setNotesStatus($a_form->
getInput(
"notes"));
323 $this->
object->setProfilePicture($a_form->
getInput(
"ppic"));
328 $this->
object->setRSS($a_form->
getInput(
"rss"));
329 $this->
object->setAbstractShorten($a_form->
getInput(
"abss"));
330 $this->
object->setAbstractShortenLength($a_form->
getInput(
"abssl"));
331 $this->
object->setAbstractImage($a_form->
getInput(
"absi"));
332 $this->
object->setAbstractImageWidth($a_form->
getInput(
"absiw"));
333 $this->
object->setAbstractImageHeight($a_form->
getInput(
"absih"));
334 $this->
object->setNavMode($a_form->
getInput(
"nav"));
335 $this->
object->setNavModeListPostings($a_form->
getInput(
"nav_list_detail"));
336 $this->
object->setNavModeListMonths($a_form->
getInput(
"nav_list_mon"));
337 $this->
object->setOverviewPostings($a_form->
getInput(
"ov_list_post_num"));
339 $order = $a_form->
getInput(
"order");
340 foreach($order as $idx => $value)
342 if($value == $lng->txt(
"blog_navigation"))
344 $order[$idx] =
"navigation";
346 else if($value == $lng->txt(
"blog_keywords"))
348 $order[$idx] =
"keywords";
352 $order[$idx]=
"authors";
355 $this->
object->setOrder($order);
361 if($_FILES[
"banner"][
"tmp_name"])
363 $this->
object->uploadImage($_FILES[
"banner"]);
365 else if($banner->getDeletionFlag())
367 $this->
object->deleteImage();
374 global
$lng, $ilHelp;
376 if($this->id_type == self::WORKSPACE_NODE_ID)
378 $this->ctrl->setParameter($this,
"wsp_id",$this->node_id);
381 $ilHelp->setScreenIdComponent(
"blog");
385 $this->tabs_gui->addTab(
"content",
386 $lng->txt(
"content"),
387 $this->ctrl->getLinkTarget($this,
""));
392 $this->tabs_gui->addTab(
"id_info",
393 $lng->txt(
"info_short"),
394 $this->ctrl->getLinkTargetByClass(array(
"ilobjbloggui",
"ilinfoscreengui"),
"showSummary"));
399 $this->tabs_gui->addTab(
"settings",
400 $lng->txt(
"settings"),
401 $this->ctrl->getLinkTarget($this,
"edit"));
403 if($this->id_type == self::REPOSITORY_NODE_ID)
405 $this->tabs_gui->addTab(
"contributors",
406 $lng->txt(
"blog_contributors"),
407 $this->ctrl->getLinkTarget($this,
"contributors"));
410 if($this->id_type == self::REPOSITORY_NODE_ID)
412 $this->tabs_gui->addTab(
"export",
414 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
420 $this->tabs_gui->addNonTabbedLink(
"preview", $lng->txt(
"blog_preview"),
421 $this->ctrl->getLinkTarget($this,
"preview"));
435 $page_id = (int)
$_GET[
"gtp"];
436 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
440 $ilCtrl->setCmdClass(
"ilblogpostinggui");
441 $_GET[
"blpg"] = $page_id;
442 $ilCtrl->setCmd(
"previewFullscreen");
450 $next_class = $ilCtrl->getNextClass($this);
451 $cmd = $ilCtrl->getCmd();
453 if($this->id_type == self::REPOSITORY_NODE_ID)
455 $tpl->getStandardTemplate();
461 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"frameset");
462 $ilNavigationHistory->addItem($this->node_id, $link,
"blog");
468 case 'ilblogpostinggui':
470 if($this->id_type == self::REPOSITORY_NODE_ID)
476 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
479 $ilTabs->setBackTarget($lng->txt(
"back"),
480 $ilCtrl->getLinkTarget($this,
""));
483 $this->object->getStyleSheetId(),
"blog");
485 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
490 ($this->object->getNotesStatus() && !$this->disable_notes),
498 case "previewFullscreen":
499 $ilCtrl->setParameter($this,
"prvm",
"fsc");
503 case "previewEmbedded":
504 $ilCtrl->setParameter($this,
"prvm",
"emb");
511 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$_GET[
"blpg"]);
512 $this->tabs_gui->addNonTabbedLink(
"preview", $lng->txt(
"blog_preview"),
513 $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"previewFullscreen"));
514 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
"");
518 $ret = $ilCtrl->forwardCommand($bpost_gui);
524 $cmd =
"preview".(($_REQUEST[
"prvm"] ==
"fsc") ?
"Fullscreen" :
"Embedded");
529 $is_active = $bpost_gui->getBlogPosting()->getActive();
532 if((
$cmd ==
"previewFullscreen" ||
$cmd ==
"previewEmbedded")
533 && !$is_owner && !$is_active)
535 $this->ctrl->redirect($this,
"preview");
541 case "previewFullscreen":
549 case "previewEmbedded":
561 if($this->id_type == self::WORKSPACE_NODE_ID)
563 $info[] = $lng->txt(
"blog_draft_info");
567 $info[] = $lng->txt(
"blog_draft_info_contributors");
570 if(
$cmd !=
"history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText())
572 $info[] = $lng->txt(
"blog_new_posting_info");
574 if($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved())
577 $info[] = $lng->txt(
"blog_posting_edit_approval_info");
579 if(
sizeof($info) && !$tpl->hasMessage(
"info"))
585 $tpl->setContent(
$ret);
587 $tpl->setRightContent($nav);
593 case "ilinfoscreengui":
603 case "ilcommonactiondispatchergui":
604 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
606 $this->ctrl->forwardCommand($gui);
609 case "ilpermissiongui":
611 $ilTabs->activateTab(
"id_permissions");
612 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
614 $this->ctrl->forwardCommand($perm_gui);
617 case "ilobjectcopygui":
618 include_once
"./Services/Object/classes/class.ilObjectCopyGUI.php";
620 $cp->setType(
"blog");
621 $this->ctrl->forwardCommand($cp);
624 case 'ilrepositorysearchgui':
626 $ilTabs->activateTab(
"contributors");
627 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
629 $rep_search->setTitle($this->lng->txt(
"blog_add_contributor"));
630 $rep_search->setCallback($this,
'addContributor');
631 $this->ctrl->setReturn($this,
'contributors');
632 $ret =& $this->ctrl->forwardCommand($rep_search);
637 $ilTabs->activateTab(
"export");
638 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
640 $exp_gui->addFormat(
"xml");
641 $exp_gui->addFormat(
"html", null, $this,
"buildExportFile");
642 $ret = $ilCtrl->forwardCommand($exp_gui);
645 case "ilobjstylesheetgui":
646 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
647 $this->ctrl->setReturn($this,
"editStyleProperties");
648 $style_gui =
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
650 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
652 $style_gui->setCreationMode(
true);
655 if (
$cmd ==
"confirmedDelete")
657 $this->
object->setStyleSheetId(0);
658 $this->
object->update();
661 $ret = $this->ctrl->forwardCommand($style_gui);
663 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
666 $this->
object->setStyleSheetId($style_id);
667 $this->
object->update();
668 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
673 if(
$cmd !=
"gethtml")
676 if(
$cmd ==
"addToDesk" ||
$cmd ==
"removeFromDesk")
678 $this->{
$cmd.
"Object"}();
687 $ilCtrl->setCmd(
$cmd);
704 $this->ctrl->setCmd(
"showSummary");
705 $this->ctrl->setCmdClass(
"ilinfoscreengui");
716 $ilTabs->activateTab(
"id_info");
720 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
723 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
726 if($this->id_type != self::WORKSPACE_NODE_ID)
728 $info->enablePrivateNotes();
737 $info->enableNewsEditing(
false);
741 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
743 if ($enable_internal_rss)
745 $info->setBlockProperty(
"news",
"settings",
true);
746 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
751 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
753 if($this->id_type == self::WORKSPACE_NODE_ID)
758 $this->ctrl->forwardCommand($info);
772 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
774 $posting->setTitle($title);
775 $posting->setBlogId($this->object->getId());
776 $posting->setActive(
false);
777 $posting->setAuthor($ilUser->getId());
781 $ilCtrl->setParameter($this,
"bmn", date(
"Y-m"));
783 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $posting->getId());
784 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"edit");
788 $ilCtrl->redirect($this,
"render");
808 $ilTabs->activateTab(
"content");
813 $ilToolbar->setFormAction($ilCtrl->getFormAction($this,
"createPosting"));
815 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
817 $ilToolbar->addInputItem($title, $lng->txt(
"title"));
819 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
821 $button->setCaption(
"blog_add_posting");
822 $button->setCommand(
"createPosting");
823 $ilToolbar->addButtonInstance($button);
826 include_once
"Modules/Exercise/classes/class.ilObjExercise.php";
831 foreach($exercises as $exercise)
837 if(!$tree->isSaved($ref_id))
867 $list = $this->
renderList($list_items,
"preview", null, $is_owner);
868 $nav = $this->
renderNavigation($this->items,
"render",
"preview", null, $is_owner);
873 $tpl->setContent($list);
874 $tpl->setRightContent($nav);
881 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
883 $exercise_id = $ass->getExerciseId();
891 if($ass->getDeadline() && $ass->getDeadline() - time() <= 0)
897 include_once
"./Services/Link/classes/class.ilLink.php";
901 $info = sprintf($lng->txt(
"blog_exercise_info"),
903 "<a href=\"".$exc_link.
"\">".
909 $ilCtrl->setParameter($this,
"exc", $exercise_id);
910 $ilCtrl->setParameter($this,
"ass", $a_assignment_id);
911 $submit_link = $ilCtrl->getLinkTarget($this,
"finalize");
912 $ilCtrl->setParameter($this,
"ass",
"");
913 $ilCtrl->setParameter($this,
"exc",
"");
915 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
917 $button->setCaption(
"blog_finalize_blog");
918 $button->setPrimary(
true);
919 $button->setUrl($submit_link);
920 $info .=
" ".$button->render();
927 $submitted = array_pop($submitted);
929 $ilCtrl->setParameter($this,
"ass", $a_assignment_id);
930 $dl_link = $ilCtrl->getLinkTarget($this,
"downloadExcSubFile");
931 $ilCtrl->setParameter($this,
"ass",
"");
936 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
938 $button->setCaption(
"download");
939 $button->setUrl($dl_link);
941 $info .=
"<br />".sprintf($lng->txt(
"blog_exercise_submitted_info"),
953 $ass = $ass->getInstruction();
956 $tooltip .= nl2br($ass);
960 if (count($ass_files) > 0)
962 $tooltip .=
"<br /><br />";
964 foreach($ass_files as
$file)
966 $ilCtrl->setParameter($this,
"ass", $a_assignment_id);
967 $ilCtrl->setParameter($this,
"file", urlencode($file[
"name"]));
968 $dl_link = $ilCtrl->getLinkTarget($this,
"downloadExcAssFile");
969 $ilCtrl->setParameter($this,
"file",
"");
970 $ilCtrl->setParameter($this,
"ass",
"");
972 $tooltip .= $file[
"name"].
": <a href=\"".$dl_link.
"\">".
973 $lng->txt(
"download").
"</a>";
979 $ol_id =
"exc_ass_".$a_assignment_id;
981 include_once
"Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
985 $overlay->setAnchor($ol_id.
"_tr");
986 $overlay->setTrigger($ol_id.
"_tr",
"click", $ol_id.
"_tr");
989 $info .=
"<div id=\"".$ol_id.
"_tr\"><a href=\"#\">".$lng->txt(
"exc_instruction").
"</a></div>".
990 "<div id=\"".$ol_id.
"\" style=\"display:none; padding:10px;\" class=\"ilOverlay\">".$tooltip.
"</div>";
993 return "<div>".$info.
"</div>";
1000 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
1004 if (count($ass_files) > 0)
1006 foreach($ass_files as
$file)
1008 if($file[
"name"] == $_GET[
"file"])
1023 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
1027 if (count($submitted) > 0)
1029 $submitted = array_pop($submitted);
1033 $ass->getTitle().
" - ".
1034 $user_data[
"firstname"].
" ".
1035 $user_data[
"lastname"].
" (".
1036 $user_data[
"login"].
").zip";
1051 if($this->id_type == self::REPOSITORY_NODE_ID)
1065 $list = $this->
renderList($list_items,
"previewEmbedded");
1066 $nav = $this->
renderNavigation($this->items,
"gethtml",
"previewEmbedded");
1082 $list_items = array();
1085 foreach(
$items as $id => $item)
1087 if($item[
"author"] == $this->author)
1089 $list_items[$id] = $item;
1094 else if($this->keyword)
1096 $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
1100 $max = $this->
object->getOverviewPostings();
1101 if($this->month_default && $max)
1103 $list_items = array();
1104 foreach($this->items as
$month => $postings)
1106 foreach($postings as $id => $item)
1108 if(!$a_show_inactive &&
1113 $list_items[$id] = $item;
1115 if(
sizeof($list_items) >= $max)
1150 $list = $this->
renderList($list_items,
"previewFullscreen");
1151 $nav = $this->
renderNavigation($this->items,
"preview",
"previewFullscreen");
1179 $wtpl =
new ilTemplate(
"tpl.blog_embedded.html",
true,
true,
"Modules/Blog");
1180 $wtpl->setVariable(
"VAL_LIST", $a_content);
1181 $wtpl->setVariable(
"VAL_NAVIGATION", $a_nav);
1182 return $wtpl->get();
1195 $owner = $this->
object->getOwner();
1197 $ilTabs->clearTargets();
1198 $ilLocator->clearItems();
1202 if($owner == $ilUser->getId())
1205 if($this->id_type == self::WORKSPACE_NODE_ID)
1207 $back =
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=".$this->node_id;
1212 $prvm =
$_GET[
"prvm"];
1213 $this->ctrl->setParameter($this,
"prvm",
"");
1216 $back = $this->ctrl->getLinkTarget($this,
"");
1220 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1221 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$_GET[
"blpg"]);
1222 $back = $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"preview");
1224 $this->ctrl->setParameter($this,
"prvm", $prvm);
1228 else if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
1231 if($this->id_type == self::WORKSPACE_NODE_ID)
1233 $back =
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner;
1238 $back = $this->ctrl->getLinkTarget($this,
"");
1244 $parent_id = $tree->getParentId($this->node_id);
1245 include_once
"Services/Link/classes/class.ilLink.php";
1252 $ilMainMenu->setTopBarBack($back);
1257 $this->ctrl->setParameter($this,
"bmn",
"");
1258 $tpl->setTitleUrl($this->ctrl->getLinkTarget($this,
"preview"));
1259 $this->ctrl->setParameter($this,
"bmn", $this->month);
1264 $tpl->setContent($a_content);
1265 $tpl->setRightContent($a_navigation);
1279 if($this->id_type != self::REPOSITORY_NODE_ID)
1282 $name = $name[
"lastname"].
", ".(
$t = $name[
"title"] ?
$t .
" " :
"").$name[
"firstname"];
1288 if($blga_set->get(
"banner"))
1290 $banner = $this->
object->getImageFullPath();
1291 $banner_width = $blga_set->get(
"banner_width");
1292 $banner_height = $blga_set->get(
"banner_height");
1295 $banner = basename($banner);
1300 if($this->object->hasProfilePicture())
1303 if($this->id_type == self::REPOSITORY_NODE_ID)
1306 if(
$_GET[
"blpg"] && !$a_export)
1308 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
1310 $author_id = $post->getAuthor();
1316 $name = $name[
"lastname"].
", ".(
$t = $name[
"title"] ?
$t .
" " :
"").$name[
"firstname"];
1326 $ppic = basename($ppic);
1331 $a_tpl->resetHeaderBlock(
false);
1333 $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
1334 $a_tpl->setTitleIcon($ppic);
1335 $a_tpl->setTitle($this->object->getTitle());
1337 $a_tpl->setDescription($name);
1340 $a_tpl->setVariable(
"LOCATOR",
"");
1354 $author_found =
false;
1359 if($this->author && $posting[
"author"] == $this->author)
1361 $author_found =
true;
1368 if($this->author && !$author_found)
1370 $this->author = null;
1386 function renderList(array
$items, $a_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false, $a_export_directory = null)
1390 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1391 $wtpl =
new ilTemplate(
"tpl.blog_list.html",
true,
true,
"Modules/Blog");
1395 stristr($a_cmd,
"embedded"))
1401 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage", (
int)
$_REQUEST[
"user_page"]);
1402 $link = $ilCtrl->getLinkTargetByClass(array(
"ilportfoliopagegui",
"ilobjbloggui"),
"render");
1403 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage",
"");
1405 $wtpl->setCurrentBlock(
"prtf_edit_bl");
1406 $wtpl->setVariable(
"PRTF_BLOG_URL", $link);
1407 $wtpl->setVariable(
"PRTF_BLOG_TITLE", sprintf($lng->txt(
"prtf_edit_embedded_blog"), $this->
object->getTitle()));
1408 $wtpl->parseCurrentBlock();
1415 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
1417 foreach($items as $item)
1421 if(!$is_active && !$a_show_inactive)
1426 if(!$this->keyword && !$this->author)
1431 if(!$last_month || $last_month !=
$month)
1435 $wtpl->setCurrentBlock(
"month_bl");
1436 $wtpl->parseCurrentBlock();
1444 else if($this->author)
1446 include_once
"Services/User/classes/class.ilUserUtil.php";
1451 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1453 " ".substr(
$month, 0, 4);
1458 $wtpl->setVariable(
"TXT_CURRENT_MONTH", $title);
1461 if(!$a_link_template)
1463 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1464 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $item[
"id"]);
1465 $preview = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_cmd);
1473 $item_contribute = $this->
mayContribute($item[
"id"], $item[
"author"]);
1474 if(($item_contribute || $can_approve || $can_deactivate) && !$a_link_template && $a_cmd ==
"preview")
1476 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
1478 $alist->setId($item[
"id"]);
1479 $alist->setListTitle($lng->txt(
"actions"));
1481 if($is_active && $this->object->hasApproval() && !$item[
"approved"])
1485 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1486 $alist->addItem($lng->txt(
"blog_approve"),
"approve",
1487 $ilCtrl->getLinkTarget($this,
"approve"));
1488 $ilCtrl->setParameter($this,
"apid",
"");
1491 $wtpl->setVariable(
"APPROVAL", $lng->txt(
"blog_needs_approval"));
1494 if($item_contribute)
1496 $alist->addItem($lng->txt(
"edit_content"),
"edit",
1497 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit"));
1502 $alist->addItem($lng->txt(
"blog_toggle_draft"),
"deactivate",
1503 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deactivatePageToList"));
1507 $alist->addItem($lng->txt(
"blog_toggle_final"),
"activate",
1508 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"activatePageToList"));
1511 $alist->addItem($lng->txt(
"rename"),
"rename",
1512 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edittitle"));
1514 if($this->object->hasKeywords())
1516 $alist->addItem($lng->txt(
"blog_edit_keywords"),
"keywords",
1517 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords"));
1520 $alist->addItem($lng->txt(
"blog_edit_date"),
"editdate",
1521 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editdate"));
1522 $alist->addItem($lng->txt(
"delete"),
"delete",
1523 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen"));
1525 else if($can_deactivate)
1530 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1531 $alist->addItem($lng->txt(
"blog_toggle_draft_admin"),
"deactivate",
1532 $ilCtrl->getLinkTarget($this,
"deactivateAdmin"));
1533 $ilCtrl->setParameter($this,
"apid",
"");
1536 $alist->addItem($lng->txt(
"delete"),
"delete",
1537 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen"));
1540 $wtpl->setCurrentBlock(
"actions");
1541 $wtpl->setVariable(
"ACTION_SELECTOR", $alist->getHTML());
1542 $wtpl->parseCurrentBlock();
1546 if($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes)
1549 include_once(
"Services/Notes/classes/class.ilNote.php");
1553 if($a_cmd !=
"preview")
1555 $wtpl->setCurrentBlock(
"comments");
1556 $wtpl->setVariable(
"TEXT_COMMENTS", $lng->txt(
"blog_comments"));
1557 $wtpl->setVariable(
"URL_COMMENTS",
$preview);
1558 $wtpl->setVariable(
"COUNT_COMMENTS", $count);
1559 $wtpl->parseCurrentBlock();
1572 if($a_cmd !=
"preview" && $a_cmd !=
"previewEmbedded")
1574 if($this->id_type == self::WORKSPACE_NODE_ID)
1576 $goto = $this->
getAccessHandler()->getGotoLink($this->node_id, $this->obj_id,
"_".$item[
"id"]);
1580 include_once
"Services/Link/classes/class.ilLink.php";
1583 $wtpl->setCurrentBlock(
"permalink");
1584 $wtpl->setVariable(
"URL_PERMALINK", $goto);
1585 $wtpl->setVariable(
"TEXT_PERMALINK", $lng->txt(
"blog_permanent_link"));
1586 $wtpl->parseCurrentBlock();
1590 $this->object->hasAbstractShorten(),
1591 $this->
object->getAbstractShortenLength(),
1593 $this->
object->hasAbstractImage(),
1594 $this->
object->getAbstractImageWidth(),
1595 $this->
object->getAbstractImageHeight(),
1596 $a_export_directory);
1600 $wtpl->setCurrentBlock(
"more");
1601 $wtpl->setVariable(
"URL_MORE",
$preview);
1602 $wtpl->setVariable(
"TEXT_MORE", $lng->txt(
"blog_list_more"));
1603 $wtpl->parseCurrentBlock();
1606 $wtpl->setCurrentBlock(
"posting");
1610 $wtpl->setVariable(
"DRAFT_CLASS",
" ilBlogListItemDraft");
1614 if($this->id_type == self::REPOSITORY_NODE_ID)
1616 $author_id = $item[
"author"];
1619 include_once
"Services/User/classes/class.ilUserUtil.php";
1625 $wtpl->setVariable(
"URL_TITLE",
$preview);
1626 $wtpl->setVariable(
"TITLE", $item[
"title"]);
1627 $wtpl->setVariable(
"DATETIME",
$author.
1631 $wtpl->setVariable(
"CONTENT", $snippet);
1633 $wtpl->parseCurrentBlock();
1637 if($a_cmd ==
"previewFullscreen")
1639 $this->tpl->setPermanentLink(
"blog", $this->node_id,
1640 ($this->id_type == self::WORKSPACE_NODE_ID)
1645 return $wtpl->get();
1658 protected function renderNavigationByDate(array $a_items, $a_list_cmd =
"render", $a_posting_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false)
1663 foreach($a_items as
$month => $postings)
1665 foreach(array_keys($postings) as $id)
1668 if(!$a_show_inactive && !$active)
1670 unset($a_items[
$month][$id]);
1674 $a_items[
$month][$id][
"active"] = $active;
1677 if(!
sizeof($a_items[
$month]))
1679 unset($a_items[$month]);
1686 $max_detail_postings = $this->
object->getNavModeListPostings();
1687 $max_months = $this->
object->getNavModeListMonths();
1689 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_by_date.html",
true,
true,
"Modules/Blog");
1691 $ilCtrl->setParameter($this,
"blpg",
"");
1693 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1694 $counter = $mon_counter = $last_year = 0;
1695 foreach($a_items as
$month => $postings)
1697 if(!$a_link_template && $max_months && $mon_counter >= $max_months)
1703 $year = substr(
$month, 0, 4);
1704 if(!$last_year || $year != $last_year)
1715 if(!$a_link_template)
1717 $ilCtrl->setParameter($this,
"bmn",
$month);
1718 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1726 if($counter < $max_detail_postings)
1730 $wtpl->setCurrentBlock(
"navigation_year_details");
1731 $wtpl->setVariable(
"YEAR", $year);
1732 $wtpl->parseCurrentBlock();
1735 foreach($postings as $id => $posting)
1737 if($max_detail_postings && $counter >= $max_detail_postings)
1747 if(!$a_link_template)
1749 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
$month);
1750 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $id);
1751 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1758 if(!$posting[
"active"])
1760 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
1762 else if($this->object->hasApproval() && !$posting[
"approved"])
1764 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
1767 $wtpl->setCurrentBlock(
"navigation_item");
1768 $wtpl->setVariable(
"NAV_ITEM_URL", $url);
1769 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1770 $wtpl->parseCurrentBlock();
1773 $wtpl->setCurrentBlock(
"navigation_month_details");
1774 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1775 $wtpl->setVariable(
"URL_MONTH", $month_url);
1776 $wtpl->parseCurrentBlock();
1783 $wtpl->setCurrentBlock(
"navigation_year");
1784 $wtpl->setVariable(
"YEAR", $year);
1785 $wtpl->parseCurrentBlock();
1788 $wtpl->setCurrentBlock(
"navigation_month");
1789 $wtpl->setVariable(
"MONTH_NAME", $month_name);
1790 $wtpl->setVariable(
"URL_MONTH", $month_url);
1791 $wtpl->setVariable(
"MONTH_COUNT",
sizeof($postings));
1792 $wtpl->parseCurrentBlock();
1796 $ilCtrl->setParameter($this,
"bmn", $this->month);
1797 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1799 return $wtpl->get();
1804 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_month.html",
true,
true,
"Modules/Blog");
1806 $ilCtrl->setParameter($this,
"blpg",
"");
1808 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1809 $month_options = array();
1810 foreach($a_items as
$month => $postings)
1813 " ".substr(
$month, 0, 4);
1815 $month_options[
$month] = $month_name;
1817 if(
$month == $this->month)
1819 if(!$a_link_template)
1821 $ilCtrl->setParameter($this,
"bmn",
$month);
1822 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1829 foreach($postings as $id => $posting)
1834 if(!$a_link_template)
1836 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
$month);
1837 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $id);
1838 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1845 if(!$posting[
"active"])
1847 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
1849 else if($this->object->hasApproval() && !$posting[
"approved"])
1851 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
1854 $wtpl->setCurrentBlock(
"navigation_item");
1855 $wtpl->setVariable(
"NAV_ITEM_URL", $url);
1856 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1857 $wtpl->parseCurrentBlock();
1860 $wtpl->setCurrentBlock(
"navigation_month_details");
1863 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1864 $wtpl->setVariable(
"URL_MONTH", $month_url);
1866 $wtpl->parseCurrentBlock();
1872 $wtpl->setCurrentBlock(
"option_bl");
1873 foreach($month_options as $value => $caption)
1875 $wtpl->setVariable(
"OPTION_VALUE", $value);
1876 $wtpl->setVariable(
"OPTION_CAPTION", $caption);
1877 if($value == $this->month)
1879 $wtpl->setVariable(
"OPTION_SEL",
' selected="selected"');
1881 $wtpl->parseCurrentBlock();
1884 $wtpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this, $a_list_cmd));
1887 $ilCtrl->setParameter($this,
"bmn", $this->month);
1888 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1890 return $wtpl->get();
1908 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_keywords.html",
true,
true,
"Modules/Blog");
1910 $max = max($keywords);
1911 include_once
"Services/Tagging/classes/class.ilTagging.php";
1913 $wtpl->setCurrentBlock(
"keyword");
1914 foreach($keywords as
$keyword => $counter)
1916 $ilCtrl->setParameter($this,
"kwd", urlencode(
$keyword));
1917 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1918 $ilCtrl->setParameter($this,
"kwd",
"");
1920 $wtpl->setVariable(
"TXT_KEYWORD",
$keyword);
1922 $wtpl->setVariable(
"URL_KEYWORD", $url);
1923 $wtpl->parseCurrentBlock();
1926 return $wtpl->get();
1941 $authors[] = $item[
"author"];
1946 $authors = array_unique($authors);
1947 if(
sizeof($authors) > 1)
1949 include_once
"Services/User/classes/class.ilUserUtil.php";
1952 foreach($authors as $user_id)
1956 $ilCtrl->setParameter($this,
"ath", $user_id);
1957 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1958 $ilCtrl->setParameter($this,
"ath",
"");
1961 $idx = trim(strip_tags($name)).
"///".$user_id;
1962 $list[$idx] = array($name, $url);
1967 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_authors.html",
true,
true,
"Modules/Blog");
1969 $wtpl->setCurrentBlock(
"author");
1972 $wtpl->setVariable(
"TXT_AUTHOR", $author[0]);
1973 $wtpl->setVariable(
"URL_AUTHOR", $author[1]);
1974 $wtpl->parseCurrentBlock();
1977 return $wtpl->get();
1991 function renderNavigation(array $a_items, $a_list_cmd =
"render", $a_posting_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false)
1995 if($this->object->getOrder())
1997 $order = array_flip($this->object->getOrder());
2008 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation.html",
true,
true,
"Modules/Blog");
2013 if(
sizeof($a_items))
2015 $blocks[$order[
"navigation"]] = array(
2016 $this->lng->txt(
"blog_navigation"),
2022 if($this->id_type == self::REPOSITORY_NODE_ID &&
2023 $this->object->hasAuthors())
2028 $blocks[$order[
"authors"]] = array($this->lng->txt(
"blog_authors"), $authors);
2033 if(!$a_link_template)
2035 if($this->object->hasKeywords())
2038 $may_edit_keywords = (
$_GET[
"blpg"] &&
2040 $a_list_cmd !=
"preview" &&
2041 $a_list_cmd !=
"gethtml");
2043 if($keywords || $may_edit_keywords)
2047 $keywords = $this->lng->txt(
"blog_no_keywords");
2050 if($may_edit_keywords)
2052 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$_GET[
"blpg"]);
2053 $cmd = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords");
2054 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
"");
2056 $blocks[$order[
"keywords"]] = array(
2057 $this->lng->txt(
"blog_keywords"),
2060 ? array(
$cmd, $this->lng->txt(
"blog_edit_keywords"))
2067 if($this->object->hasRSS() &&
2068 $ilSetting->get(
'enable_global_profiles') &&
2069 $a_list_cmd ==
"preview")
2073 if($this->id_type != self::WORKSPACE_NODE_ID)
2077 $url = ILIAS_HTTP_PATH.
"/feed.php?blog_id=".$blog_id.
2078 "&client_id=".rawurlencode(CLIENT_ID);
2080 include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
2087 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
2090 foreach($blocks as $block)
2095 $panel->setHeading($block[0]);
2096 $panel->setBody($block[1]);
2098 if(isset($block[2]) && is_array($block[2]))
2100 $panel->setFooter(
'<a href="'.$block[2][0].
'">'.$block[2][1].
'</a>');
2103 $wtpl->setCurrentBlock(
"block_bl");
2104 $wtpl->setVariable(
"BLOCK", $panel->getHTML());
2105 $wtpl->parseCurrentBlock();
2109 return $wtpl->get();
2121 $keywords = array();
2122 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
2149 foreach($keywords as
$keyword => $counter)
2151 $tmp[] = array(
"keyword"=>
$keyword,
"counter"=>$counter);
2155 $keywords = array();
2156 foreach($tmp as $item)
2158 $keywords[$item[
"keyword"]] = $item[
"counter"];
2171 include_once(
"./Services/Export/classes/class.ilExport.php");
2175 $subdir = $this->
object->getType().
"_".$this->
object->getId();
2176 $export_dir = $exp_dir.
"/".$subdir;
2183 include_once(
"./Services/Style/classes/class.ilSystemStyleHTMLExport.php");
2185 $this->sys_style_html_export->addImage(
"icon_blog.svg");
2186 $this->sys_style_html_export->export();
2189 include_once(
"./Services/COPage/classes/class.ilCOPageHTMLExport.php");
2191 $this->co_page_html_export->setContentStyleId($this->object->getStyleSheetId());
2192 $this->co_page_html_export->createDirectories();
2193 $this->co_page_html_export->exportStyles();
2194 $this->co_page_html_export->exportSupportScripts();
2198 if($blga_set->get(
"banner"))
2200 $banner = $this->
object->getImageFullPath();
2203 copy($banner, $export_dir.
"/".basename($banner));
2209 $ppic = array_shift(explode(
"?", $ppic));
2210 copy($ppic, $export_dir.
"/".basename($ppic));
2222 "/".$date.
"__".IL_INST_ID.
"__".
2223 $this->object->getType().
"_".$this->
object->getId().
".zip";
2240 function exportHTMLPages($a_target_directory, $a_link_template = null, $a_tpl_callback = null, $a_co_page_html_export = null, $a_index_name =
"index.html")
2242 if(!$a_link_template)
2244 $a_link_template =
"bl{TYPE}_{ID}.html";
2247 if($a_co_page_html_export)
2249 $this->co_page_html_export = $a_co_page_html_export;
2256 foreach(array_keys($this->items) as
$month)
2259 $list = $this->
renderList($this->items[$month],
"render", $a_link_template,
false, $a_target_directory);
2261 if(!$a_tpl_callback)
2267 $tpl = call_user_func($a_tpl_callback);
2275 copy(
$file, $a_target_directory.
"/".$a_index_name);
2281 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
2282 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2284 foreach ($pages as $page)
2288 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
2290 $blp_gui->setOutputMode(
"offline");
2291 $blp_gui->setFullscreenLink(
"fullscreen.html");
2292 $blp_gui->add_date =
true;
2293 $page_content = $blp_gui->showPage();
2296 substr($page[
"created"]->
get(
IL_CAL_DATE), 0, 7));
2300 if(!$a_tpl_callback)
2306 $tpl = call_user_func($a_tpl_callback);
2310 $page_content, $nav, $back);
2312 $this->co_page_html_export->collectPageElements(
"blp:pg", $page[
"id"]);
2315 $this->co_page_html_export->exportPageElements();
2328 if($a_type ==
"list")
2336 $link = str_replace(
"{TYPE}", $a_type, $a_template);
2337 return str_replace(
"{ID}", $a_id, $link);
2348 global $ilTabs,
$lng;
2350 $tpl = $this->co_page_html_export->getPreparedMainTemplate();
2352 $tpl->getStandardTemplate();
2354 $ilTabs->clearTargets();
2357 $ilTabs->setBackTarget($lng->txt(
"back"), $a_back_url);
2375 protected function writeExportFile($a_target_directory, $a_file, $a_tpl, $a_content, $a_right_content = null)
2377 $file = $a_target_directory.
"/".$a_file;
2379 if (@is_file(
$file))
2385 $ep_tpl =
new ilTemplate(
"tpl.export_page.html",
true,
true,
2387 $ep_tpl->setVariable(
"PAGE_CONTENT", $a_content);
2390 if($a_right_content)
2392 $ep_tpl->setVariable(
"RIGHT_CONTENT", $a_right_content);
2395 $a_tpl->setContent($ep_tpl->get());
2397 $content = $a_tpl->get(
"DEFAULT",
false,
false,
false,
2401 if (!file_put_contents(
$file, $content))
2403 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
2404 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
2426 include_once
"Modules/Exercise/classes/class.ilObjExerciseGUI.php";
2428 $exc_gui->submitBlog($this->node_id);
2431 $ilCtrl->redirect($this,
"render");
2445 $this->disable_notes = (bool)$a_value;
2453 if($a_cmd ==
"preview" || $a_cmd ==
"previewFullscreen" ||
$_GET[
"prvm"])
2456 if($ilUser->getId() != ANONYMOUS_USER_ID)
2460 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2465 $ilCtrl->setParameter($this,
"prvm",
"");
2484 $sub_type = $sub_id = null;
2488 $sub_id =
$_GET[
"blpg"];
2495 $lg->enableComments(
false);
2496 $lg->enableNotes(
false);
2497 $lg->enableTags(
false);
2499 include_once
"./Services/Notification/classes/class.ilNotification.php";
2502 $ilCtrl->setParameter($this,
"ntf", 1);
2503 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
2504 $ilCtrl->setParameter($this,
"ntf",
"");
2505 $lg->addCustomCommand($link,
"blog_notification_toggle_off");
2507 $lg->addHeaderIcon(
"not_icon",
2509 $this->lng->txt(
"blog_notification_activated"));
2513 $ilCtrl->setParameter($this,
"ntf", 2);
2514 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
2515 $ilCtrl->setParameter($this,
"ntf",
"");
2516 $lg->addCustomCommand($link,
"blog_notification_toggle_on");
2518 $lg->addHeaderIcon(
"not_icon",
2520 $this->lng->txt(
"blog_notification_deactivated"));
2526 $ilCtrl->setParameter($this,
"prvm",
"");
2528 $ilCtrl->setParameter($this,
"bmn",
"");
2529 $ilCtrl->setParameter($this,
"blpg",
"");
2530 $link = $ilCtrl->getLinkTarget($this,
"");
2531 $ilCtrl->setParameter($this,
"blpg", $sub_id);
2532 $ilCtrl->setParameter($this,
"bmn", $this->month);
2533 $lg->addCustomCommand($link,
"blog_edit");
2537 $link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
2538 $lg->addCustomCommand($link,
"blog_edit_posting");
2541 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2544 $ilCtrl->setParameter($this,
"ntf",
"");
2554 include_once
"./Services/Notification/classes/class.ilNotification.php";
2555 switch(
$_GET[
"ntf"])
2566 $ilCtrl->redirect($this,
"preview");
2579 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2581 if($post->getBlogId() == $a_blog_id)
2583 return $post->getTitle();
2594 foreach($this->items as
$month => $postings)
2596 foreach($postings as $id => $item)
2600 unset($this->items[
$month][$id]);
2602 else if($this->object->hasApproval() && !$item[
"approved"])
2604 unset($this->items[
$month][$id]);
2607 if(!
sizeof($this->items[
$month]))
2609 unset($this->items[$month]);
2613 if($this->items && !isset($this->items[$this->month]))
2615 $this->month = array_shift(array_keys($this->items));
2622 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
2627 if(in_array($a_keyword,
2649 if($this->id_type == self::WORKSPACE_NODE_ID)
2661 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2663 $a_author_id = $post->getAuthor();
2665 if($ilUser->getId() == $a_author_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");
2723 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
2728 'auto_complete_name' => $lng->txt(
'user'),
2729 'submit_name' => $lng->txt(
'add'),
2730 'add_search' =>
true,
2735 $other_roles = $this->
object->getRolesWithContribute($this->node_id);
2738 ilUtil::sendInfo(sprintf($lng->txt(
"blog_contribute_other_roles"), implode(
", ", $other_roles)));
2741 include_once
"Modules/Blog/classes/class.ilContributorTableGUI.php";
2742 $tbl =
new ilContributorTableGUI($this,
"contributors", $this->object->getLocalContributorRole($this->node_id));
2744 $tpl->setContent($tbl->getHTML());
2754 if(!strlen(trim(
$_POST[
'user_login'])))
2759 $users = explode(
',',
$_POST[
'user_login']);
2761 $user_ids = array();
2762 foreach($users as $user)
2772 $user_ids[] = $user_id;
2792 if(!count($a_user_ids))
2799 $contr_role_id = $this->
object->getLocalContributorRole($this->node_id);
2806 foreach($a_user_ids as $user_id)
2808 if(!$rbacreview->isAssigned($user_id, $contr_role_id))
2810 $rbacadmin->assignUser($contr_role_id, $user_id);
2815 $ilCtrl->redirect($this,
"contributors");
2828 $this->ctrl->redirect($this,
"contributors");
2831 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
2833 $confirm->setHeaderText($this->lng->txt(
'blog_confirm_delete_contributors'));
2834 $confirm->setFormAction($this->ctrl->getFormAction($this,
'removeContributor'));
2835 $confirm->setConfirm($this->lng->txt(
'delete'),
'removeContributor');
2836 $confirm->setCancel($this->lng->txt(
'cancel'),
'contributors');
2838 include_once
'Services/User/classes/class.ilUserUtil.php';
2840 foreach($ids as $user_id)
2842 $confirm->addItem(
'id[]', $user_id,
2846 $this->tpl->setContent($confirm->getHTML());
2861 $ilCtrl->redirect($this,
"contributors");
2865 $contr_role_id = $this->
object->getLocalContributorRole($this->node_id);
2872 foreach($ids as $user_id)
2874 $rbacadmin->deassignUser($contr_role_id, $user_id);
2878 $this->ctrl->redirect($this,
"contributors");
2888 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
2900 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
2910 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2912 $post->setApproved(
false);
2913 $post->setActive(
false);
2914 $post->update(
true,
false,
false);
2919 $this->ctrl->redirect($this,
"render");
2940 $ctpl->setCurrentBlock(
"ContentStyle");
2941 $ctpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2943 $ctpl->parseCurrentBlock();
2950 $this->tabs_gui->activateTab(
"settings");
2954 $this->tpl->setContent($form->getHTML());
2961 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
2962 $this->lng->loadLanguageModule(
"style");
2964 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2967 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
2968 $style_id = $this->
object->getStyleSheetId();
2970 if ($fixed_style > 0)
2974 $this->lng->txt(
"global_fixed").
")");
2975 $form->addItem($st);
2982 $st_styles[0] = $this->lng->txt(
"default");
2992 $form->addItem($st);
2995 $form->addCommandButton(
"editStyle", $this->lng->txt(
"style_edit_style"));
2996 $form->addCommandButton(
"deleteStyle", $this->lng->txt(
"style_delete_style"));
3005 $style_sel->setValue($style_id);
3006 $form->addItem($style_sel);
3008 $form->addCommandButton(
"saveStyleSettings", $this->lng->txt(
"save"));
3009 $form->addCommandButton(
"createStyle", $this->lng->txt(
"sty_create_ind_style"));
3013 $form->setTitle($this->lng->txt(
"blog_style"));
3014 $form->setFormAction($this->ctrl->getFormAction($this));
3021 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"create");
3026 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
3031 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
3038 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3039 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
3041 || $this->object->getStyleSheetId() == 0))
3044 $this->
object->update();
3048 $this->ctrl->redirect($this,
"editStyleProperties");
3058 if(substr($a_target, -3) ==
"wsp")
3060 $id = explode(
"_", $a_target);
3062 $_GET[
"baseClass"] =
"ilSharedResourceGUI";
3063 $_GET[
"wsp_id"] = $id[0];
3064 if(
sizeof($id) == 3)
3066 $_GET[
"gtp"] = $id[1];
3071 $id = explode(
"_", $a_target);
3073 $_GET[
"baseClass"] =
"ilRepositoryGUI";
3074 $_GET[
"ref_id"] = $id[0];
3075 $_GET[
"cmd"] =
"preview";
3076 if(
sizeof($id) == 2)
3078 $_GET[
"gtp"] = $id[1];
3082 include(
"ilias.php");