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";
 
   29         function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 
   38                         $this->keyword = (string)
$_REQUEST[
"kwd"];
 
   46                                 if(!$this->month || !$this->items[$this->month])
 
   48                                         $this->month = array_keys($this->items);
 
   49                                         $this->month = array_shift($this->month);
 
   53                         $ilCtrl->setParameter($this, 
"bmn", $this->month);
 
   56                 $lng->loadLanguageModule(
"blog");
 
   57                 $ilCtrl->saveParameter($this, 
"prvm");
 
   69                 if($this->id_type == self::WORKSPACE_NODE_ID)
 
   71                         unset($forms[self::CFORM_IMPORT]);
 
   72                         unset($forms[self::CFORM_CLONE]);
 
   83                 $ilCtrl->redirect($this, 
"");
 
   90                 if($this->id_type == self::REPOSITORY_NODE_ID)
 
   93                         $appr->
setInfo($lng->txt(
"blog_enable_approval_info"));
 
  100                 if($ilSetting->get(
'enable_global_profiles'))
 
  103                         $rss->
setInfo($lng->txt(
"blog_enable_rss_info"));
 
  111                 if($blga_set->get(
"banner"))
 
  113                         $dimensions = 
" (".$blga_set->get(
"banner_width").
"x".
 
  114                                 $blga_set->get(
"banner_height").
")";
 
  120                         $file = $this->
object->getImageFullPath(
true);
 
  136                 if($this->id_type == self::REPOSITORY_NODE_ID)
 
  138                         $a_values[
"approval"] = $this->
object->hasApproval();
 
  140                 $a_values[
"notes"] = $this->
object->getNotesStatus();
 
  141                 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
 
  142                 $a_values[
"bg_color"] = $this->
object->getBackgroundColor();
 
  143                 $a_values[
"font_color"] = $this->
object->getFontColor();
 
  144                 $a_values[
"banner"] = $this->
object->getImage();
 
  145                 $a_values[
"rss"] = $this->
object->hasRSS();
 
  150                 if($this->id_type == self::REPOSITORY_NODE_ID)
 
  152                         $this->
object->setApproval($a_form->
getInput(
"approval"));
 
  154                 $this->
object->setNotesStatus($a_form->
getInput(
"notes"));
 
  155                 $this->
object->setProfilePicture($a_form->
getInput(
"ppic"));
 
  156                 $this->
object->setBackgroundColor($a_form->
getInput(
"bg_color"));
 
  157                 $this->
object->setFontColor($a_form->
getInput(
"font_color"));
 
  158                 $this->
object->setRSS($a_form->
getInput(
"rss"));
 
  164                         if($_FILES[
"banner"][
"tmp_name"]) 
 
  166                                 $this->
object->uploadImage($_FILES[
"banner"]);
 
  168                         else if($banner->getDeletionFlag())
 
  170                                 $this->
object->deleteImage();
 
  177                 global 
$lng, $ilHelp;
 
  179                 if($this->id_type == self::WORKSPACE_NODE_ID)
 
  181                         $this->ctrl->setParameter($this,
"wsp_id",$this->node_id);
 
  184                 $ilHelp->setScreenIdComponent(
"blog");
 
  188                         $this->tabs_gui->addTab(
"content",
 
  189                                 $lng->txt(
"content"),
 
  190                                 $this->ctrl->getLinkTarget($this, 
""));
 
  195                         $this->tabs_gui->addTab(
"id_info",
 
  196                                 $lng->txt(
"info_short"),
 
  197                                 $this->ctrl->getLinkTargetByClass(array(
"ilobjbloggui", 
"ilinfoscreengui"), 
"showSummary"));
 
  202                         $this->tabs_gui->addTab(
"settings",
 
  203                                 $lng->txt(
"settings"),
 
  204                                 $this->ctrl->getLinkTarget($this, 
"edit"));                     
 
  206                         if($this->id_type == self::REPOSITORY_NODE_ID)
 
  208                                 $this->tabs_gui->addTab(
"contributors",
 
  209                                         $lng->txt(
"blog_contributors"),
 
  210                                         $this->ctrl->getLinkTarget($this, 
"contributors"));     
 
  213                         if($this->id_type == self::REPOSITORY_NODE_ID)
 
  215                                 $this->tabs_gui->addTab(
"export",
 
  217                                         $this->ctrl->getLinkTargetByClass(
"ilexportgui", 
""));
 
  223                         $this->tabs_gui->addNonTabbedLink(
"preview", $lng->txt(
"blog_preview"), 
 
  224                                 $this->ctrl->getLinkTarget($this, 
"preview"));
 
  238                         $page_id = (int)
$_GET[
"gtp"];
 
  239                         include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
  243                                 $ilCtrl->setCmdClass(
"ilblogpostinggui");                       
 
  244                                 $_GET[
"blpg"] = $page_id;
 
  245                                 $ilCtrl->setCmd(
"previewFullscreen");                   
 
  253                 $next_class = $ilCtrl->getNextClass($this);
 
  254                 $cmd = $ilCtrl->getCmd();
 
  256                 if($this->id_type == self::REPOSITORY_NODE_ID)
 
  258                         $tpl->getStandardTemplate();
 
  264                                 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui", 
"frameset");                           
 
  265                                 $ilNavigationHistory->addItem($this->node_id, $link, 
"blog");
 
  271                         case 'ilblogpostinggui':        
 
  273                                 if($this->id_type == self::REPOSITORY_NODE_ID)
 
  277                                 $ilTabs->setBackTarget($lng->txt(
"back"),
 
  278                                         $ilCtrl->getLinkTarget($this, 
""));
 
  280                                 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
 
  285                                         ($this->object->getNotesStatus() && !$this->disable_notes),                             
 
  295                                         case "previewFullscreen":
 
  296                                                 $ilCtrl->setParameter($this, 
"prvm", 
"fsc");
 
  300                                         case "previewEmbedded":
 
  301                                                 $ilCtrl->setParameter($this, 
"prvm", 
"emb");
 
  306                                                 $this->ctrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", 
$_GET[
"blpg"]);
 
  307                                                 $this->tabs_gui->addNonTabbedLink(
"preview", $lng->txt(
"blog_preview"), 
 
  308                                                         $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui", 
"previewFullscreen"));
 
  309                                                 $this->ctrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", 
"");
 
  313                                 $ret = $ilCtrl->forwardCommand($bpost_gui);
 
  319                                                 $cmd = 
"preview".(($_REQUEST[
"prvm"] == 
"fsc") ? 
"Fullscreen" : 
"Embedded");                                            
 
  324                                         $is_active = $bpost_gui->getBlogPosting()->getActive();
 
  327                                         if((
$cmd == 
"previewFullscreen" || 
$cmd == 
"previewEmbedded")
 
  328                                                 && !$is_owner && !$is_active)
 
  330                                                 $this->ctrl->redirect($this, 
"preview");
 
  336                                                 case "previewFullscreen":               
 
  344                                                 case "previewEmbedded":
 
  356                                                                 if($this->id_type == self::WORKSPACE_NODE_ID)
 
  358                                                                         $info[] = $lng->txt(
"blog_draft_info");
 
  362                                                                         $info[] = $lng->txt(
"blog_draft_info_contributors");
 
  365                                                         if(
$cmd != 
"history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText())
 
  367                                                                 $info[] = $lng->txt(
"blog_new_posting_info");
 
  369                                                         if($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved())
 
  372                                                                 $info[] = $lng->txt(
"blog_posting_edit_approval_info");
 
  380                                                         $tpl->setContent(
$ret);
 
  382                                                         $tpl->setRightContent($nav);    
 
  388                         case "ilinfoscreengui":
 
  397                         case "ilcommonactiondispatchergui":
 
  398                                 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
 
  400                                 $this->ctrl->forwardCommand($gui);
 
  403                         case "ilpermissiongui":
 
  405                                 $ilTabs->activateTab(
"id_permissions");
 
  406                                 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
  408                                 $this->ctrl->forwardCommand($perm_gui);
 
  411                         case "ilobjectcopygui":
 
  412                                 include_once 
"./Services/Object/classes/class.ilObjectCopyGUI.php";
 
  414                                 $cp->setType(
"blog");
 
  415                                 $this->ctrl->forwardCommand($cp);
 
  418                         case 'ilrepositorysearchgui':
 
  420                                 $ilTabs->activateTab(
"contributors");
 
  421                                 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
 
  423                                 $rep_search->setTitle($this->lng->txt(
"blog_add_contributor"));
 
  424                                 $rep_search->setCallback($this,
'addContributor');
 
  425                                 $this->ctrl->setReturn($this,
'contributors');                           
 
  426                                 $ret =& $this->ctrl->forwardCommand($rep_search);
 
  431                                 $ilTabs->activateTab(
"export");
 
  432                                 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
 
  434                                 $exp_gui->addFormat(
"xml");
 
  435                                 $ret = $ilCtrl->forwardCommand($exp_gui);
 
  439                                 if(
$cmd != 
"gethtml")
 
  442                                         if(
$cmd == 
"addToDesk" || 
$cmd == 
"removeFromDesk")
 
  444                                                 $this->{
$cmd.
"Object"}();
 
  453                                                 $ilCtrl->setCmd(
$cmd);
 
  470                 $this->ctrl->setCmd(
"showSummary");
 
  471                 $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
  482                 $ilTabs->activateTab(
"id_info");
 
  486                         $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
 
  489                 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
  492                 $info->enablePrivateNotes();
 
  500                 $info->enableNewsEditing(
false);
 
  504                         $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
  506                         if ($enable_internal_rss)
 
  508                                 $info->setBlockProperty(
"news", 
"settings", 
true);
 
  509                                 $info->setBlockProperty(
"news", 
"public_notifications_option", 
true);
 
  514                 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
 
  516                 if($this->id_type == self::WORKSPACE_NODE_ID)
 
  521                 $this->ctrl->forwardCommand($info);
 
  535                         include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
 
  537                         $posting->setTitle(
$title);
 
  538                         $posting->setBlogId($this->object->getId());
 
  539                         $posting->setActive(
false);
 
  540                         $posting->setAuthor($ilUser->getId());
 
  544                         $ilCtrl->setParameter($this, 
"bmn", date(
"Y-m"));
 
  546                         $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $posting->getId());
 
  547                         $ilCtrl->redirectByClass(
"ilblogpostinggui", 
"edit");
 
  551                         $ilCtrl->redirect($this, 
"render");
 
  571                 $ilTabs->activateTab(
"content");
 
  576                         $ilToolbar->setFormAction($ilCtrl->getFormAction($this, 
"createPosting"));
 
  578                         include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  580                         $ilToolbar->addInputItem(
$title, $lng->txt(
"title"));
 
  582                         $ilToolbar->addFormButton($lng->txt(
"blog_add_posting"), 
"createPosting");
 
  585                         include_once 
"Modules/Exercise/classes/class.ilObjExercise.php";                        
 
  590                                 foreach($exercises as $exercise)
 
  596                                                 if(!$tree->isSaved($ref_id))
 
  625                         $list = $this->
renderList($list_items, $this->month, 
"preview", null, $is_owner);
 
  626                         $nav = $this->
renderNavigation($this->items, 
"render", 
"preview", null, $is_owner);             
 
  629                 $tpl->setContent($list);
 
  630                 $tpl->setRightContent($nav);
 
  637                 include_once 
"Modules/Exercise/classes/class.ilExAssignment.php";                       
 
  639                 $exercise_id = $ass->getExerciseId();           
 
  647                 if($ass->getDeadline() && $ass->getDeadline() - time() <= 0)
 
  653                 include_once 
"./Services/Link/classes/class.ilLink.php";
 
  657                 $info = sprintf($lng->txt(
"blog_exercise_info"), 
 
  659                         "<a href=\"".$exc_link.
"\">".
 
  665                         $ilCtrl->setParameter($this, 
"exc", $exercise_id);                              
 
  666                         $ilCtrl->setParameter($this, 
"ass", $a_assignment_id);
 
  667                         $submit_link = $ilCtrl->getLinkTarget($this, 
"finalize");
 
  668                         $ilCtrl->setParameter($this, 
"ass", 
"");
 
  669                         $ilCtrl->setParameter($this, 
"exc", 
"");        
 
  670                         $info .= 
" <a class=\"submit\" href=\"".$submit_link.
"\">".$lng->txt(
"blog_finalize_blog").
"</a>";
 
  677                         $submitted = array_pop($submitted);
 
  679                         $ilCtrl->setParameter($this, 
"ass", $a_assignment_id);
 
  680                         $dl_link = $ilCtrl->getLinkTarget($this, 
"downloadExcSubFile");
 
  681                         $ilCtrl->setParameter($this, 
"ass", 
"");
 
  686                         $info .= 
"<br />".sprintf($lng->txt(
"blog_exercise_submitted_info"), 
 
  688                                 "<a href=\"".$dl_link.
"\">".$lng->txt(
"download").
"</a>");
 
  698                 $ass = $ass->getInstruction();
 
  701                         $tooltip .= nl2br($ass);                                        
 
  705                 if (count($ass_files) > 0)
 
  707                         $tooltip .= 
"<br /><br />";
 
  709                         foreach($ass_files as 
$file)
 
  711                                 $ilCtrl->setParameter($this, 
"ass", $a_assignment_id);
 
  712                                 $ilCtrl->setParameter($this, 
"file", urlencode($file[
"name"]));
 
  713                                 $dl_link = $ilCtrl->getLinkTarget($this, 
"downloadExcAssFile");
 
  714                                 $ilCtrl->setParameter($this, 
"file", 
"");                       
 
  715                                 $ilCtrl->setParameter($this, 
"ass", 
"");                        
 
  717                                 $tooltip .= $file[
"name"].
": <a href=\"".$dl_link.
"\">".
 
  718                                         $lng->txt(
"download").
"</a>";                                                                           
 
  724                         $ol_id = 
"exc_ass_".$a_assignment_id;
 
  726                         include_once 
"Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
 
  730                         $overlay->setAnchor($ol_id.
"_tr");
 
  731                         $overlay->setTrigger($ol_id.
"_tr", 
"click", $ol_id.
"_tr");
 
  732                         $overlay->setAutoHide(
false);
 
  737                         $overlay->addTrigger($ol_id.
"_tr", 
"click", $ol_id.
"_tr");
 
  739                         $info .= 
"<div id=\"".$ol_id.
"_tr\"><a href=\"#\">".$lng->txt(
"exc_instruction").
"</a></div>".
 
  740                                 "<div id=\"".$ol_id.
"\" style=\"display:none; background-color:white; border: 1px solid #bbb; padding: 10px;\">".$tooltip.
"</div>";
 
  743                 return "<div>".$info.
"</div>";
 
  750                         include_once 
"Modules/Exercise/classes/class.ilExAssignment.php";                       
 
  754                         if (count($ass_files) > 0)
 
  756                                 foreach($ass_files as 
$file)
 
  758                                         if($file[
"name"] == $_GET[
"file"])
 
  773                         include_once 
"Modules/Exercise/classes/class.ilExAssignment.php";                       
 
  777                         if (count($submitted) > 0)
 
  779                                 $submitted = array_pop($submitted);                     
 
  783                                         $ass->getTitle().
" - ".
 
  784                                         $user_data[
"firstname"].
" ".
 
  785                                         $user_data[
"lastname"].
" (".
 
  786                                         $user_data[
"login"].
").zip";
 
  801                 if($this->id_type == self::REPOSITORY_NODE_ID)
 
  815                         $list = $this->
renderList($list_items, $this->month, 
"previewEmbedded");
 
  831                         $list_items = array();
 
  834                                 foreach(
$items as $id => $item)
 
  836                                         if($item[
"author"] == $this->author)
 
  838                                                 $list_items[$id] = $item;
 
  843                 else if($this->keyword)
 
  845                         $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
 
  874                         $list = $this->
renderList($list_items, $this->month, 
"previewFullscreen");
 
  875                         $nav = $this->
renderNavigation($this->items, 
"preview", 
"previewFullscreen");           
 
  903                 $wtpl = 
new ilTemplate(
"tpl.blog_embedded.html", 
true, 
true, 
"Modules/Blog");
 
  904                 $wtpl->setVariable(
"VAL_LIST", $a_content);
 
  905                 $wtpl->setVariable(
"VAL_NAVIGATION", $a_nav);                                                   
 
  919                 $owner = $this->
object->getOwner();
 
  921                 $ilTabs->clearTargets();
 
  922                 $ilLocator->clearItems();
 
  926                 if($owner == $ilUser->getId())
 
  929                         if($this->id_type == self::WORKSPACE_NODE_ID)
 
  931                                 $back = 
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=".$this->node_id;
 
  936                                 $prvm = 
$_GET[
"prvm"];
 
  937                                 $this->ctrl->setParameter($this, 
"prvm", 
"");
 
  940                                         $back = $this->ctrl->getLinkTarget($this, 
"");
 
  944                                         $this->ctrl->setParameterByClass(
"ilblogpostinggui", 
"bmn", $this->month);
 
  945                                         $this->ctrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", 
$_GET[
"blpg"]);
 
  946                                         $back = $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui", 
"preview");
 
  948                                 $this->ctrl->setParameter($this, 
"prvm", $prvm);
 
  952                 else if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
 
  955                         if($this->id_type == self::WORKSPACE_NODE_ID)
 
  957                                 $back = 
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner;
 
  962                                 $back = $this->ctrl->getLinkTarget($this, 
"");
 
  968                                 $parent_id = $tree->getParentId($this->node_id);
 
  969                                 include_once 
"Services/Link/classes/class.ilLink.php";
 
  973                 $tpl->setTopBar($back);
 
  978                 $tpl->setContent($a_content);
 
  979                 $tpl->setRightContent($a_navigation);
 
  980                 $tpl->setFrameFixedWidth(
true);
 
  982                 echo $tpl->show(
"DEFAULT", 
true, 
true);
 
  997                 if($this->id_type != self::REPOSITORY_NODE_ID)
 
 1000                         $name = $name[
"lastname"].
", ".(
$t = $name[
"title"] ? 
$t . 
" " : 
"").$name[
"firstname"];
 
 1006                 if($blga_set->get(
"banner"))
 
 1008                         $banner = $this->
object->getImageFullPath();
 
 1009                         $banner_width = $blga_set->get(
"banner_width");
 
 1010                         $banner_height = $blga_set->get(
"banner_height");               
 
 1013                                 $banner = basename($banner);
 
 1018                 if($this->object->hasProfilePicture())
 
 1023                                 $ppic = basename($ppic);
 
 1027                 include_once(
"./Services/User/classes/class.ilUserUtil.php");
 
 1028                 $a_tpl->setFullscreenHeader($this->object->getTitle(), 
 
 1032                         $this->
object->getBackgroundColor(),
 
 1033                         $this->
object->getFontColor(),
 
 1037                 $a_tpl->setBodyClass(
"std ilExternal ilBlog");
 
 1049                 $author_found = 
false;  
 
 1054                         if($this->author && $posting[
"author"] == $this->author)
 
 1056                                 $author_found = 
true;
 
 1063                 if($this->author && !$author_found)
 
 1065                         $this->author = null;
 
 1081         function renderList(array 
$items, $a_month, $a_cmd = 
"preview", $a_link_template = null, $a_show_inactive = 
false)
 
 1085                 include_once 
"Services/Calendar/classes/class.ilCalendarUtil.php";
 
 1086                 $wtpl = 
new ilTemplate(
"tpl.blog_list.html", 
true, 
true, 
"Modules/Blog");
 
 1093                 else if($this->author)
 
 1095                         include_once 
"Services/User/classes/class.ilUserUtil.php";
 
 1100                         include_once 
"Services/Calendar/classes/class.ilCalendarUtil.php";
 
 1102                                         " ".substr($a_month, 0, 4);
 
 1104                 $wtpl->setVariable(
"TXT_CURRENT_MONTH", 
$title);                                                
 
 1109                 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");      
 
 1110                 foreach($items as $item)
 
 1114                         if(!$is_active && !$a_show_inactive)
 
 1119                         if(!$a_link_template)
 
 1121                                 $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"bmn", $this->month);
 
 1122                                 $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $item[
"id"]);
 
 1123                                 $preview = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_cmd);
 
 1131                         $item_contribute = $this->
mayContribute($item[
"id"], $item[
"author"]);
 
 1132                         if(($item_contribute || $can_approve || $can_deactivate) && !$a_link_template && $a_cmd == 
"preview")
 
 1134                                 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
 
 1136                                 $alist->setId($item[
"id"]);
 
 1137                                 $alist->setListTitle($lng->txt(
"actions"));
 
 1139                                 if($is_active && $this->object->hasApproval() && !$item[
"approved"])
 
 1143                                                 $ilCtrl->setParameter($this, 
"apid", $item[
"id"]);
 
 1144                                                 $alist->addItem($lng->txt(
"blog_approve"), 
"approve", 
 
 1145                                                         $ilCtrl->getLinkTarget($this, 
"approve"));
 
 1146                                                 $ilCtrl->setParameter($this, 
"apid", 
"");
 
 1149                                         $wtpl->setVariable(
"APPROVAL", $lng->txt(
"blog_needs_approval"));
 
 1152                                 if($item_contribute)
 
 1154                                         $alist->addItem($lng->txt(
"edit_content"), 
"edit", 
 
 1155                                                 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"edit"));
 
 1156                                         $alist->addItem($lng->txt(
"rename"), 
"rename", 
 
 1157                                                 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"edittitle"));
 
 1158                                         $alist->addItem($lng->txt(
"blog_edit_keywords"), 
"keywords", 
 
 1159                                                 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"editKeywords"));                             
 
 1160                                         $alist->addItem($lng->txt(
"blog_edit_date"), 
"editdate", 
 
 1161                                                 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"editdate"));
 
 1162                                         $alist->addItem($lng->txt(
"delete"), 
"delete",
 
 1163                                                 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"deleteBlogPostingConfirmationScreen"));                              
 
 1165                                 else if($can_deactivate)
 
 1170                                                 $ilCtrl->setParameter($this, 
"apid", $item[
"id"]);
 
 1171                                                 $alist->addItem($lng->txt(
"blog_toggle_draft_admin"), 
"deactivate", 
 
 1172                                                         $ilCtrl->getLinkTarget($this, 
"deactivateAdmin"));
 
 1173                                                 $ilCtrl->setParameter($this, 
"apid", 
"");
 
 1176                                         $alist->addItem($lng->txt(
"delete"), 
"delete",
 
 1177                                                 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"deleteBlogPostingConfirmationScreen"));              
 
 1180                                 $wtpl->setCurrentBlock(
"actions");
 
 1181                                 $wtpl->setVariable(
"ACTION_SELECTOR", $alist->getHTML());
 
 1182                                 $wtpl->parseCurrentBlock();
 
 1186                         if($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes)
 
 1189                                 include_once(
"Services/Notes/classes/class.ilNote.php");
 
 1193                                 if($a_cmd != 
"preview")
 
 1195                                         $wtpl->setCurrentBlock(
"comments");
 
 1196                                         $wtpl->setVariable(
"TEXT_COMMENTS", $lng->txt(
"blog_comments"));
 
 1197                                         $wtpl->setVariable(
"URL_COMMENTS", 
$preview);
 
 1198                                         $wtpl->setVariable(
"COUNT_COMMENTS", $count);
 
 1199                                         $wtpl->parseCurrentBlock();
 
 1212                         if($a_cmd != 
"preview" && $a_cmd != 
"previewEmbedded")
 
 1214                                 if($this->id_type == self::WORKSPACE_NODE_ID)
 
 1216                                         $goto = $this->
getAccessHandler()->getGotoLink($this->node_id, $this->obj_id, 
"_".$item[
"id"]);
 
 1220                                         include_once 
"Services/Link/classes/class.ilLink.php";
 
 1223                                 $wtpl->setCurrentBlock(
"permalink");
 
 1224                                 $wtpl->setVariable(
"URL_PERMALINK", $goto); 
 
 1225                                 $wtpl->setVariable(
"TEXT_PERMALINK", $lng->txt(
"blog_permanent_link"));
 
 1226                                 $wtpl->parseCurrentBlock();                             
 
 1233                                 $wtpl->setCurrentBlock(
"more");
 
 1234                                 $wtpl->setVariable(
"URL_MORE", 
$preview); 
 
 1235                                 $wtpl->setVariable(
"TEXT_MORE", $lng->txt(
"blog_list_more"));
 
 1236                                 $wtpl->parseCurrentBlock();
 
 1239                         $wtpl->setCurrentBlock(
"posting");
 
 1243                                 $wtpl->setVariable(
"DRAFT_CLASS", 
" ilBlogListItemDraft");
 
 1247                         if($this->id_type == self::REPOSITORY_NODE_ID)
 
 1249                                 $author_id = $item[
"author"];
 
 1252                                         include_once 
"Services/User/classes/class.ilUserUtil.php";
 
 1258                         $wtpl->setVariable(
"URL_TITLE", 
$preview);
 
 1259                         $wtpl->setVariable(
"TITLE", $item[
"title"]);
 
 1260                         $wtpl->setVariable(
"DATETIME", 
$author.
 
 1264                         $wtpl->setVariable(
"CONTENT", $snippet);                        
 
 1266                         $wtpl->parseCurrentBlock();
 
 1278                 if($a_cmd == 
"previewFullscreen")
 
 1283                 return $wtpl->get();
 
 1325         function renderNavigation(array 
$items, $a_list_cmd = 
"render", $a_posting_cmd = 
"preview", $a_link_template = null, $a_show_inactive = 
false)
 
 1329                 $max_detail_postings = 10;
 
 1331                 $wtpl = 
new ilTemplate(
"tpl.blog_list_navigation.html", 
true, 
true,
 
 1334                 $wtpl->setVariable(
"NAVIGATION_TITLE", $this->lng->txt(
"blog_navigation"));
 
 1336                 $ilCtrl->setParameter($this, 
"blpg", 
"");
 
 1338                 include_once 
"Services/Calendar/classes/class.ilCalendarUtil.php";
 
 1340                 foreach($items as 
$month => $postings)
 
 1343                                 " ".substr(
$month, 0, 4);
 
 1345                         if(!$a_link_template)
 
 1347                                 $ilCtrl->setParameter($this, 
"bmn", 
$month);
 
 1348                                 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
 
 1356                         if($counter < $max_detail_postings)
 
 1358                                 foreach($postings as $id => $posting)
 
 1361                                         if(!$is_active && !$a_show_inactive)
 
 1371                                         if(!$a_link_template)
 
 1373                                                 $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"bmn", 
$month);
 
 1374                                                 $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $id);
 
 1375                                                 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);                                       
 
 1384                                                 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
 
 1386                                         else if($this->object->hasApproval() && !$posting[
"approved"])
 
 1388                                                 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
 
 1391                                         $wtpl->setCurrentBlock(
"navigation_item");
 
 1392                                         $wtpl->setVariable(
"NAV_ITEM_URL", $url);
 
 1393                                         $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
 
 1394                                         $wtpl->parseCurrentBlock();                                                     
 
 1397                                 $wtpl->setCurrentBlock(
"navigation_month_details");
 
 1398                                 $wtpl->setVariable(
"NAV_MONTH", $month_name);
 
 1399                                 $wtpl->setVariable(
"URL_MONTH", $month_url);
 
 1400                                 $wtpl->parseCurrentBlock();
 
 1405                                 $wtpl->setCurrentBlock(
"navigation_month");
 
 1406                                 $wtpl->setVariable(
"MONTH_NAME", $month_name);                          
 
 1407                                 $wtpl->setVariable(
"URL_MONTH", $month_url);
 
 1408                                 $wtpl->setVariable(
"MONTH_COUNT", 
sizeof($postings));
 
 1409                                 $wtpl->parseCurrentBlock();
 
 1413                 $ilCtrl->setParameter($this, 
"bmn", $this->month);
 
 1414                 $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"bmn", 
"");
 
 1418                 if($this->id_type == self::REPOSITORY_NODE_ID)
 
 1421                         foreach($this->items as 
$month => $items)
 
 1423                                 foreach($items as $item)
 
 1427                                                 $authors[] = $item[
"author"];                                   
 
 1432                         $authors = array_unique($authors);                      
 
 1433                         if(
sizeof($authors) > 1)
 
 1435                                 include_once 
"Services/User/classes/class.ilUserUtil.php";
 
 1438                                 foreach($authors as $user_id)
 
 1442                                                 $ilCtrl->setParameter($this, 
"ath", $user_id);
 
 1443                                                 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
 
 1444                                                 $ilCtrl->setParameter($this, 
"ath", 
"");
 
 1447                                                 $idx = trim(strip_tags($name)).
"///".$user_id;  
 
 1448                                                 $list[$idx] = array($name, $url);       
 
 1453                                 $wtpl->setVariable(
"AUTHORS_TITLE", $this->lng->txt(
"blog_authors"));
 
 1455                                 $wtpl->setCurrentBlock(
"author");                               
 
 1458                                         $wtpl->setVariable(
"TXT_AUTHOR", $author[0]);                                                   
 
 1459                                         $wtpl->setVariable(
"URL_AUTHOR", $author[1]);                                                   
 
 1460                                         $wtpl->parseCurrentBlock();             
 
 1465                 if(!$a_link_template) 
 
 1469                                 !$a_link_template && $a_list_cmd != 
"preview" && $a_list_cmd != 
"gethtml");
 
 1471                         if($keywords || $may_edit_keywords)
 
 1473                                 $wtpl->setVariable(
"KEYWORDS_TITLE", $this->lng->txt(
"blog_keywords"));
 
 1477                                         $max = max($keywords);
 
 1478                                         include_once 
"Services/Tagging/classes/class.ilTagging.php";
 
 1480                                         $wtpl->setCurrentBlock(
"keyword");
 
 1481                                         foreach($keywords as 
$keyword => $counter)
 
 1483                                                 $ilCtrl->setParameter($this, 
"kwd", 
$keyword);
 
 1484                                                 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
 
 1485                                                 $ilCtrl->setParameter($this, 
"kwd", 
"");
 
 1487                                                 $wtpl->setVariable(
"TXT_KEYWORD", 
$keyword);                            
 
 1489                                                 $wtpl->setVariable(
"URL_KEYWORD", $url);
 
 1490                                                 $wtpl->parseCurrentBlock();                                     
 
 1495                                         $wtpl->setVariable(
"TXT_NO_KEYWORDS", $this->lng->txt(
"blog_no_keywords"));
 
 1498                                 if($may_edit_keywords)
 
 1500                                         $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", 
$_GET[
"blpg"]);
 
 1501                                         $wtpl->setVariable(
"URL_EDIT_KEYWORDS", 
 
 1502                                                 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"editKeywords"));             
 
 1503                                         $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", 
"");
 
 1504                                         $wtpl->setVariable(
"TXT_EDIT_KEYWORDS", $this->lng->txt(
"blog_edit_keywords"));                 
 
 1509                         if($this->object->hasRSS() && $ilSetting->get(
'enable_global_profiles') &&
 
 1510                                 !$a_link_template && $a_list_cmd == 
"preview")
 
 1514                                 if($this->id_type != self::WORKSPACE_NODE_ID)
 
 1518                                 $url = ILIAS_HTTP_PATH.
"/feed.php?blog_id=".$blog_id.
 
 1519                                         "&client_id=".rawurlencode(CLIENT_ID);
 
 1521                                 $wtpl->setCurrentBlock(
"rss");
 
 1522                                 $wtpl->setVariable(
"URL_RSS", $url);
 
 1524                                 $wtpl->parseCurrentBlock();
 
 1528                 return $wtpl->get();
 
 1540                 $keywords = array();
 
 1541                 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
 
 1577                 include_once(
"./Services/Export/classes/class.ilExport.php");
 
 1581                 $subdir = $this->
object->getType().
"_".$this->
object->getId();
 
 1582                 $export_dir = $exp_dir.
"/".$subdir;
 
 1589                 include_once(
"./Services/Style/classes/class.ilSystemStyleHTMLExport.php");
 
 1591             $this->sys_style_html_export->addImage(
"icon_blog_b.png");
 
 1592                 $this->sys_style_html_export->export();
 
 1595                 include_once(
"./Services/COPage/classes/class.ilCOPageHTMLExport.php");
 
 1597                 $this->co_page_html_export->createDirectories();
 
 1598                 $this->co_page_html_export->exportStyles();
 
 1599                 $this->co_page_html_export->exportSupportScripts();
 
 1603                 if($blga_set->get(
"banner"))
 
 1605                         $banner = $this->
object->getImageFullPath();
 
 1606                         copy($banner, $export_dir.
"/".basename($banner));
 
 1611                         $ppic = array_shift(explode(
"?", $ppic));
 
 1612                         copy($ppic, $export_dir.
"/".basename($ppic));
 
 1624                                 "/".$date.
"__".IL_INST_ID.
"__".
 
 1625                                 $this->object->getType().
"_".$this->
object->getId().
".zip";
 
 1642         function exportHTMLPages($a_target_directory, $a_link_template = null, $a_tpl_callback = null, $a_co_page_html_export = null, $a_index_name = 
"index.html")
 
 1644                 if(!$a_link_template)
 
 1646                         $a_link_template = 
"bl{TYPE}_{ID}.html";
 
 1649                 if($a_co_page_html_export)
 
 1651                         $this->co_page_html_export = $a_co_page_html_export;
 
 1658                 foreach(array_keys($this->items) as 
$month)
 
 1661                         $list = $this->
renderList($this->items[$month], $month, 
"render", $a_link_template);                    
 
 1663                         if(!$a_tpl_callback)
 
 1669                                 $tpl = call_user_func($a_tpl_callback);                         
 
 1677                                 copy(
$file, $a_target_directory.
"/".$a_index_name);
 
 1683                 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
 
 1684                 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 1686                 foreach ($pages as $page)
 
 1690                                 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
 
 1692                                 $blp_gui->setOutputMode(
"offline");
 
 1693                                 $blp_gui->setFullscreenLink(
"fullscreen.html"); 
 
 1694                                 $blp_gui->add_date = 
true;
 
 1695                                 $page_content = $blp_gui->showPage();
 
 1698                                         substr($page[
"created"]->
get(
IL_CAL_DATE), 0, 7));
 
 1702                                 if(!$a_tpl_callback)
 
 1708                                         $tpl = call_user_func($a_tpl_callback);                         
 
 1712                                         $page_content, $nav, $back);
 
 1714                                 $this->co_page_html_export->collectPageElements(
"blp:pg", $page[
"id"]);
 
 1717                 $this->co_page_html_export->exportPageElements();
 
 1730                 if($a_type == 
"list")
 
 1738                 $link = str_replace(
"{TYPE}", $a_type, $a_template);
 
 1739                 return str_replace(
"{ID}", $a_id, $link);
 
 1750                 global $ilTabs, 
$lng;
 
 1752                 $tpl = $this->co_page_html_export->getPreparedMainTemplate();
 
 1754                 $tpl->getStandardTemplate();
 
 1756                 $ilTabs->clearTargets();
 
 1759                         $ilTabs->setBackTarget($lng->txt(
"back"), $a_back_url);
 
 1763                 $tpl->setFrameFixedWidth(
true);
 
 1778         protected function writeExportFile($a_target_directory, $a_file, $a_tpl, $a_content, $a_right_content = null)
 
 1780                 $file = $a_target_directory.
"/".$a_file;
 
 1782                 if (@is_file(
$file))
 
 1788                 $ep_tpl = 
new ilTemplate(
"tpl.export_page.html", 
true, 
true,
 
 1790                 $ep_tpl->setVariable(
"PAGE_CONTENT", $a_content);               
 
 1793                 if($a_right_content)
 
 1795                         $ep_tpl->setVariable(
"RIGHT_CONTENT", $a_right_content);
 
 1798                 $a_tpl->setContent($ep_tpl->get());             
 
 1800                 $content = $a_tpl->get(
"DEFAULT", 
false, 
false, 
false,
 
 1804                 if (!file_put_contents(
$file, $content))
 
 1806                         die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
 1807                                         " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
 1829                 include_once 
"Modules/Exercise/classes/class.ilObjExerciseGUI.php";
 
 1831                 $exc_gui->submitBlog($this->node_id);
 
 1834                 $ilCtrl->redirect($this, 
"render");
 
 1848                 $this->disable_notes = (bool)$a_value;
 
 1856                 if($a_cmd == 
"preview" || 
$_GET[
"prvm"])
 
 1859                         if($ilUser->getId() != ANONYMOUS_USER_ID)                       
 
 1863                                         $ilCtrl->setParameter($this, 
"prvm", 
"fsc");
 
 1868                                         $ilCtrl->setParameter($this, 
"prvm", 
"");
 
 1887                 $sub_type = $sub_id = null;
 
 1891                         $sub_id = 
$_GET[
"blpg"];
 
 1898                         $lg->enableComments(
false);
 
 1899                         $lg->enableNotes(
false);
 
 1900                         $lg->enableTags(
false);         
 
 1902                         include_once 
"./Services/Notification/classes/class.ilNotification.php";
 
 1905                                 $ilCtrl->setParameter($this, 
"ntf", 1);
 
 1906                                 $link = $ilCtrl->getLinkTarget($this, 
"setNotification");
 
 1907                                 $lg->addCustomCommand($link, 
"blog_notification_toggle_off");
 
 1909                                 $lg->addHeaderIcon(
"not_icon",
 
 1911                                         $this->lng->txt(
"blog_notification_activated"));
 
 1915                                 $ilCtrl->setParameter($this, 
"ntf", 2);
 
 1916                                 $link = $ilCtrl->getLinkTarget($this, 
"setNotification");
 
 1917                                 $lg->addCustomCommand($link, 
"blog_notification_toggle_on");
 
 1919                                 $lg->addHeaderIcon(
"not_icon",
 
 1921                                         $this->lng->txt(
"blog_notification_deactivated"));
 
 1924                         $ilCtrl->setParameter($this, 
"ntf", 
"");
 
 1934                 include_once 
"./Services/Notification/classes/class.ilNotification.php";
 
 1935                 switch(
$_GET[
"ntf"])
 
 1946                 $ilCtrl->redirect($this, 
"preview");
 
 1959                 include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
 1961                 if($post->getBlogId() == $a_blog_id)
 
 1963                         return $post->getTitle();
 
 1974                 foreach($this->items as 
$month => $postings)
 
 1976                         foreach($postings as $id => $item)
 
 1980                                         unset($this->items[
$month][$id]);
 
 1982                                 else if($this->object->hasApproval() && !$item[
"approved"])
 
 1984                                         unset($this->items[
$month][$id]);
 
 1987                         if(!
sizeof($this->items[
$month]))
 
 1989                                 unset($this->items[$month]);
 
 1993                 if($this->items && !isset($this->items[$this->month]))
 
 1995                         $this->month = array_shift(array_keys($this->items));
 
 2002                 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
 
 2007                                 if(in_array($a_keyword,
 
 2029                 if($this->id_type == self::WORKSPACE_NODE_ID)
 
 2041                                         include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
 2043                                         $a_author_id = $post->getAuthor();                                      
 
 2045                                 if($ilUser->getId() == $a_author_id)
 
 2064                 if (is_object($this->
object))
 
 2066                         $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, 
""), 
"", 
$this->node_id);              
 
 2074                         include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
 2076                         $post->setApproved(
true);
 
 2082                 $this->ctrl->redirect($this, 
"render");
 
 2099                 $ilTabs->activateTab(
"contributors");
 
 2102                 include_once 
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
 
 2107                                 'auto_complete_name'    => $lng->txt(
'user'),
 
 2108                                 'submit_name'                   => $lng->txt(
'add')
 
 2112                 $ilToolbar->addSpacer();
 
 2114                 $ilToolbar->addButton(
 
 2115                         $lng->txt(
"blog_search_users"),
 
 2116                         $ilCtrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
''));
 
 2117                 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
 
 2119                 $parent_container_id = $this->
object->getParentContainerId($this->node_id);                     
 
 2120                 if ($parent_container_id) 
 
 2122                         $ilCtrl->setParameterByClass(
'ilRepositorySearchGUI', 
"list_obj", $parent_container_id);
 
 2124                         $ilToolbar->addSpacer();
 
 2126                         $ilToolbar->addButton($lng->txt(
"blog_contributor_container_add"), 
 
 2127                                 $ilCtrl->getLinkTarget($this, 
"addContributorContainer"));              
 
 2130                 $other_roles = $this->
object->getRolesWithContribute($this->node_id);
 
 2133                         ilUtil::sendInfo(sprintf($lng->txt(
"blog_contribute_other_roles"), implode(
", ", $other_roles)));
 
 2136                 include_once 
"Modules/Blog/classes/class.ilContributorTableGUI.php";
 
 2137                 $tbl = 
new ilContributorTableGUI($this, 
"contributors", $this->object->getLocalContributorRole($this->node_id));
 
 2139                 $tpl->setContent($tbl->getHTML());                                                      
 
 2151                 $ilTabs->activateTab(
"contributors");
 
 2153                 $members = $this->
object->getParentMemberIds($this->node_id);
 
 2156                         $ilCtrl->redirect($this, 
"contributors");
 
 2159                 include_once 
"Modules/Blog/classes/class.ilContributorTableGUI.php";
 
 2161                         $this->object->getLocalContributorRole($this->node_id), $members);
 
 2163                 $tpl->setContent($tbl->getHTML());
 
 2178                         $ilCtrl->redirect($this, 
"addContributorContainer");
 
 2191                 if(!strlen(trim(
$_POST[
'user_login'])))
 
 2196                 $users = explode(
',', 
$_POST[
'user_login']);
 
 2198                 $user_ids = array();
 
 2199                 foreach($users as $user)
 
 2209                         $user_ids[] = $user_id;
 
 2229                 if(!count($a_user_ids))
 
 2236                 $contr_role_id = $this->
object->getLocalContributorRole($this->node_id);
 
 2243                 foreach($a_user_ids as $user_id)
 
 2245                         if(!$rbacreview->isAssigned($user_id, $contr_role_id))
 
 2247                                 $rbacadmin->assignUser($contr_role_id, $user_id);
 
 2252                 $ilCtrl->redirect($this, 
"contributors");
 
 2267                         $ilCtrl->redirect($this, 
"contributors");
 
 2271                 $contr_role_id = $this->
object->getLocalContributorRole($this->node_id);
 
 2278                 foreach($ids as $user_id)
 
 2280                         $rbacadmin->deassignUser($contr_role_id, $user_id);
 
 2284                 $this->ctrl->redirect($this, 
"contributors");                           
 
 2294                 include_once 
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
 
 2306                 include_once 
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
 
 2316                         include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
 2318                         $post->setApproved(
false);
 
 2319                         $post->setActive(
false);
 
 2320                         $post->update(
true, 
false, 
false);
 
 2325                 $this->ctrl->redirect($this, 
"render");
 
 2335                 if(substr($a_target, -3) == 
"wsp")
 
 2337                         $id = explode(
"_", $a_target);          
 
 2339                         $_GET[
"baseClass"] = 
"ilSharedResourceGUI";     
 
 2340                         $_GET[
"wsp_id"] = $id[0];               
 
 2341                         if(
sizeof($id) == 3)
 
 2343                                 $_GET[
"gtp"] = $id[1];
 
 2348                         $id = explode(
"_", $a_target);          
 
 2350                         $_GET[
"baseClass"] = 
"ilRepositoryGUI"; 
 
 2351                         $_GET[
"ref_id"] = $id[0];               
 
 2352                         $_GET[
"cmd"] = 
"preview";
 
 2353                         if(
sizeof($id) == 2)
 
 2355                                 $_GET[
"gtp"] = $id[1];
 
 2359                 include(
"ilias.php");