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 throw new ilException(
"Posting ID does not match blog.");
47 $this->month = (
string)$_REQUEST[
"bmn"];
48 $this->keyword = (
string)$_REQUEST[
"kwd"];
49 $this->author = (int)$_REQUEST[
"ath"];
56 if(!$this->month || !$this->items[$this->month])
58 $this->month = array_keys($this->items);
59 $this->month = array_shift($this->month);
60 $this->month_default =
true;
64 $ilCtrl->setParameter($this,
"bmn", $this->month);
67 $lng->loadLanguageModule(
"blog");
68 $ilCtrl->saveParameter($this,
"prvm");
78 $forms = parent::initCreationForms($a_new_type);
80 if($this->id_type == self::WORKSPACE_NODE_ID)
82 unset($forms[self::CFORM_IMPORT]);
83 unset($forms[self::CFORM_CLONE]);
94 $ilCtrl->redirect($this,
"");
100 $this->tabs_gui->addSubTab(
"properties",
101 $this->lng->txt(
"blog_properties"),
102 $this->ctrl->getLinkTarget($this,
'edit'));
104 $this->tabs_gui->addSubTab(
"style",
105 $this->lng->txt(
"obj_sty"),
106 $this->ctrl->getLinkTarget($this,
'editStyleProperties'));
108 $this->tabs_gui->activateSubTab($a_active);
117 if($this->id_type == self::REPOSITORY_NODE_ID)
120 $appr->
setInfo($lng->txt(
"blog_enable_approval_info"));
127 if($ilSetting->get(
'enable_global_profiles'))
130 $rss->
setInfo($lng->txt(
"blog_enable_rss_info"));
138 $nav->setTitle($lng->txt(
"blog_settings_navigation"));
146 $opt->
setInfo($lng->txt(
"blog_nav_mode_month_list_info"));
147 $nav_mode->addOption($opt);
149 $detail_num =
new ilNumberInputGUI($lng->txt(
"blog_nav_mode_month_list_num_detail"),
"nav_list_detail");
150 $detail_num->
setInfo($lng->txt(
"blog_nav_mode_month_list_num_detail_info"));
151 $detail_num->setRequired(
true);
152 $detail_num->setSize(3);
153 $detail_num->setMinValue(0);
154 $opt->addSubItem($detail_num);
156 $mon_num =
new ilNumberInputGUI($lng->txt(
"blog_nav_mode_month_list_num_month"),
"nav_list_mon");
157 $mon_num->
setInfo($lng->txt(
"blog_nav_mode_month_list_num_month_info"));
158 $mon_num->setSize(3);
159 $mon_num->setMinValue(1);
160 $opt->addSubItem($mon_num);
163 $opt->
setInfo($lng->txt(
"blog_nav_mode_month_single_info"));
164 $nav_mode->addOption($opt);
166 $order_options =
array();
167 if($this->
object->getOrder())
169 foreach($this->
object->getOrder() as $item)
171 $order_options[] = $lng->txt(
"blog_".$item);
175 if(!in_array($lng->txt(
"blog_navigation"), $order_options))
177 $order_options[] = $lng->txt(
"blog_navigation");
180 if($this->id_type == self::REPOSITORY_NODE_ID)
182 if(!in_array($lng->txt(
"blog_authors"), $order_options))
184 $order_options[] = $lng->txt(
"blog_authors");
188 $auth->
setInfo($lng->txt(
"blog_enable_nav_authors_info"));
193 $keyw->
setInfo($lng->txt(
"blog_enable_keywords_info"));
196 if(!in_array($lng->txt(
"blog_keywords"), $order_options))
198 $order_options[] = $lng->txt(
"blog_keywords");
203 $order->setValue(array_shift($order_options));
204 $order->setMulti(
true,
true,
false);
211 $pres->setTitle($lng->txt(
"blog_presentation_frame"));
217 if($this->id_type == self::REPOSITORY_NODE_ID)
219 $ppic->setInfo($lng->txt(
"blog_profile_picture_repository_info"));
223 if($blga_set->get(
"banner"))
225 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
228 $dimensions =
" (".$blga_set->get(
"banner_width").
"x".
229 $blga_set->get(
"banner_height").
")";
235 $file = $this->
object->getImageFullPath(
true);
253 $list->setTitle($lng->txt(
"blog_presentation_overview"));
256 $post_num =
new ilNumberInputGUI($lng->txt(
"blog_list_num_postings"),
"ov_list_post_num");
257 $post_num->
setInfo($lng->txt(
"blog_list_num_postings_info"));
258 $post_num->setSize(3);
259 $post_num->setMinValue(1);
260 $post_num->setRequired(
true);
264 $a_form->
addItem($abs_shorten);
266 $abs_shorten_len =
new ilNumberInputGUI($lng->txt(
"blog_abstract_shorten_length"),
"abssl");
268 $abs_shorten_len->setRequired(
true);
269 $abs_shorten_len->setSuffix($lng->txt(
"blog_abstract_shorten_characters"));
270 $abs_shorten_len->setMinValue(50,
true);
271 $abs_shorten->addSubItem($abs_shorten_len);
274 $abs_img->
setInfo($lng->txt(
"blog_abstract_image_info"));
277 $abs_img_width =
new ilNumberInputGUI($lng->txt(
"blog_abstract_image_width"),
"absiw");
279 $abs_img_width->setRequired(
true);
280 $abs_img_width->setSuffix($lng->txt(
"blog_abstract_image_pixels"));
281 $abs_img_width->setMinValue(32,
true);
282 $abs_img->addSubItem($abs_img_width);
284 $abs_img_height =
new ilNumberInputGUI($lng->txt(
"blog_abstract_image_height"),
"absih");
286 $abs_img_height->setRequired(
true);
287 $abs_img_height->setSuffix($lng->txt(
"blog_abstract_image_pixels"));
288 $abs_img_height->setMinValue(32,
true);
289 $abs_img->addSubItem($abs_img_height);
294 if($this->id_type == self::REPOSITORY_NODE_ID)
296 $a_values[
"approval"] = $this->
object->hasApproval();
297 $a_values[
"nav_authors"] = $this->
object->hasAuthors();
299 $a_values[
"keywords"] = $this->
object->hasKeywords();
300 $a_values[
"notes"] = $this->
object->getNotesStatus();
301 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
306 $a_values[
"banner"] = $this->
object->getImage();
307 $a_values[
"rss"] = $this->
object->hasRSS();
308 $a_values[
"abss"] = $this->
object->hasAbstractShorten();
309 $a_values[
"absi"] = $this->
object->hasAbstractImage();
310 $a_values[
"nav"] = $this->
object->getNavMode();
311 $a_values[
"nav_list_detail"] = $this->
object->getNavModeListPostings();
312 $a_values[
"nav_list_mon"] = $this->
object->getNavModeListMonths();
313 $a_values[
"ov_list_post_num"] = $this->
object->getOverviewPostings();
325 if($this->id_type == self::REPOSITORY_NODE_ID)
327 $this->
object->setApproval($a_form->
getInput(
"approval"));
328 $this->
object->setAuthors($a_form->
getInput(
"nav_authors"));
330 $this->
object->setKeywords($a_form->
getInput(
"keywords"));
331 $this->
object->setNotesStatus($a_form->
getInput(
"notes"));
332 $this->
object->setProfilePicture($a_form->
getInput(
"ppic"));
337 $this->
object->setRSS($a_form->
getInput(
"rss"));
338 $this->
object->setAbstractShorten($a_form->
getInput(
"abss"));
339 $this->
object->setAbstractShortenLength($a_form->
getInput(
"abssl"));
340 $this->
object->setAbstractImage($a_form->
getInput(
"absi"));
341 $this->
object->setAbstractImageWidth($a_form->
getInput(
"absiw"));
342 $this->
object->setAbstractImageHeight($a_form->
getInput(
"absih"));
343 $this->
object->setNavMode($a_form->
getInput(
"nav"));
344 $this->
object->setNavModeListPostings($a_form->
getInput(
"nav_list_detail"));
345 $this->
object->setNavModeListMonths($a_form->
getInput(
"nav_list_mon"));
346 $this->
object->setOverviewPostings($a_form->
getInput(
"ov_list_post_num"));
348 $order = $a_form->
getInput(
"order");
349 foreach($order as $idx => $value)
351 if($value == $lng->txt(
"blog_navigation"))
353 $order[$idx] =
"navigation";
355 else if($value == $lng->txt(
"blog_keywords"))
357 $order[$idx] =
"keywords";
361 $order[$idx]=
"authors";
364 $this->
object->setOrder($order);
370 if($_FILES[
"banner"][
"tmp_name"])
372 $this->
object->uploadImage($_FILES[
"banner"]);
374 else if($banner->getDeletionFlag())
376 $this->
object->deleteImage();
383 global
$lng, $ilHelp;
385 if($this->id_type == self::WORKSPACE_NODE_ID)
387 $this->ctrl->setParameter($this,
"wsp_id",$this->node_id);
390 $ilHelp->setScreenIdComponent(
"blog");
394 $this->tabs_gui->addTab(
"content",
395 $lng->txt(
"content"),
396 $this->ctrl->getLinkTarget($this,
""));
401 $this->tabs_gui->addTab(
"id_info",
402 $lng->txt(
"info_short"),
403 $this->ctrl->getLinkTargetByClass(
array(
"ilobjbloggui",
"ilinfoscreengui"),
"showSummary"));
408 $this->tabs_gui->addTab(
"settings",
409 $lng->txt(
"settings"),
410 $this->ctrl->getLinkTarget($this,
"edit"));
412 if($this->id_type == self::REPOSITORY_NODE_ID)
414 $this->tabs_gui->addTab(
"contributors",
415 $lng->txt(
"blog_contributors"),
416 $this->ctrl->getLinkTarget($this,
"contributors"));
419 if($this->id_type == self::REPOSITORY_NODE_ID)
421 $this->tabs_gui->addTab(
"export",
423 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
429 $this->tabs_gui->addNonTabbedLink(
"preview", $lng->txt(
"blog_preview"),
430 $this->ctrl->getLinkTarget($this,
"preview"));
444 $page_id = (int)
$_GET[
"gtp"];
445 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
449 $ilCtrl->setCmdClass(
"ilblogpostinggui");
450 $_GET[
"blpg"] = $page_id;
451 $ilCtrl->setCmd(
"previewFullscreen");
459 $next_class = $ilCtrl->getNextClass($this);
460 $cmd = $ilCtrl->getCmd();
462 if($this->id_type == self::REPOSITORY_NODE_ID)
468 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"frameset");
469 $ilNavigationHistory->addItem($this->node_id, $link,
"blog");
475 case 'ilblogpostinggui':
476 if(!$this->prtf_embed)
478 $tpl->getStandardTemplate();
488 if($this->id_type == self::REPOSITORY_NODE_ID)
494 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
497 $ilTabs->setBackTarget($lng->txt(
"back"),
498 $ilCtrl->getLinkTarget($this,
""));
501 $this->
object->getStyleSheetId(),
"blog");
503 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
508 ($this->
object->getNotesStatus() && !$this->disable_notes),
516 case "previewFullscreen":
517 $ilCtrl->setParameter($this,
"prvm",
"fsc");
521 case "previewEmbedded":
522 $ilCtrl->setParameter($this,
"prvm",
"emb");
529 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$_GET[
"blpg"]);
530 $this->tabs_gui->addNonTabbedLink(
"preview", $lng->txt(
"blog_preview"),
531 $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"previewFullscreen"));
532 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
"");
536 $ret = $ilCtrl->forwardCommand($bpost_gui);
540 if($_REQUEST[
"prvm"])
542 $cmd =
"preview".(($_REQUEST[
"prvm"] ==
"fsc") ?
"Fullscreen" :
"Embedded");
547 $is_active = $bpost_gui->getBlogPosting()->getActive();
550 if((
$cmd ==
"previewFullscreen" ||
$cmd ==
"previewEmbedded")
551 && !$is_owner && !$is_active)
553 $this->ctrl->redirect($this,
"preview");
559 case "previewFullscreen":
567 case "previewEmbedded":
579 if($this->id_type == self::WORKSPACE_NODE_ID)
581 $info[] = $lng->txt(
"blog_draft_info");
585 $info[] = $lng->txt(
"blog_draft_info_contributors");
588 if(
$cmd !=
"history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText())
590 $info[] = $lng->txt(
"blog_new_posting_info");
592 if($this->
object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved())
595 $info[] = $lng->txt(
"blog_posting_edit_approval_info");
597 if(
sizeof(
$info) && !$tpl->hasMessage(
"info"))
603 $tpl->setContent(
$ret);
605 $tpl->setRightContent($nav);
611 case "ilinfoscreengui":
621 case "ilcommonactiondispatchergui":
622 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
624 $this->ctrl->forwardCommand($gui);
627 case "ilpermissiongui":
629 $ilTabs->activateTab(
"id_permissions");
630 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
632 $this->ctrl->forwardCommand($perm_gui);
635 case "ilobjectcopygui":
637 include_once
"./Services/Object/classes/class.ilObjectCopyGUI.php";
639 $cp->setType(
"blog");
640 $this->ctrl->forwardCommand($cp);
643 case 'ilrepositorysearchgui':
645 $ilTabs->activateTab(
"contributors");
646 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
648 $rep_search->setTitle($this->lng->txt(
"blog_add_contributor"));
649 $rep_search->setCallback($this,
'addContributor',$this->
object->getAllLocalRoles($this->node_id));
650 $this->ctrl->setReturn($this,
'contributors');
651 $ret =& $this->ctrl->forwardCommand($rep_search);
656 $ilTabs->activateTab(
"export");
657 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
659 $exp_gui->addFormat(
"xml");
660 $exp_gui->addFormat(
"html", null, $this,
"buildExportFile");
661 $ret = $ilCtrl->forwardCommand($exp_gui);
664 case "ilobjstylesheetgui":
665 include_once (
"./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
666 $this->ctrl->setReturn($this,
"editStyleProperties");
669 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
671 $style_gui->setCreationMode(
true);
674 if (
$cmd ==
"confirmedDelete")
676 $this->
object->setStyleSheetId(0);
677 $this->
object->update();
680 $ret = $this->ctrl->forwardCommand($style_gui);
682 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
685 $this->
object->setStyleSheetId($style_id);
686 $this->
object->update();
687 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
691 case "ilblogexercisegui":
692 $this->ctrl->setReturn($this,
"render");
693 include_once
"Modules/Blog/classes/class.ilBlogExerciseGUI.php";
695 $this->ctrl->forwardCommand($gui);
699 if(
$cmd !=
"gethtml")
702 if(
$cmd ==
"addToDesk" ||
$cmd ==
"removeFromDesk")
704 $this->{
$cmd.
"Object"}();
713 $ilCtrl->setCmd(
$cmd);
717 if(!$this->prtf_embed)
719 return parent::executeCommand();
727 return $this->
$cmd();
741 $this->ctrl->setCmd(
"showSummary");
742 $this->ctrl->setCmdClass(
"ilinfoscreengui");
753 $ilTabs->activateTab(
"id_info");
757 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
760 if($this->id_type != self::WORKSPACE_NODE_ID)
762 $info->enablePrivateNotes();
771 $info->enableNewsEditing(
false);
775 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
777 if ($enable_internal_rss)
779 $info->setBlockProperty(
"news",
"settings",
true);
780 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
785 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
787 if($this->id_type == self::WORKSPACE_NODE_ID)
792 $this->ctrl->forwardCommand(
$info);
806 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
808 $posting->setTitle(
$title);
809 $posting->setBlogId($this->
object->getId());
810 $posting->setActive(
false);
811 $posting->setAuthor($ilUser->getId());
815 $ilCtrl->setParameter($this,
"bmn",
date(
"Y-m"));
817 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $posting->getId());
818 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"edit");
823 $ilCtrl->redirect($this,
"render");
843 $ilTabs->activateTab(
"content");
848 $ilToolbar->setFormAction($ilCtrl->getFormAction($this,
"createPosting"));
850 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
852 $ilToolbar->addStickyItem(
$title, $lng->txt(
"title"));
854 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
856 $button->setCaption(
"blog_add_posting");
857 $button->setCommand(
"createPosting");
858 $ilToolbar->addStickyItem($button);
861 $first = array_shift((array_keys($this->items)));
862 if($first != $this->month)
864 $ilToolbar->addSeparator();
866 $ilCtrl->setParameter($this,
"bmn", $first);
867 $url = $ilCtrl->getLinkTarget($this,
"");
868 $ilCtrl->setParameter($this,
"bmn", $this->month);
870 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
872 $button->setCaption(
"blog_show_latest");
873 $button->setUrl(
$url);
874 $ilToolbar->addButtonInstance($button);
878 include_once
"Modules/Blog/classes/class.ilBlogExerciseGUI.php";
894 $list = $this->
renderList($list_items,
"preview", null, $is_owner);
895 $nav = $this->
renderNavigation($this->items,
"render",
"preview", null, $is_owner);
900 $tpl->setContent($list);
901 $tpl->setRightContent($nav);
912 if($this->id_type == self::REPOSITORY_NODE_ID)
926 $list = $this->
renderList($list_items,
"previewEmbedded");
930 else if($_REQUEST[
"prt_id"])
938 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage", (
int)$_REQUEST[
"user_page"]);
939 $link = $ilCtrl->getLinkTargetByClass(
array(
"ilportfoliopagegui",
"ilobjbloggui"),
"render");
940 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage",
"");
942 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
944 $btn->setCaption(sprintf($lng->txt(
"prtf_edit_embedded_blog"), $this->
object->getTitle()),
false);
946 $btn->setPrimary(
true);
948 $list = $btn->render();
965 $list_items =
array();
968 foreach(
$items as $id => $item)
970 if($item[
"author"] == $this->author ||
971 (is_array($item[
"editors"]) && in_array($this->author, $item[
"editors"])))
973 $list_items[$id] = $item;
978 else if($this->keyword)
980 $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
984 $max = $this->
object->getOverviewPostings();
985 if($this->month_default && $max)
987 $list_items =
array();
988 foreach($this->items as
$month => $postings)
990 foreach($postings as $id => $item)
992 if(!$a_show_inactive &&
997 $list_items[$id] = $item;
999 if(
sizeof($list_items) >= $max)
1034 $list = $this->
renderList($list_items,
"previewFullscreen");
1035 $nav = $this->
renderNavigation($this->items,
"preview",
"previewFullscreen");
1063 $wtpl =
new ilTemplate(
"tpl.blog_embedded.html",
true,
true,
"Modules/Blog");
1065 $wtpl->setVariable(
"VAL_NAVIGATION", $a_nav);
1066 return $wtpl->get();
1079 $owner = $this->
object->getOwner();
1081 $ilTabs->clearTargets();
1082 $ilLocator->clearItems();
1088 if($owner == $ilUser->getId())
1091 if($this->id_type == self::WORKSPACE_NODE_ID)
1093 $back =
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=".$this->node_id;
1098 $prvm =
$_GET[
"prvm"];
1099 $this->ctrl->setParameter($this,
"prvm",
"");
1102 $back = $this->ctrl->getLinkTarget($this,
"");
1106 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1107 $this->ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$_GET[
"blpg"]);
1108 $back = $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"preview");
1110 $this->ctrl->setParameter($this,
"prvm", $prvm);
1113 $back_caption = $this->lng->txt(
"blog_back_to_blog_owner");
1116 else if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
1119 if($this->id_type == self::WORKSPACE_NODE_ID)
1121 $back =
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner;
1126 $back = $this->ctrl->getLinkTarget($this,
"");
1127 $back_caption = $this->lng->txt(
"blog_back_to_blog_owner");
1133 $parent_id = $tree->getParentId($this->node_id);
1134 include_once
"Services/Link/classes/class.ilLink.php";
1141 $ilMainMenu->setTopBarBack($back, $back_caption);
1146 $this->ctrl->setParameter($this,
"bmn",
"");
1147 $tpl->setTitleUrl($this->ctrl->getLinkTarget($this,
"preview"));
1148 $this->ctrl->setParameter($this,
"bmn", $this->month);
1154 $tpl->setRightContent($a_navigation);
1170 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1172 $this->
object->getType(),
1174 $this->
object->getId(),
1181 if($this->id_type != self::REPOSITORY_NODE_ID)
1184 $name = $name[
"lastname"].
", ".(
$t = $name[
"title"] ?
$t .
" " :
"").$name[
"firstname"];
1190 if($blga_set->get(
"banner"))
1192 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
1194 $banner_width = $blga_set->get(
"banner_width");
1195 $banner_height = $blga_set->get(
"banner_height");
1198 $banner = basename($banner);
1203 if($this->
object->hasProfilePicture())
1206 if($this->id_type == self::REPOSITORY_NODE_ID)
1209 if(
$_GET[
"blpg"] && !$a_export)
1211 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
1213 $author_id = $post->getAuthor();
1219 $name = $name[
"lastname"].
", ".(
$t = $name[
"title"] ?
$t .
" " :
"").$name[
"firstname"];
1229 $ppic = basename($ppic);
1234 $a_tpl->resetHeaderBlock(
false);
1236 $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
1237 $a_tpl->setTitleIcon($ppic);
1238 $a_tpl->setTitle($this->
object->getTitle());
1240 $a_tpl->setDescription($name);
1243 $a_tpl->setVariable(
"LOCATOR",
"");
1257 $author_found =
false;
1263 ($posting[
"author"] == $this->author ||
1264 (is_array($posting[
"editors"]) && in_array($this->author, $posting[
"editors"]))))
1266 $author_found =
true;
1273 if($this->author && !$author_found)
1275 $this->author = null;
1291 function renderList(
array $items, $a_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false, $a_export_directory = null)
1295 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1296 $wtpl =
new ilTemplate(
"tpl.blog_list.html",
true,
true,
"Modules/Blog");
1299 if($_REQUEST[
"prt_id"] &&
1300 stristr($a_cmd,
"embedded"))
1306 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage", (
int)$_REQUEST[
"user_page"]);
1307 $link = $ilCtrl->getLinkTargetByClass(
array(
"ilportfoliopagegui",
"ilobjbloggui"),
"render");
1308 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage",
"");
1310 include_once
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
1312 $list->setListTitle($lng->txt(
"action"));
1314 sprintf($lng->txt(
"prtf_edit_embedded_blog"), $this->
object->getTitle()),
1325 $wtpl->setCurrentBlock(
"prtf_edit_bl");
1326 $wtpl->setVariable(
"PRTF_BLOG_EDIT", $list->getHTML());
1327 $wtpl->parseCurrentBlock();
1333 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
1336 foreach($items as $item)
1340 if(!$is_active && !$a_show_inactive)
1347 if(!$this->keyword && !$this->author)
1352 if(!$last_month || $last_month !=
$month)
1356 $wtpl->setCurrentBlock(
"month_bl");
1357 $wtpl->parseCurrentBlock();
1365 else if($this->author)
1367 include_once
"Services/User/classes/class.ilUserUtil.php";
1372 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1374 " ".substr(
$month, 0, 4);
1379 $wtpl->setVariable(
"TXT_CURRENT_MONTH",
$title);
1382 if(!$a_link_template)
1384 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1385 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $item[
"id"]);
1386 $preview = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_cmd);
1394 $posting_edit = $this->
mayEditPosting($item[
"id"], $item[
"author"]);
1395 if(($posting_edit || $is_admin) && !$a_link_template && $a_cmd ==
"preview")
1397 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
1399 $alist->setId($item[
"id"]);
1400 $alist->setListTitle($lng->txt(
"actions"));
1402 if($is_active && $this->
object->hasApproval() && !$item[
"approved"])
1406 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1407 $alist->addItem($lng->txt(
"blog_approve"),
"approve",
1408 $ilCtrl->getLinkTarget($this,
"approve"));
1409 $ilCtrl->setParameter($this,
"apid",
"");
1412 $wtpl->setVariable(
"APPROVAL", $lng->txt(
"blog_needs_approval"));
1417 $alist->addItem($lng->txt(
"edit_content"),
"edit",
1418 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit"));
1423 $alist->addItem($lng->txt(
"blog_toggle_draft"),
"deactivate",
1424 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deactivatePageToList"));
1428 $alist->addItem($lng->txt(
"blog_toggle_final"),
"activate",
1429 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"activatePageToList"));
1432 $alist->addItem($lng->txt(
"rename"),
"rename",
1433 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edittitle"));
1435 if($this->
object->hasKeywords())
1437 $alist->addItem($lng->txt(
"blog_edit_keywords"),
"keywords",
1438 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords"));
1441 $alist->addItem($lng->txt(
"blog_edit_date"),
"editdate",
1442 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editdate"));
1443 $alist->addItem($lng->txt(
"delete"),
"delete",
1444 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen"));
1451 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1452 $alist->addItem($lng->txt(
"blog_toggle_draft_admin"),
"deactivate",
1453 $ilCtrl->getLinkTarget($this,
"deactivateAdmin"));
1454 $ilCtrl->setParameter($this,
"apid",
"");
1457 $alist->addItem($lng->txt(
"delete"),
"delete",
1458 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen"));
1461 $wtpl->setCurrentBlock(
"actions");
1462 $wtpl->setVariable(
"ACTION_SELECTOR", $alist->getHTML());
1463 $wtpl->parseCurrentBlock();
1467 if($this->
object->getNotesStatus() && !$a_link_template && !$this->disable_notes)
1470 include_once(
"Services/Notes/classes/class.ilNote.php");
1474 if($a_cmd !=
"preview")
1476 $wtpl->setCurrentBlock(
"comments");
1477 $wtpl->setVariable(
"TEXT_COMMENTS", $lng->txt(
"blog_comments"));
1478 $wtpl->setVariable(
"URL_COMMENTS",
$preview);
1479 $wtpl->setVariable(
"COUNT_COMMENTS", $count);
1480 $wtpl->parseCurrentBlock();
1493 if($a_cmd !=
"preview" && $a_cmd !=
"previewEmbedded")
1495 if($this->id_type == self::WORKSPACE_NODE_ID)
1497 $goto = $this->
getAccessHandler()->getGotoLink($this->node_id, $this->obj_id,
"_".$item[
"id"]);
1501 include_once
"Services/Link/classes/class.ilLink.php";
1504 $wtpl->setCurrentBlock(
"permalink");
1505 $wtpl->setVariable(
"URL_PERMALINK", $goto);
1506 $wtpl->setVariable(
"TEXT_PERMALINK", $lng->txt(
"blog_permanent_link"));
1507 $wtpl->parseCurrentBlock();
1511 $this->
object->hasAbstractShorten(),
1512 $this->
object->getAbstractShortenLength(),
1514 $this->
object->hasAbstractImage(),
1515 $this->
object->getAbstractImageWidth(),
1516 $this->
object->getAbstractImageHeight(),
1517 $a_export_directory);
1521 $wtpl->setCurrentBlock(
"more");
1522 $wtpl->setVariable(
"URL_MORE",
$preview);
1523 $wtpl->setVariable(
"TEXT_MORE", $lng->txt(
"blog_list_more"));
1524 $wtpl->parseCurrentBlock();
1527 $wtpl->setCurrentBlock(
"posting");
1531 $wtpl->setVariable(
"DRAFT_CLASS",
" ilBlogListItemDraft");
1535 if($this->id_type == self::REPOSITORY_NODE_ID)
1539 $author_id = $item[
"author"];
1542 include_once
"Services/User/classes/class.ilUserUtil.php";
1546 if(is_array($item[
"editors"]))
1548 foreach($item[
"editors"] as $editor_id)
1556 $author = implode(
", ", $authors).
" - ";
1561 $wtpl->setVariable(
"URL_TITLE",
$preview);
1562 $wtpl->setVariable(
"TITLE", $item[
"title"]);
1563 $wtpl->setVariable(
"DATETIME",
$author.
1567 $wtpl->setVariable(
"CONTENT", $snippet);
1569 $wtpl->parseCurrentBlock();
1573 if($a_cmd ==
"previewFullscreen")
1575 $this->tpl->setPermanentLink(
"blog", $this->node_id,
1576 ($this->id_type == self::WORKSPACE_NODE_ID)
1581 if(!$is_empty || $a_show_inactive)
1583 return $wtpl->get();
1597 protected function renderNavigationByDate(
array $a_items, $a_list_cmd =
"render", $a_posting_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false)
1602 foreach($a_items as
$month => $postings)
1604 foreach(array_keys($postings) as $id)
1607 if(!$a_show_inactive && !$active)
1609 unset($a_items[
$month][$id]);
1613 $a_items[
$month][$id][
"active"] = $active;
1616 if(!
sizeof($a_items[
$month]))
1618 unset($a_items[$month]);
1625 $max_detail_postings = $this->
object->getNavModeListPostings();
1626 $max_months = $this->
object->getNavModeListMonths();
1628 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_by_date.html",
true,
true,
"Modules/Blog");
1630 $ilCtrl->setParameter($this,
"blpg",
"");
1632 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1633 $counter = $mon_counter = $last_year = 0;
1634 foreach($a_items as
$month => $postings)
1636 if(!$a_link_template && $max_months && $mon_counter >= $max_months)
1642 $year = substr(
$month, 0, 4);
1643 if(!$last_year || $year != $last_year)
1654 if(!$a_link_template)
1656 $ilCtrl->setParameter($this,
"bmn",
$month);
1657 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1665 if(
$counter < $max_detail_postings)
1669 $wtpl->setCurrentBlock(
"navigation_year_details");
1670 $wtpl->setVariable(
"YEAR", $year);
1671 $wtpl->parseCurrentBlock();
1674 foreach($postings as $id => $posting)
1676 if($max_detail_postings &&
$counter >= $max_detail_postings)
1686 if(!$a_link_template)
1688 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
$month);
1689 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $id);
1690 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1697 if(!$posting[
"active"])
1699 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
1701 else if($this->
object->hasApproval() && !$posting[
"approved"])
1703 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
1706 $wtpl->setCurrentBlock(
"navigation_item");
1707 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1708 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1709 $wtpl->parseCurrentBlock();
1712 $wtpl->setCurrentBlock(
"navigation_month_details");
1713 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1714 $wtpl->setVariable(
"URL_MONTH", $month_url);
1715 $wtpl->parseCurrentBlock();
1722 $wtpl->setCurrentBlock(
"navigation_year");
1723 $wtpl->setVariable(
"YEAR", $year);
1724 $wtpl->parseCurrentBlock();
1727 $wtpl->setCurrentBlock(
"navigation_month");
1728 $wtpl->setVariable(
"MONTH_NAME", $month_name);
1729 $wtpl->setVariable(
"URL_MONTH", $month_url);
1730 $wtpl->setVariable(
"MONTH_COUNT",
sizeof($postings));
1731 $wtpl->parseCurrentBlock();
1735 $ilCtrl->setParameter($this,
"bmn", $this->month);
1736 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1738 return $wtpl->get();
1743 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_month.html",
true,
true,
"Modules/Blog");
1745 $ilCtrl->setParameter($this,
"blpg",
"");
1747 include_once
"Services/Calendar/classes/class.ilCalendarUtil.php";
1748 $month_options =
array();
1749 foreach($a_items as
$month => $postings)
1752 " ".substr(
$month, 0, 4);
1754 $month_options[
$month] = $month_name;
1756 if(
$month == $this->month)
1758 if(!$a_link_template)
1760 $ilCtrl->setParameter($this,
"bmn",
$month);
1761 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1768 foreach($postings as $id => $posting)
1773 if(!$a_link_template)
1775 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
$month);
1776 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $id);
1777 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1784 if(!$posting[
"active"])
1786 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
1788 else if($this->
object->hasApproval() && !$posting[
"approved"])
1790 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
1793 $wtpl->setCurrentBlock(
"navigation_item");
1794 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1795 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1796 $wtpl->parseCurrentBlock();
1799 $wtpl->setCurrentBlock(
"navigation_month_details");
1802 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1803 $wtpl->setVariable(
"URL_MONTH", $month_url);
1805 $wtpl->parseCurrentBlock();
1811 $wtpl->setCurrentBlock(
"option_bl");
1812 foreach($month_options as $value => $caption)
1814 $wtpl->setVariable(
"OPTION_VALUE", $value);
1815 $wtpl->setVariable(
"OPTION_CAPTION", $caption);
1816 if($value == $this->month)
1818 $wtpl->setVariable(
"OPTION_SEL",
' selected="selected"');
1820 $wtpl->parseCurrentBlock();
1823 $wtpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this, $a_list_cmd));
1826 $ilCtrl->setParameter($this,
"bmn", $this->month);
1827 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1829 return $wtpl->get();
1847 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_keywords.html",
true,
true,
"Modules/Blog");
1849 $max = max($keywords);
1850 include_once
"Services/Tagging/classes/class.ilTagging.php";
1852 $wtpl->setCurrentBlock(
"keyword");
1855 if(!$a_link_template)
1857 $ilCtrl->setParameter($this,
"kwd", urlencode(
$keyword));
1858 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1859 $ilCtrl->setParameter($this,
"kwd",
"");
1866 $wtpl->setVariable(
"TXT_KEYWORD",
$keyword);
1868 $wtpl->setVariable(
"URL_KEYWORD",
$url);
1869 $wtpl->parseCurrentBlock();
1872 return $wtpl->get();
1889 $authors[] = $item[
"author"];
1892 if(is_array($item[
"editors"]))
1894 foreach($item[
"editors"] as $editor_id)
1896 if($editor_id != $item[
"author"])
1898 $authors[] = $editor_id;
1906 $authors = array_unique($authors);
1907 if(
sizeof($authors) > 1)
1909 include_once
"Services/User/classes/class.ilUserUtil.php";
1912 foreach($authors as $user_id)
1916 $ilCtrl->setParameter($this,
"ath", $user_id);
1917 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1918 $ilCtrl->setParameter($this,
"ath",
"");
1921 $idx = trim(strip_tags($name)).
"///".$user_id;
1927 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_authors.html",
true,
true,
"Modules/Blog");
1929 $wtpl->setCurrentBlock(
"author");
1932 $wtpl->setVariable(
"TXT_AUTHOR", $author[0]);
1933 $wtpl->setVariable(
"URL_AUTHOR", $author[1]);
1934 $wtpl->parseCurrentBlock();
1937 return $wtpl->get();
1951 function renderNavigation(
array $a_items, $a_list_cmd =
"render", $a_posting_cmd =
"preview", $a_link_template = null, $a_show_inactive =
false)
1955 if($this->
object->getOrder())
1957 $order = array_flip($this->
object->getOrder());
1968 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation.html",
true,
true,
"Modules/Blog");
1973 if(
sizeof($a_items))
1975 $blocks[$order[
"navigation"]] =
array(
1976 $this->lng->txt(
"blog_navigation"),
1981 if($this->
object->hasKeywords())
1984 $may_edit_keywords = (
$_GET[
"blpg"] &&
1986 $a_list_cmd !=
"preview" &&
1987 $a_list_cmd !=
"gethtml" &&
1990 if($keywords || $may_edit_keywords)
1994 $keywords = $this->lng->txt(
"blog_no_keywords");
1997 if($may_edit_keywords)
1999 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$_GET[
"blpg"]);
2000 $cmd = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords");
2001 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
"");
2003 $blocks[$order[
"keywords"]] =
array(
2004 $this->lng->txt(
"blog_keywords"),
2007 ?
array(
$cmd, $this->lng->txt(
"blog_edit_keywords"))
2014 if(!$a_link_template)
2017 if($this->id_type == self::REPOSITORY_NODE_ID &&
2018 $this->
object->hasAuthors())
2023 $blocks[$order[
"authors"]] =
array($this->lng->txt(
"blog_authors"), $authors);
2028 if($this->
object->hasRSS() &&
2029 $ilSetting->get(
'enable_global_profiles') &&
2030 $a_list_cmd ==
"preview")
2034 if($this->id_type != self::WORKSPACE_NODE_ID)
2038 $url = ILIAS_HTTP_PATH.
"/feed.php?blog_id=".$blog_id.
2039 "&client_id=".rawurlencode(CLIENT_ID);
2041 include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
2048 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
2051 foreach($blocks as $block)
2056 $panel->setHeading($block[0]);
2057 $panel->setBody($block[1]);
2059 if(isset($block[2]) && is_array($block[2]))
2061 $panel->setFooter(
'<a href="'.$block[2][0].
'">'.$block[2][1].
'</a>');
2064 $wtpl->setCurrentBlock(
"block_bl");
2065 $wtpl->setVariable(
"BLOCK", $panel->getHTML());
2066 $wtpl->parseCurrentBlock();
2070 return $wtpl->get();
2082 $keywords =
array();
2083 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
2116 $keywords =
array();
2117 foreach($tmp as $item)
2119 $keywords[$item[
"keyword"]] = $item[
"counter"];
2132 include_once(
"./Services/Export/classes/class.ilExport.php");
2136 $subdir = $this->
object->getType().
"_".$this->
object->getId();
2137 $export_dir = $exp_dir.
"/".$subdir;
2144 include_once(
"./Services/Style/System/classes/class.ilSystemStyleHTMLExport.php");
2146 $this->sys_style_html_export->addImage(
"icon_blog.svg");
2147 $this->sys_style_html_export->export();
2150 include_once(
"./Services/COPage/classes/class.ilCOPageHTMLExport.php");
2152 $this->co_page_html_export->setContentStyleId($this->
object->getStyleSheetId());
2153 $this->co_page_html_export->createDirectories();
2154 $this->co_page_html_export->exportStyles();
2155 $this->co_page_html_export->exportSupportScripts();
2159 if($blga_set->get(
"banner"))
2161 $banner = $this->
object->getImageFullPath();
2164 copy($banner, $export_dir.
"/".basename($banner));
2170 $ppic = array_shift(explode(
"?", $ppic));
2171 copy($ppic, $export_dir.
"/".basename($ppic));
2183 "/".$date.
"__".IL_INST_ID.
"__".
2184 $this->object->getType().
"_".$this->
object->getId().
".zip";
2201 function exportHTMLPages($a_target_directory, $a_link_template = null, $a_tpl_callback = null, $a_co_page_html_export = null, $a_index_name =
"index.html")
2203 require_once(
'Services/MathJax/classes/class.ilMathJax.php');
2206 if(!$a_link_template)
2208 $a_link_template =
"bl{TYPE}_{ID}.html";
2211 if($a_co_page_html_export)
2213 $this->co_page_html_export = $a_co_page_html_export;
2224 foreach(array_keys($this->items) as
$month)
2226 $list = $this->
renderList($this->items[$month],
"render", $a_link_template,
false, $a_target_directory);
2233 if(!$a_tpl_callback)
2239 $tpl = call_user_func($a_tpl_callback);
2248 copy(
$file, $a_target_directory.
"/".$a_index_name);
2257 $list_items = $this->filterItemsByKeyword($this->items, $keyword);
2258 $list = $this->
renderList($list_items,
"render", $a_link_template,
false, $a_target_directory);
2265 if(!$a_tpl_callback)
2271 $tpl = call_user_func($a_tpl_callback);
2282 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
2283 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2285 foreach ($pages as $page)
2289 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
2291 $blp_gui->setOutputMode(
"offline");
2292 $blp_gui->setFullscreenLink(
"fullscreen.html");
2293 $blp_gui->add_date =
true;
2294 $page_content = $blp_gui->showPage();
2297 substr($page[
"created"]->
get(
IL_CAL_DATE), 0, 7));
2301 if(!$a_tpl_callback)
2307 $tpl = call_user_func($a_tpl_callback);
2311 $_GET[
"blpg"] = $page[
"id"];
2313 $_GET[
"blpg"] = null;
2316 $page_content, $nav, $back);
2318 $this->co_page_html_export->collectPageElements(
"blp:pg", $page[
"id"]);
2321 $this->co_page_html_export->exportPageElements();
2342 if(!self::$keyword_export_map)
2344 self::$keyword_export_map = array_flip(array_keys($this->
getKeywords(
false)));
2346 $a_id = self::$keyword_export_map[$a_id];
2355 $link = str_replace(
"{TYPE}",
$a_type, $a_template);
2356 return str_replace(
"{ID}", $a_id, $link);
2367 global $ilTabs,
$lng;
2369 $tpl = $this->co_page_html_export->getPreparedMainTemplate();
2371 $tpl->getStandardTemplate();
2373 $ilTabs->clearTargets();
2376 $ilTabs->setBackTarget($lng->txt(
"back"), $a_back_url);
2396 $file = $a_target_directory.
"/".$a_file;
2398 if (@is_file(
$file))
2404 $ep_tpl =
new ilTemplate(
"tpl.export_page.html",
true,
true,
2408 $ep_tpl->setVariable(
"PAGE_CONTENT",
$a_content);
2415 $a_tpl->setContent($ep_tpl->get());
2419 if($a_right_content)
2421 $a_tpl->setRightContent($a_right_content);
2422 unset($a_right_content);
2425 $content = $a_tpl->get(
"DEFAULT",
false,
false,
false,
2429 if (!file_put_contents(
$file, $content))
2431 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
2432 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
2443 if($_REQUEST[
"blpg"])
2445 return $_REQUEST[
"blpg"];
2452 $this->disable_notes = (bool)$a_value;
2460 if($a_cmd ==
"preview" || $a_cmd ==
"previewFullscreen" ||
$_GET[
"prvm"])
2463 if($ilUser->getId() != ANONYMOUS_USER_ID)
2467 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2472 $ilCtrl->setParameter($this,
"prvm",
"");
2478 return parent::addHeaderAction();
2491 $sub_type = $sub_id = null;
2495 $sub_id =
$_GET[
"blpg"];
2498 $lg = parent::initHeaderAction($sub_type, $sub_id);
2502 $lg->enableComments(
false);
2503 $lg->enableNotes(
false);
2504 $lg->enableTags(
false);
2506 include_once
"./Services/Notification/classes/class.ilNotification.php";
2509 $ilCtrl->setParameter($this,
"ntf", 1);
2510 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
2511 $ilCtrl->setParameter($this,
"ntf",
"");
2512 $lg->addCustomCommand($link,
"blog_notification_toggle_off");
2514 $lg->addHeaderIcon(
"not_icon",
2516 $this->lng->txt(
"blog_notification_activated"));
2520 $ilCtrl->setParameter($this,
"ntf", 2);
2521 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
2522 $ilCtrl->setParameter($this,
"ntf",
"");
2523 $lg->addCustomCommand($link,
"blog_notification_toggle_on");
2525 $lg->addHeaderIcon(
"not_icon",
2527 $this->lng->txt(
"blog_notification_deactivated"));
2533 $ilCtrl->setParameter($this,
"prvm",
"");
2535 $ilCtrl->setParameter($this,
"bmn",
"");
2536 $ilCtrl->setParameter($this,
"blpg",
"");
2537 $link = $ilCtrl->getLinkTarget($this,
"");
2538 $ilCtrl->setParameter($this,
"blpg", $sub_id);
2539 $ilCtrl->setParameter($this,
"bmn", $this->month);
2540 $lg->addCustomCommand($link,
"blog_edit");
2544 $link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
2545 $lg->addCustomCommand($link,
"blog_edit_posting");
2548 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2551 $ilCtrl->setParameter($this,
"ntf",
"");
2561 include_once
"./Services/Notification/classes/class.ilNotification.php";
2562 switch(
$_GET[
"ntf"])
2573 $ilCtrl->redirect($this,
"preview");
2586 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2588 if($post->getBlogId() == $a_blog_id)
2590 return $post->getTitle();
2601 foreach($this->items as
$month => $postings)
2603 foreach($postings as $id => $item)
2607 unset($this->items[
$month][$id]);
2609 else if($this->
object->hasApproval() && !$item[
"approved"])
2611 unset($this->items[
$month][$id]);
2614 if(!
sizeof($this->items[
$month]))
2616 unset($this->items[$month]);
2620 if($this->items && !isset($this->items[$this->month]))
2622 $this->month = array_shift(array_keys($this->items));
2629 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
2634 if(in_array($a_keyword,
2667 if($this->id_type == self::WORKSPACE_NODE_ID)
2686 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2688 $a_author_id = $post->getAuthor();
2690 if($ilUser->getId() == $a_author_id)
2712 if($this->id_type == self::WORKSPACE_NODE_ID)
2725 if (is_object($this->
object))
2727 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$this->node_id);
2735 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2737 $post->setApproved(
true);
2738 $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2739 $post->update(
true,
false,
true,
"new");
2744 $this->ctrl->redirect($this,
"render");
2761 $ilTabs->activateTab(
"contributors");
2763 $local_roles = $this->
object->getAllLocalRoles($this->node_id);
2766 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
2771 'auto_complete_name' => $lng->txt(
'user'),
2772 'submit_name' => $lng->txt(
'add'),
2773 'add_search' =>
true,
2775 'user_type' => $local_roles
2780 $other_roles = $this->
object->getRolesWithContributeOrRedact($this->node_id);
2783 ilUtil::sendInfo(sprintf($lng->txt(
"blog_contribute_other_roles"), implode(
", ", $other_roles)));
2786 include_once
"Modules/Blog/classes/class.ilContributorTableGUI.php";
2789 $tpl->setContent(
$tbl->getHTML());
2799 if(!strlen(trim(
$_POST[
'user_login'])))
2804 $users = explode(
',',
$_POST[
'user_login']);
2806 $user_ids =
array();
2807 foreach($users as $user)
2817 $user_ids[] = $user_id;
2837 if(!count($a_user_ids) || !$a_user_type)
2844 $local_roles = array_keys($this->
object->getAllLocalRoles($this->node_id));
2845 if(!in_array($a_user_type, $local_roles))
2851 foreach($a_user_ids as $user_id)
2853 if(!$rbacreview->isAssigned($user_id, $a_user_type))
2855 $rbacadmin->assignUser($a_user_type, $user_id);
2860 $ilCtrl->redirect($this,
"contributors");
2873 $this->ctrl->redirect($this,
"contributors");
2876 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
2878 $confirm->setHeaderText($this->lng->txt(
'blog_confirm_delete_contributors'));
2879 $confirm->setFormAction($this->ctrl->getFormAction($this,
'removeContributor'));
2880 $confirm->setConfirm($this->lng->txt(
'delete'),
'removeContributor');
2881 $confirm->setCancel($this->lng->txt(
'cancel'),
'contributors');
2883 include_once
'Services/User/classes/class.ilUserUtil.php';
2885 foreach($ids as $user_id)
2887 $confirm->addItem(
'id[]', $user_id,
2891 $this->tpl->setContent($confirm->getHTML());
2906 $ilCtrl->redirect($this,
"contributors");
2910 $local_roles = array_keys($this->
object->getAllLocalRoles($this->node_id));
2917 foreach($ids as $user_id)
2919 foreach($local_roles as $role_id)
2921 $rbacadmin->deassignUser($role_id, $user_id);
2926 $this->ctrl->redirect($this,
"contributors");
2936 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
2948 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
2958 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
2960 $post->setApproved(
false);
2961 $post->setActive(
false);
2962 $post->update(
true,
false,
false);
2967 $this->ctrl->redirect($this,
"render");
2988 $ctpl->setCurrentBlock(
"ContentStyle");
2989 $ctpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
2991 $ctpl->parseCurrentBlock();
2998 $this->tabs_gui->activateTab(
"settings");
3002 $this->tpl->setContent($form->getHTML());
3009 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3010 $this->lng->loadLanguageModule(
"style");
3012 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
3015 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
3016 $style_id = $this->
object->getStyleSheetId();
3018 if ($fixed_style > 0)
3022 $this->lng->txt(
"global_fixed").
")");
3023 $form->addItem($st);
3030 $st_styles[0] = $this->lng->txt(
"default");
3040 $form->addItem($st);
3043 $form->addCommandButton(
"editStyle", $this->lng->txt(
"style_edit_style"));
3044 $form->addCommandButton(
"deleteStyle", $this->lng->txt(
"style_delete_style"));
3053 $style_sel->setValue($style_id);
3054 $form->addItem($style_sel);
3056 $form->addCommandButton(
"saveStyleSettings", $this->lng->txt(
"save"));
3057 $form->addCommandButton(
"createStyle", $this->lng->txt(
"sty_create_ind_style"));
3061 $form->setTitle($this->lng->txt(
"blog_style"));
3062 $form->setFormAction($this->ctrl->getFormAction($this));
3069 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"create");
3074 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
3079 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
3086 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3087 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
3089 || $this->
object->getStyleSheetId() == 0))
3092 $this->
object->update();
3096 $this->ctrl->redirect($this,
"editStyleProperties");
3106 if(substr($a_target, -3) ==
"wsp")
3108 $id = explode(
"_", $a_target);
3110 $_GET[
"baseClass"] =
"ilSharedResourceGUI";
3111 $_GET[
"wsp_id"] = $id[0];
3112 if(
sizeof($id) == 3)
3114 $_GET[
"gtp"] = $id[1];
3119 $id = explode(
"_", $a_target);
3121 $_GET[
"baseClass"] =
"ilRepositoryGUI";
3122 $_GET[
"ref_id"] = $id[0];
3123 $_GET[
"cmd"] =
"preview";
3124 if(
sizeof($id) == 2)
3126 if(is_numeric($id[1]))
3128 $_GET[
"gtp"] = $id[1];
3132 $_REQUEST[
"kwd"] = $id[1];
3137 include(
"ilias.php");
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
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.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
disableNotes($a_value=false)
Base class for ILIAS Exception handling.
mayContribute()
Check if user may contribute at all.
renderFullscreenHeader($a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
static lookupBlogId($a_posting_id)
Lookup blog id.
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.
static _getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
getPermanentLinkWidget($a_append=null, $a_center=false)
HTML export class for system styles.
initStylePropertiesForm()
buildExportTemplate($a_back_url="")
Build export "frame".
static _lookupId($a_user_str)
Lookup id by login.
static _lookupTitle($a_id)
lookup object title
Add rich text string
The name of the decorator.
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)
static _lookupStandard($a_id)
Lookup standard flag.
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.
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.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
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.
render()
Render object context.
static _lookupOwner($a_id)
lookup object owner
static _recordReadEvent($a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static _getNotesOfObject($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_type=IL_NOTE_PRIVATE, $a_incl_sub=false, $a_filter="", $a_all_public="y", $a_repository_mode=true, $a_sort_ascending=false)
get all notes related to a specific object
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
Create styles array
The data for the language used.
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.
static getContentStylePath($a_style_id)
get content style path
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)
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.
static getInstance()
Singleton: get instance.
Create new PHPExcel object
obj_idprivate
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.
prepareOutput($a_show_subobjects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
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)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
addHeaderActionForCommand($a_cmd)
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.