5require_once 
"./Services/Object/classes/class.ilObject2GUI.php";
 
    6require_once 
"./Modules/Blog/classes/class.ilBlogPosting.php";
 
    7require_once 
"./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php";
 
  119    public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 
  124        $this->help = 
$DIC[
"ilHelp"];
 
  125        $this->tabs = 
$DIC->tabs();
 
  126        $this->nav_history = 
$DIC[
"ilNavigationHistory"];
 
  127        $this->
user = $DIC->user();
 
  128        $this->toolbar = 
$DIC->toolbar();
 
  129        $this->tree = 
$DIC->repositoryTree();
 
  130        $this->locator = 
$DIC[
"ilLocator"];
 
  131        $this->main_menu = 
$DIC[
"ilMainMenu"];
 
  132        $this->rbacreview = 
$DIC->rbac()->review();
 
  133        $this->rbacadmin = 
$DIC->rbac()->admin();
 
  138        $this->gtp = (int) 
$_GET[
"gtp"];
 
  139        $this->blpg = (int) $_REQUEST[
"blpg"];
 
  140        $this->old_nr = (int) 
$_GET[
"old_nr"];
 
  141        $this->ppage = (int) 
$_GET[
"ppage"];
 
  142        $this->user_page = (int) $_REQUEST[
"user_page"];
 
  145        $this->ntf = (int) 
$_GET[
"ntf"];
 
  146        $this->apid = (int) 
$_GET[
"apid"];
 
  149        $this->author = (int) $_REQUEST[
"ath"];
 
  150        $this->prt_id = (int) $_REQUEST[
"prt_id"];
 
  152        parent::__construct($a_id, $a_id_type, $a_parent_node_id);
 
  155            throw new ilException(
"Posting ID does not match blog.");
 
  163                if (!$this->month || !$this->items[$this->month]) {
 
  164                    $this->month = array_keys($this->items);
 
  165                    $this->month = array_shift($this->month);
 
  166                    $this->month_default = 
true;
 
  170            $ilCtrl->setParameter($this, 
"bmn", $this->month);
 
  173        $lng->loadLanguageModule(
"blog");
 
  174        $ilCtrl->saveParameter($this, 
"prvm");
 
  184        $forms = parent::initCreationForms($a_new_type);
 
  186        if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
  187            unset($forms[self::CFORM_IMPORT]);
 
  188            unset($forms[self::CFORM_CLONE]);
 
  198        ilUtil::sendSuccess($this->lng->txt(
"object_added"), 
true);
 
  210        $this->tabs_gui->addSubTab(
 
  212            $this->lng->txt(
"blog_properties"),
 
  213            $this->ctrl->getLinkTarget($this, 
'edit')
 
  216        $this->tabs_gui->addSubTab(
 
  218            $this->lng->txt(
"obj_sty"),
 
  219            $this->ctrl->getLinkTarget($this, 
'editStyleProperties')
 
  223        if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  224            $grp_ref_id = 
$tree->checkForParentType($this->object->getRefId(), 
'grp');
 
  225            $crs_ref_id = 
$tree->checkForParentType($this->object->getRefId(), 
'crs');
 
  227            if ((
int) $grp_ref_id > 0 || (
int) $crs_ref_id > 0) {
 
  228                if (
$access->checkAccess(
'write', 
'', $this->ref_id)) {
 
  229                    $this->tabs_gui->addSubTab(
 
  231                        $this->lng->txt(
"notifications"),
 
  232                        $this->ctrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui", 
'')
 
  238        $this->tabs_gui->activateSubTab($a_active);
 
  249        if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  251            $appr->setInfo(
$lng->txt(
"blog_enable_approval_info"));
 
  258        if (
$ilSetting->get(
'enable_global_profiles')) {
 
  260            $rss->setInfo(
$lng->txt(
"blog_enable_rss_info"));
 
  268        $nav->setTitle(
$lng->txt(
"blog_settings_navigation"));
 
  272        $nav_mode->setRequired(
true);
 
  276        $opt->setInfo(
$lng->txt(
"blog_nav_mode_month_list_info"));
 
  277        $nav_mode->addOption($opt);
 
  280        $mon_num = 
new ilNumberInputGUI(
$lng->txt(
"blog_nav_mode_month_list_num_month"), 
"nav_list_mon");
 
  281        $mon_num->setInfo(
$lng->txt(
"blog_nav_mode_month_list_num_month_info"));
 
  282        $mon_num->setSize(3);
 
  283        $mon_num->setMinValue(1);
 
  284        $opt->addSubItem($mon_num);
 
  286        $detail_num = 
new ilNumberInputGUI(
$lng->txt(
"blog_nav_mode_month_list_num_month_with_post"), 
"nav_list_mon_with_post");
 
  287        $detail_num->setInfo(
$lng->txt(
"blog_nav_mode_month_list_num_month_with_post_info"));
 
  289        $detail_num->setSize(3);
 
  291        $opt->addSubItem($detail_num);
 
  294        $opt->setInfo(
$lng->txt(
"blog_nav_mode_month_single_info"));
 
  295        $nav_mode->addOption($opt);
 
  297        $order_options = array();
 
  298        if ($this->object->getOrder()) {
 
  299            foreach ($this->object->getOrder() as $item) {
 
  300                $order_options[] = 
$lng->txt(
"blog_" . $item);
 
  304        if (!in_array(
$lng->txt(
"blog_navigation"), $order_options)) {
 
  305            $order_options[] = 
$lng->txt(
"blog_navigation");
 
  308        if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  309            if (!in_array(
$lng->txt(
"blog_authors"), $order_options)) {
 
  310                $order_options[] = 
$lng->txt(
"blog_authors");
 
  314            $auth->setInfo(
$lng->txt(
"blog_enable_nav_authors_info"));
 
  319        $keyw->setInfo(
$lng->txt(
"blog_enable_keywords_info"));
 
  322        if (!in_array(
$lng->txt(
"blog_keywords"), $order_options)) {
 
  323            $order_options[] = 
$lng->txt(
"blog_keywords");
 
  327        $order->setMultiValues($order_options);
 
  328        $order->setValue(array_shift($order_options));
 
  329        $order->setMulti(
true, 
true, 
false);
 
  336        $pres->setTitle(
$lng->txt(
"blog_presentation_frame"));
 
  339        if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  340            $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
 
  346        if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  347            $ppic->setInfo(
$lng->txt(
"blog_profile_picture_repository_info"));
 
  351        if ($blga_set->get(
"banner")) {
 
  352            include_once 
"Services/Form/classes/class.ilFileInputGUI.php";
 
  355            $dimensions = 
" (" . $blga_set->get(
"banner_width") . 
"x" .
 
  356                $blga_set->get(
"banner_height") . 
")";
 
  362            $file = $this->
object->getImageFullPath(
true);
 
  364                $img->setImage($file);
 
  379        $list->setTitle(
$lng->txt(
"blog_presentation_overview"));
 
  384        $post_num->setInfo(
$lng->txt(
"blog_list_num_postings_info"));
 
  385        $post_num->setSize(3);
 
  386        $post_num->setMinValue(1);
 
  387        $post_num->setRequired(
true);
 
  391        $a_form->
addItem($abs_shorten);
 
  394        $abs_shorten_len->setSize(5);
 
  395        $abs_shorten_len->setRequired(
true);
 
  396        $abs_shorten_len->setSuffix(
$lng->txt(
"blog_abstract_shorten_characters"));
 
  397        $abs_shorten_len->setMinValue(50, 
true);
 
  398        $abs_shorten->addSubItem($abs_shorten_len);
 
  401        $abs_img->setInfo(
$lng->txt(
"blog_abstract_image_info"));
 
  405        $abs_img_width->setSize(5);
 
  406        $abs_img_width->setRequired(
true);
 
  407        $abs_img_width->setSuffix(
$lng->txt(
"blog_abstract_image_pixels"));
 
  408        $abs_img_width->setMinValue(32, 
true);
 
  409        $abs_img->addSubItem($abs_img_width);
 
  412        $abs_img_height->setSize(5);
 
  413        $abs_img_height->setRequired(
true);
 
  414        $abs_img_height->setSuffix(
$lng->txt(
"blog_abstract_image_pixels"));
 
  415        $abs_img_height->setMinValue(32, 
true);
 
  416        $abs_img->addSubItem($abs_img_height);
 
  421        if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  422            $a_values[
"approval"] = $this->
object->hasApproval();
 
  423            $a_values[
"nav_authors"] = $this->
object->hasAuthors();
 
  425        $a_values[
"keywords"] = $this->
object->hasKeywords();
 
  426        $a_values[
"notes"] = $this->
object->getNotesStatus();
 
  427        $a_values[
"ppic"] = $this->
object->hasProfilePicture();
 
  432        $a_values[
"banner"] = $this->
object->getImage();
 
  433        $a_values[
"rss"] = $this->
object->hasRSS();
 
  434        $a_values[
"abss"] = $this->
object->hasAbstractShorten();
 
  435        $a_values[
"absi"] = $this->
object->hasAbstractImage();
 
  436        $a_values[
"nav"] = $this->
object->getNavMode();
 
  437        $a_values[
"nav_list_mon_with_post"] = $this->
object->getNavModeListMonthsWithPostings();
 
  438        $a_values[
"nav_list_mon"] = $this->
object->getNavModeListMonths();
 
  439        $a_values[
"ov_list_post_num"] = $this->
object->getOverviewPostings();
 
  452        if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  453            $this->
object->setApproval($a_form->
getInput(
"approval"));
 
  454            $this->
object->setAuthors($a_form->
getInput(
"nav_authors"));
 
  455            $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->saveTileImage();
 
  457        $this->
object->setKeywords($a_form->
getInput(
"keywords"));
 
  458        $this->
object->setNotesStatus($a_form->
getInput(
"notes"));
 
  459        $this->
object->setProfilePicture($a_form->
getInput(
"ppic"));
 
  464        $this->
object->setRSS($a_form->
getInput(
"rss"));
 
  465        $this->
object->setAbstractShorten($a_form->
getInput(
"abss"));
 
  466        $this->
object->setAbstractShortenLength($a_form->
getInput(
"abssl"));
 
  467        $this->
object->setAbstractImage($a_form->
getInput(
"absi"));
 
  468        $this->
object->setAbstractImageWidth($a_form->
getInput(
"absiw"));
 
  469        $this->
object->setAbstractImageHeight($a_form->
getInput(
"absih"));
 
  470        $this->
object->setNavMode($a_form->
getInput(
"nav"));
 
  471        $this->
object->setNavModeListMonthsWithPostings($a_form->
getInput(
"nav_list_mon_with_post"));
 
  472        $this->
object->setNavModeListMonths($a_form->
getInput(
"nav_list_mon"));
 
  473        $this->
object->setOverviewPostings($a_form->
getInput(
"ov_list_post_num"));
 
  475        $order = $a_form->
getInput(
"order");
 
  476        foreach ($order as $idx => $value) {
 
  477            if ($value == 
$lng->txt(
"blog_navigation")) {
 
  478                $order[$idx] = 
"navigation";
 
  479            } elseif ($value == 
$lng->txt(
"blog_keywords")) {
 
  480                $order[$idx] = 
"keywords";
 
  482                $order[$idx] = 
"authors";
 
  485        $this->
object->setOrder($order);
 
  489            if ($_FILES[
"banner"][
"tmp_name"]) {
 
  490                $this->
object->uploadImage($_FILES[
"banner"]);
 
  491            } elseif ($banner->getDeletionFlag()) {
 
  492                $this->
object->deleteImage();
 
  502        if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
  503            $this->ctrl->setParameter($this, 
"wsp_id", $this->node_id);
 
  506        $ilHelp->setScreenIdComponent(
"blog");
 
  509            $this->tabs_gui->addTab(
 
  511                $lng->txt(
"content"),
 
  512                $this->ctrl->getLinkTarget($this, 
"")
 
  516            $this->tabs_gui->addTab(
 
  518                $lng->txt(
"info_short"),
 
  519                $this->ctrl->getLinkTargetByClass(array(
"ilobjbloggui", 
"ilinfoscreengui"), 
"showSummary")
 
  524            $this->tabs_gui->addTab(
 
  526                $lng->txt(
"settings"),
 
  527                $this->ctrl->getLinkTarget($this, 
"edit")
 
  530            if (!$this->prtf_embed) {
 
  531                if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  532                    $this->tabs_gui->addTab(
 
  534                        $lng->txt(
"blog_contributors"),
 
  535                        $this->ctrl->getLinkTarget($this, 
"contributors")
 
  539                if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  540                    $this->tabs_gui->addTab(
 
  543                        $this->ctrl->getLinkTargetByClass(
"ilexportgui", 
"")
 
  549        if (!$this->prtf_embed) {
 
  551                $this->tabs_gui->addNonTabbedLink(
 
  553                    $lng->txt(
"blog_preview"),
 
  554                    $this->ctrl->getLinkTarget($this, 
"preview")
 
  570        if ($this->gtp > 0) {
 
  572            include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
  575                $ilCtrl->setCmdClass(
"ilblogpostinggui");
 
  576                $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $page_id);
 
  577                $ilCtrl->redirectByClass(
"ilblogpostinggui", 
"previewFullscreen");
 
  583        $next_class = 
$ilCtrl->getNextClass($this);
 
  586        if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  591                $link = 
$ilCtrl->getLinkTargetByClass([
"ilrepositorygui", 
"ilObjBlogGUI"], 
"preview");
 
  592                $ilNavigationHistory->addItem($this->node_id, $link, 
"blog");
 
  596        switch ($next_class) {
 
  597            case 'ilblogpostinggui':
 
  598                if (!$this->prtf_embed) {
 
  599                    $tpl->getStandardTemplate();
 
  608                if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  611                    include_once 
"Services/Form/classes/class.ilFileInputGUI.php";
 
  614                $ilTabs->setBackTarget(
 
  616                    $ilCtrl->getLinkTarget($this, 
"")
 
  620                    $this->object->getStyleSheetId(),
 
  624                include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
 
  630                    ($this->object->getNotesStatus() && !$this->disable_notes),
 
  631                    $this->mayEditPosting($this->blpg),
 
  638                    case "previewFullscreen":
 
  639                        $ilCtrl->setParameter($this, 
"prvm", 
"fsc");
 
  643                    case "previewEmbedded":
 
  644                        $ilCtrl->setParameter($this, 
"prvm", 
"emb");
 
  652                        if (!$this->prtf_embed) {
 
  653                            $this->ctrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $this->blpg);
 
  654                            $this->tabs_gui->addNonTabbedLink(
 
  656                                $lng->txt(
"blog_preview"),
 
  657                                $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui", 
"previewFullscreen")
 
  659                            $this->ctrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", 
"");
 
  661                            $this->ctrl->setParameterByClass(
"ilobjportfoliogui", 
"user_page", $this->ppage);
 
  662                            $this->tabs_gui->addNonTabbedLink(
 
  664                                $lng->txt(
"blog_preview"),
 
  665                                $this->ctrl->getLinkTargetByClass(
"ilobjportfoliogui", 
"preview")
 
  667                            $this->ctrl->setParameterByClass(
"ilobjportfoliogui", 
"user_page", 
"");
 
  674                    $cmd = 
"preview" . (($this->prvm == 
"fsc") ? 
"Fullscreen" : 
"Embedded");
 
  676                if (in_array($cmd, array(
"previewFullscreen", 
"previewEmbedded"))) {
 
  684                    $is_active = $bpost_gui->getBlogPosting()->getActive();
 
  687                    if (($cmd == 
"previewFullscreen" || $cmd == 
"previewEmbedded")
 
  688                        && !$is_owner && !$is_active) {
 
  689                        $this->ctrl->redirect($this, 
"preview");
 
  694                        case "previewFullscreen":
 
  702                        case "previewEmbedded":
 
  713                                if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
  716                                    $info[] = 
$lng->txt(
"blog_draft_info_contributors");
 
  719                            if ($cmd != 
"history" && $is_active && empty(
$info)) {
 
  720                                $info[] = 
$lng->txt(
"blog_new_posting_info");
 
  721                                $public_action = 
true;
 
  723                            if ($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved()) {
 
  725                                $info[] = 
$lng->txt(
"blog_posting_edit_approval_info");
 
  727                            if (
sizeof(
$info) && !
$tpl->hasMessage(
"info")) { 
 
  728                                if ($public_action) {
 
  729                                    ilUtil::sendSuccess(implode(
"<br />", 
$info));
 
  737                            $nav = $this->
renderNavigation($this->items, 
"render", $cmd, 
null, $is_owner);
 
  738                            $tpl->setRightContent($nav);
 
  744            case "ilinfoscreengui":
 
  754            case "ilcommonactiondispatchergui":
 
  755                include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
 
  757                $this->ctrl->forwardCommand($gui);
 
  760            case "ilpermissiongui":
 
  762                $ilTabs->activateTab(
"id_permissions");
 
  763                include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
  765                $this->ctrl->forwardCommand($perm_gui);
 
  768            case "ilobjectcopygui":
 
  770                include_once 
"./Services/Object/classes/class.ilObjectCopyGUI.php";
 
  772                $cp->setType(
"blog");
 
  773                $this->ctrl->forwardCommand($cp);
 
  776            case 'ilrepositorysearchgui':
 
  778                $ilTabs->activateTab(
"contributors");
 
  779                include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
 
  781                $rep_search->setTitle($this->lng->txt(
"blog_add_contributor"));
 
  782                $rep_search->setCallback($this, 
'addContributor', $this->object->getAllLocalRoles($this->node_id));
 
  783                $this->ctrl->setReturn($this, 
'contributors');
 
  784                $ret = &$this->ctrl->forwardCommand($rep_search);
 
  789                $ilTabs->activateTab(
"export");
 
  790                include_once(
"./Services/Export/classes/class.ilExportGUI.php");
 
  792                $exp_gui->addFormat(
"xml");
 
  793                $exp_gui->addFormat(
"html", 
null, $this, 
"buildExportFile"); 
 
  797            case "ilobjstylesheetgui":
 
  798                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
 
  799                $this->ctrl->setReturn($this, 
"editStyleProperties");
 
  800                $style_gui = 
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(), 
false, 
false);
 
  801                $style_gui->omitLocator();
 
  802                if ($cmd == 
"create" || $this->new_type == 
"sty") {
 
  803                    $style_gui->setCreationMode(
true);
 
  806                if ($cmd == 
"confirmedDelete") {
 
  807                    $this->
object->setStyleSheetId(0);
 
  808                    $this->
object->update();
 
  811                $ret = $this->ctrl->forwardCommand($style_gui);
 
  813                if ($cmd == 
"save" || $cmd == 
"copyStyle" || $cmd == 
"importStyle") {
 
  815                    $this->
object->setStyleSheetId($style_id);
 
  816                    $this->
object->update();
 
  817                    $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"edit");
 
  821            case "ilblogexercisegui":
 
  822                $this->ctrl->setReturn($this, 
"render");
 
  823                include_once 
"Modules/Blog/classes/class.ilBlogExerciseGUI.php";
 
  825                $this->ctrl->forwardCommand($gui);
 
  828            case 'ilobjnotificationsettingsgui':
 
  830                $ilTabs->activateTab(
"settings");
 
  832                include_once(
"./Services/Notification/classes/class.ilObjNotificationSettingsGUI.php");
 
  834                $this->ctrl->forwardCommand($gui);
 
  838                if ($cmd != 
"gethtml") {
 
  840                    if ($cmd == 
"addToDesk" || $cmd == 
"removeFromDesk") {
 
  841                        $this->{$cmd . 
"Object"}();
 
  851                if (!$this->prtf_embed) {
 
  852                    return parent::executeCommand();
 
  859                    return $this->$cmd();
 
  873        $this->ctrl->setCmd(
"showSummary");
 
  874        $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
  885        $ilTabs->activateTab(
"id_info");
 
  889        include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
  892        if ($this->id_type != self::WORKSPACE_NODE_ID) {
 
  893            $info->enablePrivateNotes();
 
  901        $info->enableNewsEditing(
false);
 
  904            $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
  906            if ($enable_internal_rss) {
 
  907                $info->setBlockProperty(
"news", 
"settings", 
true);
 
  908                $info->setBlockProperty(
"news", 
"public_notifications_option", 
true);
 
  913        $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
 
  915        if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
  916            $info->addProperty($this->lng->txt(
"perma_link"), $this->getPermanentLinkWidget());
 
  919        $this->ctrl->forwardCommand(
$info);
 
  933            include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
 
  935            $posting->setTitle(
$title);
 
  936            $posting->setBlogId($this->object->getId());
 
  937            $posting->setActive(
false);
 
  938            $posting->setAuthor(
$ilUser->getId());
 
  942            $ilCtrl->setParameter($this, 
"bmn", date(
"Y-m"));
 
  944            $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $posting->getId());
 
  945            $ilCtrl->redirectByClass(
"ilblogpostinggui", 
"edit");
 
  948            $ilCtrl->redirect($this, 
"render");
 
  973        $ilTabs->activateTab(
"content");
 
  977            $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this, 
"createPosting"));
 
  979            include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  981            $ilToolbar->addStickyItem(
$title, 
$lng->txt(
"title"));
 
  983            include_once 
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
 
  985            $button->setCaption(
"blog_add_posting");
 
  986            $button->setCommand(
"createPosting");
 
  987            $ilToolbar->addStickyItem($button);
 
  990            $first = array_shift((array_keys($this->items)));
 
  991            if ($first != $this->month) {
 
  992                $ilToolbar->addSeparator();
 
  994                $ilCtrl->setParameter($this, 
"bmn", $first);
 
  996                $ilCtrl->setParameter($this, 
"bmn", $this->month);
 
  998                include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
 1000                $button->setCaption(
"blog_show_latest");
 
 1001                $button->setUrl(
$url);
 
 1002                $ilToolbar->addButtonInstance($button);
 
 1006            include_once 
"Modules/Blog/classes/class.ilBlogExerciseGUI.php";
 
 1018            $nav = $this->
renderNavigation($this->items, 
"render", 
"preview", 
null, $is_owner);
 
 1024        $tpl->setRightContent($nav);
 
 1039        if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
 1052            $nav = $this->
renderNavigation($this->items, 
"gethtml", 
"previewEmbedded");
 
 1055        elseif ($this->prt_id) {
 
 1059                $ilCtrl->setParameterByClass(
"ilportfoliopagegui", 
"ppage", $this->user_page);
 
 1060                $link = 
$ilCtrl->getLinkTargetByClass(array(
"ilportfoliopagegui", 
"ilobjbloggui"), 
"render");
 
 1061                $ilCtrl->setParameterByClass(
"ilportfoliopagegui", 
"ppage", 
"");
 
 1063                include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
 1065                $btn->setCaption(sprintf(
$lng->txt(
"prtf_edit_embedded_blog"), $this->object->getTitle()), 
false);
 
 1066                $btn->setUrl($link);
 
 1067                $btn->setPrimary(
true);
 
 1069                $list = $btn->render();
 
 1084        if ($this->author) {
 
 1085            $list_items = array();
 
 1088                    if ($item[
"author"] == $this->author ||
 
 1089                        (is_array($item[
"editors"]) && in_array($this->author, $item[
"editors"]))) {
 
 1090                        $list_items[
$id] = $item;
 
 1094        } elseif ($this->keyword) {
 
 1095            $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
 
 1097            $max = $this->
object->getOverviewPostings();
 
 1098            if ($this->month_default && $max) {
 
 1099                $list_items = array();
 
 1100                foreach ($this->items as 
$month => $postings) {
 
 1101                    foreach ($postings as 
$id => $item) {
 
 1102                        if (!$a_show_inactive &&
 
 1106                        $list_items[
$id] = $item;
 
 1108                        if (
sizeof($list_items) >= $max) {
 
 1142            $nav = $this->
renderNavigation($this->items, 
"preview", 
"previewFullscreen");
 
 1172        $wtpl = 
new ilTemplate(
"tpl.blog_embedded.html", 
true, 
true, 
"Modules/Blog");
 
 1174        $wtpl->setVariable(
"VAL_NAVIGATION", $a_nav);
 
 1175        return $wtpl->get();
 
 1191        $owner = $this->
object->getOwner();
 
 1193        $ilTabs->clearTargets();
 
 1194        $ilLocator->clearItems();
 
 1200        if ($owner == 
$ilUser->getId()) {
 
 1202            if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
 1203                $back = 
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=" . 
$this->node_id;
 
 1207                $this->ctrl->setParameter($this, 
"prvm", 
"");
 
 1208                if ($this->blpg == 0) {
 
 1209                    $back = $this->ctrl->getLinkTarget($this, 
"");
 
 1211                    $this->ctrl->setParameterByClass(
"ilblogpostinggui", 
"bmn", $this->month);
 
 1212                    $this->ctrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $this->blpg);
 
 1213                    $back = $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui", 
"preview");
 
 1215                $this->ctrl->setParameter($this, 
"prvm", $this->prvm);
 
 1218            $back_caption = $this->lng->txt(
"blog_back_to_blog_owner");
 
 1221        elseif (
$ilUser->getId() && 
$ilUser->getId() != ANONYMOUS_USER_ID) {
 
 1223            if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
 1224                $back = 
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=" . $owner;
 
 1228                $back = $this->ctrl->getLinkTarget($this, 
"");
 
 1229                $back_caption = $this->lng->txt(
"blog_back_to_blog_owner");
 
 1235                include_once 
"Services/Link/classes/class.ilLink.php";
 
 1242        $ilMainMenu->setTopBarBack($back, $back_caption);
 
 1247        $this->ctrl->setParameter($this, 
"bmn", 
"");
 
 1248        $tpl->setTitleUrl($this->ctrl->getLinkTarget($this, 
"preview"));
 
 1249        $this->ctrl->setParameter($this, 
"bmn", $this->month);
 
 1255        $tpl->setRightContent($a_navigation);
 
 1270            require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
 
 1272                $this->object->getType(),
 
 1274                $this->object->getId(),
 
 1281        if ($this->id_type != self::REPOSITORY_NODE_ID) {
 
 1289        if ($blga_set->get(
"banner")) {
 
 1290            require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
 
 1292            $banner_width = $blga_set->get(
"banner_width");
 
 1293            $banner_height = $blga_set->get(
"banner_height");
 
 1295                $banner = basename($banner);
 
 1300        if ($this->object->hasProfilePicture()) {
 
 1302            if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
 1304                if ($this->blpg > 0 && !$a_export) {
 
 1305                    include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
 1307                    $author_id = 
$post->getAuthor();
 
 1309                        $ppic = ilObjUser::_getPersonalPicturePath($author_id, 
"xsmall", 
true, 
true);
 
 1318                $ppic = ilObjUser::_getPersonalPicturePath($a_user_id, 
"xsmall", 
true, 
true);
 
 1320                    $ppic = basename($ppic);
 
 1325        $a_tpl->resetHeaderBlock(
false);
 
 1327        $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
 
 1328        $a_tpl->setTitleIcon($ppic);
 
 1329        $a_tpl->setTitle($this->object->getTitle());
 
 1331        $a_tpl->setDescription(
$name);
 
 1334        $a_tpl->setVariable(
"LOCATOR", 
"");
 
 1348        $author_found = 
false;
 
 1352            if ($this->author &&
 
 1353                ($posting[
"author"] == $this->author ||
 
 1354                (is_array($posting[
"editors"]) && in_array($this->author, $posting[
"editors"])))) {
 
 1355                $author_found = 
true;
 
 1362        if ($this->author && !$author_found) {
 
 1363            $this->author = 
null;
 
 1379    public function renderList(array 
$items, $a_cmd = 
"preview", $a_link_template = 
null, $a_show_inactive = 
false, $a_export_directory = 
null)
 
 1385        include_once 
"Services/Calendar/classes/class.ilCalendarUtil.php";
 
 1386        $wtpl = 
new ilTemplate(
"tpl.blog_list.html", 
true, 
true, 
"Modules/Blog");
 
 1389        if ($this->prt_id > 0 &&
 
 1390            stristr($a_cmd, 
"embedded")) {
 
 1393                $ilCtrl->setParameterByClass(
"ilportfoliopagegui", 
"ppage", $this->user_page);
 
 1394                $link = 
$ilCtrl->getLinkTargetByClass(array(
"ilportfoliopagegui", 
"ilobjbloggui"), 
"render");
 
 1395                $ilCtrl->setParameterByClass(
"ilportfoliopagegui", 
"ppage", 
"");
 
 1397                include_once 
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
 
 1399                $list->setListTitle(
$lng->txt(
"action"));
 
 1401                    sprintf(
$lng->txt(
"prtf_edit_embedded_blog"), $this->object->getTitle()),
 
 1413                $wtpl->setCurrentBlock(
"prtf_edit_bl");
 
 1414                $wtpl->setVariable(
"PRTF_BLOG_EDIT", 
$list->getHTML());
 
 1415                $wtpl->parseCurrentBlock();
 
 1421        include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
 
 1424        foreach (
$items as $item) {
 
 1427            if (!$is_active && !$a_show_inactive) {
 
 1433            if (!$this->keyword && !$this->author) {
 
 1437            if (!$last_month || $last_month != 
$month) {
 
 1439                    $wtpl->setCurrentBlock(
"month_bl");
 
 1440                    $wtpl->parseCurrentBlock();
 
 1444                if ($this->keyword) {
 
 1446                } elseif ($this->author) {
 
 1447                    include_once 
"Services/User/classes/class.ilUserUtil.php";
 
 1450                    include_once 
"Services/Calendar/classes/class.ilCalendarUtil.php";
 
 1452                            " " . substr(
$month, 0, 4);
 
 1457                $wtpl->setVariable(
"TXT_CURRENT_MONTH", 
$title);
 
 1460            if (!$a_link_template) {
 
 1461                $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"bmn", $this->month);
 
 1462                $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $item[
"id"]);
 
 1469            $posting_edit = $this->
mayEditPosting($item[
"id"], $item[
"author"]);
 
 1470            if (($posting_edit || $is_admin) && !$a_link_template && $a_cmd == 
"preview") {
 
 1471                include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
 
 1473                $alist->setId($item[
"id"]);
 
 1474                $alist->setListTitle(
$lng->txt(
"actions"));
 
 1476                if ($is_active && $this->object->hasApproval() && !$item[
"approved"]) {
 
 1478                        $ilCtrl->setParameter($this, 
"apid", $item[
"id"]);
 
 1480                            $lng->txt(
"blog_approve"),
 
 1482                            $ilCtrl->getLinkTarget($this, 
"approve")
 
 1484                        $ilCtrl->setParameter($this, 
"apid", 
"");
 
 1487                    $wtpl->setVariable(
"APPROVAL", 
$lng->txt(
"blog_needs_approval"));
 
 1490                if ($posting_edit) {
 
 1492                        $lng->txt(
"edit_content"),
 
 1494                        $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"edit")
 
 1500                            $lng->txt(
"blog_toggle_draft"),
 
 1502                            $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"deactivatePageToList")
 
 1506                            $lng->txt(
"blog_toggle_final"),
 
 1508                            $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"activatePageToList")
 
 1513                        $lng->txt(
"rename"),
 
 1515                        $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"edittitle")
 
 1518                    if ($this->object->hasKeywords()) { 
 
 1520                            $lng->txt(
"blog_edit_keywords"),
 
 1522                            $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"editKeywords")
 
 1527                        $lng->txt(
"blog_edit_date"),
 
 1529                        $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"editdate")
 
 1532                        $lng->txt(
"delete"),
 
 1534                        $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"deleteBlogPostingConfirmationScreen")
 
 1536                } elseif ($is_admin) {
 
 1539                        $ilCtrl->setParameter($this, 
"apid", $item[
"id"]);
 
 1541                            $lng->txt(
"blog_toggle_draft_admin"),
 
 1543                            $ilCtrl->getLinkTarget($this, 
"deactivateAdmin")
 
 1545                        $ilCtrl->setParameter($this, 
"apid", 
"");
 
 1549                        $lng->txt(
"delete"),
 
 1551                        $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"deleteBlogPostingConfirmationScreen")
 
 1555                $wtpl->setCurrentBlock(
"actions");
 
 1556                $wtpl->setVariable(
"ACTION_SELECTOR", $alist->getHTML());
 
 1557                $wtpl->parseCurrentBlock();
 
 1561            if ($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes) {
 
 1563                include_once(
"Services/Notes/classes/class.ilNote.php");
 
 1571                if ($a_cmd != 
"preview") {
 
 1572                    $wtpl->setCurrentBlock(
"comments");
 
 1573                    $wtpl->setVariable(
"TEXT_COMMENTS", 
$lng->txt(
"blog_comments"));
 
 1574                    $wtpl->setVariable(
"URL_COMMENTS", 
$preview);
 
 1575                    $wtpl->setVariable(
"COUNT_COMMENTS", $count);
 
 1576                    $wtpl->parseCurrentBlock();
 
 1589            if ($a_cmd != 
"preview" && $a_cmd != 
"previewEmbedded") {
 
 1590                if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
 1591                    $goto = $this->
getAccessHandler()->getGotoLink($this->node_id, $this->obj_id, 
"_" . $item[
"id"]);
 
 1593                    include_once 
"Services/Link/classes/class.ilLink.php";
 
 1596                $wtpl->setCurrentBlock(
"permalink");
 
 1597                $wtpl->setVariable(
"URL_PERMALINK", $goto);
 
 1598                $wtpl->setVariable(
"TEXT_PERMALINK", 
$lng->txt(
"blog_permanent_link"));
 
 1599                $wtpl->parseCurrentBlock();
 
 1604                $this->object->hasAbstractShorten(),
 
 1605                $this->object->getAbstractShortenLength(),
 
 1607                $this->object->hasAbstractImage(),
 
 1608                $this->object->getAbstractImageWidth(),
 
 1609                $this->object->getAbstractImageHeight(),
 
 1614                $wtpl->setCurrentBlock(
"more");
 
 1615                $wtpl->setVariable(
"URL_MORE", 
$preview);
 
 1616                $wtpl->setVariable(
"TEXT_MORE", 
$lng->txt(
"blog_list_more"));
 
 1617                $wtpl->parseCurrentBlock();
 
 1623                $wtpl->setCurrentBlock(
"draft_text");
 
 1624                $wtpl->setVariable(
"DRAFT_TEXT", 
$lng->txt(
"blog_draft_text"));
 
 1625                $wtpl->parseCurrentBlock();
 
 1626                $wtpl->setVariable(
"DRAFT_CLASS", 
" ilBlogListItemDraft");
 
 1629            $wtpl->setCurrentBlock(
"posting");
 
 1632            if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
 1635                $author_id = $item[
"author"];
 
 1637                    include_once 
"Services/User/classes/class.ilUserUtil.php";
 
 1641                if (is_array($item[
"editors"])) {
 
 1642                    foreach ($item[
"editors"] as $editor_id) {
 
 1648                    $author = implode(
", ", $authors) . 
" - ";
 
 1653            $wtpl->setVariable(
"URL_TITLE", 
$preview);
 
 1654            $wtpl->setVariable(
"TITLE", $item[
"title"]);
 
 1658            $keywords = (count($kw) > 0)
 
 1659                ? 
"<br>" . $this->lng->txt(
"keywords") . 
": " . implode(
", ", $kw)
 
 1662            $wtpl->setVariable(
"DATETIME", 
$author .
 
 1666            $wtpl->setVariable(
"CONTENT", $snippet);
 
 1668            $wtpl->parseCurrentBlock();
 
 1672        if ($a_cmd == 
"previewFullscreen") {
 
 1673            $this->tpl->setPermanentLink(
 
 1676                ($this->id_type == self::WORKSPACE_NODE_ID)
 
 1682        if (!$is_empty || $a_show_inactive) {
 
 1683            return $wtpl->get();
 
 1697    protected function renderNavigationByDate(array $a_items, $a_list_cmd = 
"render", $a_posting_cmd = 
"preview", $a_link_template = 
null, $a_show_inactive = 
false, $a_blpg = 0)
 
 1701        $blpg = ($a_blpg > 0)
 
 1707        foreach ($a_items as 
$month => $postings) {
 
 1708            foreach (array_keys($postings) as 
$id) {
 
 1710                if (!$a_show_inactive && !$active) {
 
 1713                    $a_items[
$month][
$id][
"active"] = $active;
 
 1716            if (!
sizeof($a_items[
$month])) {
 
 1724            $max_months = $this->
object->getNavModeListMonths();
 
 1726            $wtpl = 
new ilTemplate(
"tpl.blog_list_navigation_by_date.html", 
true, 
true, 
"Modules/Blog");
 
 1728            $ilCtrl->setParameter($this, 
"blpg", 
"");
 
 1730            include_once 
"Services/Calendar/classes/class.ilCalendarUtil.php";
 
 1731            $counter = $mon_counter = $last_year = 0;
 
 1732            foreach ($a_items as 
$month => $postings) {
 
 1733                if (!$a_link_template && $max_months && $mon_counter >= $max_months) {
 
 1738                $year = substr(
$month, 0, 4);
 
 1739                if (!$last_year || $year != $last_year) {
 
 1749                if (!$a_link_template) {
 
 1751                    $month_url = 
$ilCtrl->getLinkTarget($this, $a_list_cmd);
 
 1758                if ($mon_counter <= $this->object->getNavModeListMonthsWithPostings()) {
 
 1760                        $wtpl->setCurrentBlock(
"navigation_year_details");
 
 1761                        $wtpl->setVariable(
"YEAR", $year);
 
 1762                        $wtpl->parseCurrentBlock();
 
 1765                    foreach ($postings as 
$id => $posting) {
 
 1776                        if (!$a_link_template) {
 
 1777                            $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"bmn", 
$month);
 
 1778                            $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", 
$id);
 
 1779                            $url = 
$ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
 
 1784                        if (!$posting[
"active"]) {
 
 1785                            $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
 
 1786                        } elseif ($this->object->hasApproval() && !$posting[
"approved"]) {
 
 1787                            $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
 
 1790                        $wtpl->setCurrentBlock(
"navigation_item");
 
 1791                        $wtpl->setVariable(
"NAV_ITEM_URL", 
$url);
 
 1792                        $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
 
 1793                        $wtpl->parseCurrentBlock();
 
 1796                    $wtpl->setCurrentBlock(
"navigation_month_details");
 
 1797                    $wtpl->setVariable(
"NAV_MONTH", $month_name);
 
 1798                    $wtpl->setVariable(
"URL_MONTH", $month_url);
 
 1799                    $wtpl->parseCurrentBlock();
 
 1804                        $wtpl->setCurrentBlock(
"navigation_year");
 
 1805                        $wtpl->setVariable(
"YEAR", $year);
 
 1806                        $wtpl->parseCurrentBlock();
 
 1809                    $wtpl->setCurrentBlock(
"navigation_month");
 
 1810                    $wtpl->setVariable(
"MONTH_NAME", $month_name);
 
 1811                    $wtpl->setVariable(
"URL_MONTH", $month_url);
 
 1812                    $wtpl->setVariable(
"MONTH_COUNT", 
sizeof($postings));
 
 1813                    $wtpl->parseCurrentBlock();
 
 1817            $ilCtrl->setParameter($this, 
"bmn", $this->month);
 
 1818            $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"bmn", 
"");
 
 1820            return $wtpl->get();
 
 1824            $wtpl = 
new ilTemplate(
"tpl.blog_list_navigation_month.html", 
true, 
true, 
"Modules/Blog");
 
 1826            $ilCtrl->setParameter($this, 
"blpg", 
"");
 
 1828            include_once 
"Services/Calendar/classes/class.ilCalendarUtil.php";
 
 1829            $month_options = array();
 
 1830            foreach ($a_items as 
$month => $postings) {
 
 1832                    " " . substr(
$month, 0, 4);
 
 1834                $month_options[
$month] = $month_name;
 
 1836                if (
$month == $this->month) {
 
 1837                    if (!$a_link_template) {
 
 1839                        $month_url = 
$ilCtrl->getLinkTarget($this, $a_list_cmd);
 
 1844                    foreach ($postings as 
$id => $posting) {
 
 1848                        if (!$a_link_template) {
 
 1849                            $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"bmn", 
$month);
 
 1850                            $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", 
$id);
 
 1851                            $url = 
$ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
 
 1856                        if (!$posting[
"active"]) {
 
 1857                            $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->lng->txt(
"blog_draft"));
 
 1858                        } elseif ($this->object->hasApproval() && !$posting[
"approved"]) {
 
 1859                            $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->lng->txt(
"blog_needs_approval"));
 
 1862                        $wtpl->setCurrentBlock(
"navigation_item");
 
 1863                        $wtpl->setVariable(
"NAV_ITEM_URL", 
$url);
 
 1864                        $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
 
 1865                        $wtpl->parseCurrentBlock();
 
 1868                    $wtpl->setCurrentBlock(
"navigation_month_details");
 
 1870                        $wtpl->setVariable(
"NAV_MONTH", $month_name);
 
 1871                        $wtpl->setVariable(
"URL_MONTH", $month_url);
 
 1873                    $wtpl->parseCurrentBlock();
 
 1878                $wtpl->setCurrentBlock(
"option_bl");
 
 1879                foreach ($month_options as $value => $caption) {
 
 1880                    $wtpl->setVariable(
"OPTION_VALUE", $value);
 
 1881                    $wtpl->setVariable(
"OPTION_CAPTION", $caption);
 
 1882                    if ($value == $this->month) {
 
 1883                        $wtpl->setVariable(
"OPTION_SEL", 
' selected="selected"');
 
 1885                    $wtpl->parseCurrentBlock();
 
 1888                $wtpl->setVariable(
"FORM_ACTION", 
$ilCtrl->getFormAction($this, $a_list_cmd));
 
 1891            $ilCtrl->setParameter($this, 
"bmn", $this->month);
 
 1892            $ilCtrl->setParameterByClass(
"ilblogpostinggui", 
"bmn", 
"");
 
 1894            return $wtpl->get();
 
 1906        $a_list_cmd = 
"render",
 
 1907        $a_show_inactive = 
false,
 
 1908        $a_link_template = 
false,
 
 1913        $blpg = ($a_blpg > 0)
 
 1919            $wtpl = 
new ilTemplate(
"tpl.blog_list_navigation_keywords.html", 
true, 
true, 
"Modules/Blog");
 
 1921            $max = max($keywords);
 
 1922            include_once 
"Services/Tagging/classes/class.ilTagging.php";
 
 1924            $wtpl->setCurrentBlock(
"keyword");
 
 1925            foreach ($keywords as 
$keyword => $counter) {
 
 1926                if (!$a_link_template) {
 
 1928                    $url = 
$ilCtrl->getLinkTarget($this, $a_list_cmd);
 
 1929                    $ilCtrl->setParameter($this, 
"kwd", 
"");
 
 1934                $wtpl->setVariable(
"TXT_KEYWORD", 
$keyword);
 
 1936                $wtpl->setVariable(
"URL_KEYWORD", 
$url);
 
 1937                $wtpl->parseCurrentBlock();
 
 1940            return $wtpl->get();
 
 1950            foreach (
$items as $item) {
 
 1952                    if ($item[
"author"]) {
 
 1953                        $authors[] = $item[
"author"];
 
 1956                    if (is_array($item[
"editors"])) {
 
 1957                        foreach ($item[
"editors"] as $editor_id) {
 
 1958                            if ($editor_id != $item[
"author"]) {
 
 1959                                $authors[] = $editor_id;
 
 1967        $authors = array_unique($authors);
 
 1968        if (
sizeof($authors) > 1) {
 
 1969            include_once 
"Services/User/classes/class.ilUserUtil.php";
 
 1972            foreach ($authors as $user_id) {
 
 1974                    $ilCtrl->setParameter($this, 
"ath", $user_id);
 
 1975                    $url = 
$ilCtrl->getLinkTarget($this, $a_list_cmd);
 
 1976                    $ilCtrl->setParameter($this, 
"ath", 
"");
 
 1979                    $idx = trim(strip_tags(
$name)) . 
"///" . $user_id;  
 
 1985            $wtpl = 
new ilTemplate(
"tpl.blog_list_navigation_authors.html", 
true, 
true, 
"Modules/Blog");
 
 1987            $wtpl->setCurrentBlock(
"author");
 
 1989                $wtpl->setVariable(
"TXT_AUTHOR", 
$author[0]);
 
 1990                $wtpl->setVariable(
"URL_AUTHOR", 
$author[1]);
 
 1991                $wtpl->parseCurrentBlock();
 
 1994            return $wtpl->get();
 
 2012        $f = 
$DIC->ui()->factory();
 
 2016            : 
"previewFullscreen";
 
 2018        if ($single_posting) {  
 
 2019            include_once 
"Services/Calendar/classes/class.ilCalendarUtil.php";
 
 2022            if ($latest_posting != 
"" && $this->blpg != $latest_posting) {
 
 2023                $ctrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $latest_posting);
 
 2024                $mb = 
$f->button()->standard(
 
 2025                    $lng->txt(
"blog_latest_posting"),
 
 2026                    $ctrl->getLinkTargetByClass(
"ilblogpostinggui", $cmd)
 
 2029                $mb = 
$f->button()->standard(
$lng->txt(
"blog_latest_posting"), 
"#")->withUnavailableAction();
 
 2033            if ($prev_posting != 
"") {
 
 2034                $ctrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $prev_posting);
 
 2035                $pb = 
$f->button()->standard(
 
 2036                    $lng->txt(
"previous"),
 
 2037                    $ctrl->getLinkTargetByClass(
"ilblogpostinggui", $cmd)
 
 2040                $pb = 
$f->button()->standard(
$lng->txt(
"previous"), 
"#")->withUnavailableAction();
 
 2044            if ($next_posting != 
"") {
 
 2045                $ctrl->setParameterByClass(
"ilblogpostinggui", 
"blpg", $next_posting);
 
 2046                $nb = 
$f->button()->standard(
 
 2048                    $ctrl->getLinkTargetByClass(
"ilblogpostinggui", $cmd)
 
 2051                $nb = 
$f->button()->standard(
$lng->txt(
"next"), 
"#")->withUnavailableAction();
 
 2053            $ctrl->setParameter($this, 
"blpg", $this->blpg);
 
 2054            $vc = 
$f->viewControl()->section($pb, $mb, $nb);
 
 2057            include_once 
"Services/Calendar/classes/class.ilCalendarUtil.php";
 
 2060            if ($latest_month != 
"" && $this->month != $latest_month) {
 
 2061                $ctrl->setParameter($this, 
"bmn", $latest_month);
 
 2062                $mb = 
$f->button()->standard(
 
 2063                    $lng->txt(
"blog_latest_posting"),
 
 2064                    $ctrl->getLinkTarget($this, 
"preview")
 
 2067                $mb = 
$f->button()->standard(
$lng->txt(
"blog_latest_posting"), 
"#")->withUnavailableAction();
 
 2071            if ($prev_month != 
"") {
 
 2072                $ctrl->setParameter($this, 
"bmn", $prev_month);
 
 2073                $pb = 
$f->button()->standard(
$lng->txt(
"previous"), 
$ctrl->getLinkTarget($this, 
"preview"));
 
 2075                $pb = 
$f->button()->standard(
$lng->txt(
"previous"), 
"#")->withUnavailableAction();
 
 2079            if ($next_month != 
"") {
 
 2080                $ctrl->setParameter($this, 
"bmn", $next_month);
 
 2081                $nb = 
$f->button()->standard(
$lng->txt(
"next"), 
$ctrl->getLinkTarget($this, 
"preview"));
 
 2083                $nb = 
$f->button()->standard(
$lng->txt(
"next"), 
"#")->withUnavailableAction();
 
 2085            $ctrl->setParameter($this, 
"bmn", $this->month);
 
 2086            $vc = 
$f->viewControl()->section($pb, $mb, $nb);
 
 2102            if (
$month > $this->month) {
 
 2120            if ($month < $this->month && $found == 
"") {
 
 2136        return key($a_items);
 
 2151            foreach (
$items as $item) {
 
 2152                if ($item[
"id"] == $this->blpg) {
 
 2156                    $next_blpg = $item[
"id"];
 
 2175            foreach (
$items as $item) {
 
 2176                if ($found && $prev_blpg == 
"") {
 
 2177                    $prev_blpg = $item[
"id"];
 
 2179                if ($item[
"id"] == $this->blpg) {
 
 2196        $month = current($a_items);
 
 2198            return current(
$month)[
"id"];
 
 2214    public function renderNavigation(array $a_items, $a_list_cmd = 
"render", $a_posting_cmd = 
"preview", $a_link_template = 
null, $a_show_inactive = 
false, $a_blpg = 0)
 
 2219        $blpg = ($a_blpg > 0)
 
 2223        if ($this->object->getOrder()) {
 
 2224            $order = array_flip($this->object->getOrder());
 
 2233        $wtpl = 
new ilTemplate(
"tpl.blog_list_navigation.html", 
true, 
true, 
"Modules/Blog");
 
 2238        if (
sizeof($a_items)) {
 
 2239            $blocks[$order[
"navigation"]] = array(
 
 2240                $this->lng->txt(
"blog_navigation"),
 
 2241                $this->renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive, $a_blpg)
 
 2245        if ($this->object->hasKeywords()) {
 
 2247            $may_edit_keywords = (
$blpg > 0 &&
 
 2249                $a_list_cmd != 
"preview" &&
 
 2250                $a_list_cmd != 
"gethtml" &&
 
 2253            if ($keywords || $may_edit_keywords) {
 
 2255                    $keywords = $this->lng->txt(
"blog_no_keywords");
 
 2258                $blocks[$order[
"keywords"]] = array(
 
 2259                    $this->lng->txt(
"blog_keywords"),
 
 2262                        ? array($cmd, $this->lng->txt(
"blog_edit_keywords"))
 
 2269        if (!$a_link_template) {
 
 2271            if ($this->id_type == self::REPOSITORY_NODE_ID &&
 
 2272                $this->object->hasAuthors()) {
 
 2275                    $blocks[$order[
"authors"]] = array($this->lng->txt(
"blog_authors"), $authors);
 
 2280            if ($this->object->hasRSS() &&
 
 2282                $a_list_cmd == 
"preview") {
 
 2285                if ($this->id_type != self::WORKSPACE_NODE_ID) {
 
 2288                $url = ILIAS_HTTP_PATH . 
"/feed.php?blog_id=" . $blog_id .
 
 2289                    "&client_id=" . rawurlencode(CLIENT_ID);
 
 2291                include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
 
 2296        if (
sizeof($blocks)) {
 
 2297            include_once 
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
 
 2300            foreach ($blocks as $block) {
 
 2304                $panel->setHeading($block[0]);
 
 2305                $panel->setBody($block[1]);
 
 2307                if (isset($block[2]) && is_array($block[2])) {
 
 2308                    $panel->setFooter(
'<a href="' . $block[2][0] . 
'">' . $block[2][1] . 
'</a>');
 
 2311                $wtpl->setCurrentBlock(
"block_bl");
 
 2312                $wtpl->setVariable(
"BLOCK", $panel->getHTML());
 
 2313                $wtpl->parseCurrentBlock();
 
 2317        return $wtpl->get();
 
 2329        $keywords = array();
 
 2330        include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
 
 2331        if ($a_posting_id) {
 
 2337                foreach (
$items as $item) {
 
 2349        foreach ($keywords as 
$keyword => $counter) {
 
 2350            $tmp[] = array(
"keyword" => 
$keyword, 
"counter" => $counter);
 
 2354        $keywords = array();
 
 2355        foreach ($tmp as $item) {
 
 2356            $keywords[$item[
"keyword"]] = $item[
"counter"];
 
 2369        include_once(
"./Services/Export/classes/class.ilExport.php");
 
 2373        $subdir = $this->
object->getType() . 
"_" . $this->
object->getId();
 
 2374        $export_dir = $exp_dir . 
"/" . $subdir;
 
 2381        include_once(
"./Services/Style/System/classes/class.ilSystemStyleHTMLExport.php");
 
 2383        $this->sys_style_html_export->addImage(
"icon_blog.svg");
 
 2384        $this->sys_style_html_export->export();
 
 2387        include_once(
"./Services/COPage/classes/class.ilCOPageHTMLExport.php");
 
 2390            $this->object->getStyleSheetId(),
 
 2393        $this->co_page_html_export->createDirectories();
 
 2394        $this->co_page_html_export->exportStyles();
 
 2395        $this->co_page_html_export->exportSupportScripts();
 
 2399        if ($blga_set->get(
"banner")) {
 
 2400            $banner = $this->
object->getImageFullPath();
 
 2402                copy($banner, $export_dir . 
"/" . basename($banner));
 
 2405        $ppic = ilObjUser::_getPersonalPicturePath($this->object->getOwner(), 
"xsmall", 
true, 
true);
 
 2407            $ppic = array_shift(explode(
"?", $ppic));
 
 2408            copy($ppic, $export_dir . 
"/" . basename($ppic));
 
 2419                "/" . $date . 
"__" . IL_INST_ID . 
"__" .
 
 2420                $this->
object->getType() . 
"_" . $this->
object->getId() . 
".zip";
 
 2437    public function exportHTMLPages($a_target_directory, $a_link_template = 
null, $a_tpl_callback = 
null, $a_co_page_html_export = 
null, $a_index_name = 
"index.html")
 
 2439        require_once(
'Services/MathJax/classes/class.ilMathJax.php');
 
 2442        if (!$a_link_template) {
 
 2443            $a_link_template = 
"bl{TYPE}_{ID}.html";
 
 2446        if ($a_co_page_html_export) {
 
 2447            $this->co_page_html_export = $a_co_page_html_export;
 
 2458        foreach (array_keys($this->items) as 
$month) {
 
 2459            $list = $this->
renderList($this->items[
$month], 
"render", $a_link_template, 
false, $a_target_directory);
 
 2465            if (!$a_tpl_callback) {
 
 2468                $tpl = call_user_func($a_tpl_callback);
 
 2473                $a_target_directory,
 
 2481                copy($file, $a_target_directory . 
"/" . $a_index_name);
 
 2489            $list_items = $this->filterItemsByKeyword($this->items, 
$keyword);
 
 2490            $list = $this->
renderList($list_items, 
"render", $a_link_template, 
false, $a_target_directory);
 
 2496            if (!$a_tpl_callback) {
 
 2499                $tpl = call_user_func($a_tpl_callback);
 
 2504                $a_target_directory,
 
 2515        include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
 
 2516        include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 2518        foreach ($pages as $page) {
 
 2520                include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
 
 2522                $blp_gui->setOutputMode(
"offline");
 
 2523                $blp_gui->setFullscreenLink(
"fullscreen.html"); 
 
 2524                $blp_gui->add_date = 
true;
 
 2525                $page_content = $blp_gui->showPage();
 
 2533                $file = $this->
buildExportLink($a_link_template, 
"posting", $page[
"id"]);
 
 2535                if (!$a_tpl_callback) {
 
 2538                    $tpl = call_user_func($a_tpl_callback);
 
 2552                    $a_target_directory,
 
 2560                $this->co_page_html_export->collectPageElements(
"blp:pg", $page[
"id"]);
 
 2563        $this->co_page_html_export->exportPageElements();
 
 2583                if (!self::$keyword_export_map) {
 
 2584                    self::$keyword_export_map = array_flip(array_keys($this->
getKeywords(
false)));
 
 2586                $a_id = self::$keyword_export_map[$a_id];
 
 2595        $link = str_replace(
"{TYPE}", 
$a_type, $a_template);
 
 2596        return str_replace(
"{ID}", $a_id, $link);
 
 2610        $tpl = $this->co_page_html_export->getPreparedMainTemplate();
 
 2612        $tpl->getStandardTemplate();
 
 2614        $ilTabs->clearTargets();
 
 2616            $ilTabs->setBackTarget(
$lng->txt(
"back"), $a_back_url);
 
 2636        $file = $a_target_directory . 
"/" . $a_file;
 
 2638        if (@is_file($file)) {
 
 2644            "tpl.export_page.html",
 
 2650            $ep_tpl->setVariable(
"PAGE_CONTENT", 
$a_content);
 
 2655        $a_tpl->setContent($ep_tpl->get());
 
 2659        if ($a_right_content) {
 
 2660            $a_tpl->setRightContent($a_right_content);
 
 2661            unset($a_right_content);
 
 2664        $content = $a_tpl->get(
 
 2675        if (!file_put_contents($file, $content)) {
 
 2676            die(
"<b>Error</b>: Could not open \"" . $file . 
"\" for writing" .
 
 2677                    " in <b>" . __FILE__ . 
"</b> on line <b>" . __LINE__ . 
"</b><br />");
 
 2693        $this->disable_notes = (bool) $a_value;
 
 2702        if ($a_cmd == 
"preview" || $a_cmd == 
"previewFullscreen" || $this->prvm) {
 
 2704            if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
 
 2706                    $ilCtrl->setParameter($this, 
"prvm", 
"fsc");
 
 2710                    $ilCtrl->setParameter($this, 
"prvm", 
"");
 
 2714            return parent::addHeaderAction();
 
 2723        if (!$this->obj_id) {
 
 2727        $sub_type = $sub_id = 
null;
 
 2728        if ($this->blpg > 0) {
 
 2733        $lg = parent::initHeaderAction($sub_type, $sub_id);
 
 2735        if ($a_is_preview) {
 
 2736            $lg->enableComments(
false);
 
 2737            $lg->enableNotes(
false);
 
 2738            $lg->enableTags(
false);
 
 2740            include_once 
"./Services/Notification/classes/class.ilNotification.php";
 
 2742                $ilCtrl->setParameter($this, 
"ntf", 1);
 
 2743                $link = 
$ilCtrl->getLinkTarget($this, 
"setNotification");
 
 2744                $ilCtrl->setParameter($this, 
"ntf", 
"");
 
 2746                    $lg->addCustomCommand($link, 
"blog_notification_toggle_off");
 
 2752                    $this->lng->txt(
"blog_notification_activated")
 
 2755                $ilCtrl->setParameter($this, 
"ntf", 2);
 
 2756                $link = 
$ilCtrl->getLinkTarget($this, 
"setNotification");
 
 2757                $ilCtrl->setParameter($this, 
"ntf", 
"");
 
 2758                $lg->addCustomCommand($link, 
"blog_notification_toggle_on");
 
 2763                    $this->lng->txt(
"blog_notification_deactivated")
 
 2769                $ilCtrl->setParameter($this, 
"prvm", 
"");
 
 2771                $ilCtrl->setParameter($this, 
"bmn", 
"");
 
 2772                $ilCtrl->setParameter($this, 
"blpg", 
"");
 
 2773                $link = 
$ilCtrl->getLinkTarget($this, 
"");
 
 2774                $ilCtrl->setParameter($this, 
"blpg", $sub_id);
 
 2775                $ilCtrl->setParameter($this, 
"bmn", $this->month);
 
 2776                $lg->addCustomCommand($link, 
"blog_edit"); 
 
 2779                    $link = 
$ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", 
"edit");
 
 2780                    $lg->addCustomCommand($link, 
"blog_edit_posting");
 
 2783                $ilCtrl->setParameter($this, 
"prvm", 
"fsc");
 
 2786            $ilCtrl->setParameter($this, 
"ntf", 
"");
 
 2797        include_once 
"./Services/Notification/classes/class.ilNotification.php";
 
 2798        switch ($this->ntf) {
 
 2808        $ilCtrl->redirect($this, 
"preview");
 
 2821        include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
 2823        if (
$post->getBlogId() == $a_blog_id) {
 
 2824            return $post->getTitle();
 
 2835        foreach ($this->items as 
$month => $postings) {
 
 2836            foreach ($postings as 
$id => $item) {
 
 2839                } elseif ($this->object->hasApproval() && !$item[
"approved"]) {
 
 2843            if (!
sizeof($this->items[
$month])) {
 
 2844                unset($this->items[
$month]);
 
 2848        if ($this->items && !isset($this->items[$this->month])) {
 
 2849            $this->month = array_shift(array_keys($this->items));
 
 2856        include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
 
 2858            foreach (
$items as $item) {
 
 2893        if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
 2907            if (!$a_author_id) {
 
 2908                include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
 2910                $a_author_id = 
$post->getAuthor();
 
 2912            if (
$ilUser->getId() == $a_author_id) {
 
 2931        if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
 2943        if (is_object($this->
object)) {
 
 2944            $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, 
""), 
"", $this->node_id);
 
 2950        if ($this->
isAdmin() && $this->apid > 0) {
 
 2951            include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
 2953            $post->setApproved(
true);
 
 2954            $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
 
 2955            $post->update(
true, 
false, 
true, 
"new"); 
 
 2957            ilUtil::sendSuccess($this->lng->txt(
"settings_saved"), 
true);
 
 2960        $this->ctrl->redirect($this, 
"render");
 
 2980        $ilTabs->activateTab(
"contributors");
 
 2982        $local_roles = $this->
object->getAllLocalRoles($this->node_id);
 
 2985        include_once 
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
 
 2990                'auto_complete_name' => 
$lng->txt(
'user'),
 
 2991                'submit_name' => 
$lng->txt(
'add'),
 
 2992                'add_search' => 
true,
 
 2993                'add_from_container' => $this->node_id,
 
 2994                'user_type' => $local_roles
 
 2999        $other_roles = $this->
object->getRolesWithContributeOrRedact($this->node_id);
 
 3001            ilUtil::sendInfo(sprintf(
$lng->txt(
"blog_contribute_other_roles"), implode(
", ", $other_roles)));
 
 3004        include_once 
"Modules/Blog/classes/class.ilContributorTableGUI.php";
 
 3020        if (!strlen(trim($user_login))) {
 
 3024        $users = explode(
',', $user_login);
 
 3026        $user_ids = array();
 
 3035            $user_ids[] = $user_id;
 
 3057        if (!count($a_user_ids) || !$a_user_type) {
 
 3063        $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
 
 3064        if (!in_array($a_user_type, $local_roles)) {
 
 3069        foreach ($a_user_ids as $user_id) {
 
 3070            if (!
$rbacreview->isAssigned($user_id, $a_user_type)) {
 
 3071                $rbacadmin->assignUser($a_user_type, $user_id);
 
 3075        ilUtil::sendSuccess(
$lng->txt(
"settings_saved"), 
true);
 
 3076        $ilCtrl->redirect($this, 
"contributors");
 
 3086        if (!is_array($ids)) {
 
 3088            $this->ctrl->redirect($this, 
"contributors");
 
 3091        include_once 
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
 
 3093        $confirm->setHeaderText($this->lng->txt(
'blog_confirm_delete_contributors'));
 
 3094        $confirm->setFormAction($this->ctrl->getFormAction($this, 
'removeContributor'));
 
 3095        $confirm->setConfirm($this->lng->txt(
'delete'), 
'removeContributor');
 
 3096        $confirm->setCancel($this->lng->txt(
'cancel'), 
'contributors');
 
 3098        include_once 
'Services/User/classes/class.ilUserUtil.php';
 
 3100        foreach ($ids as $user_id) {
 
 3108        $this->tpl->setContent($confirm->getHTML());
 
 3122        if (!is_array($ids)) {
 
 3124            $ilCtrl->redirect($this, 
"contributors");
 
 3128        $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
 
 3129        if (!$local_roles) {
 
 3134        foreach ($ids as $user_id) {
 
 3135            foreach ($local_roles as $role_id) {
 
 3136                $rbacadmin->deassignUser($role_id, $user_id);
 
 3140        ilUtil::sendSuccess(
$lng->txt(
"settings_saved"), 
true);
 
 3141        $this->ctrl->redirect($this, 
"contributors");
 
 3151        include_once 
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
 
 3153        ilUtil::sendSuccess(
$lng->txt(
"added_to_desktop"));
 
 3163        include_once 
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
 
 3165        ilUtil::sendSuccess(
$lng->txt(
"removed_from_desktop"));
 
 3172            include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
 3174            $post->setApproved(
false);
 
 3175            $post->setActive(
false);
 
 3176            $post->update(
true, 
false, 
false);
 
 3178            ilUtil::sendSuccess($this->lng->txt(
"settings_saved"), 
true);
 
 3181        $this->ctrl->redirect($this, 
"render");
 
 3193        if ($a_tpl != 
null) {
 
 3199        $ctpl->setCurrentBlock(
"ContentStyle");
 
 3201            "LOCATION_CONTENT_STYLESHEET",
 
 3204        $ctpl->parseCurrentBlock();
 
 3211        $this->tabs_gui->activateTab(
"settings");
 
 3215        $this->tpl->setContent(
$form->getHTML());
 
 3222        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 3223        $this->lng->loadLanguageModule(
"style");
 
 3225        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 3228        $fixed_style = 
$ilSetting->get(
"fixed_content_style_id");
 
 3229        $style_id = $this->
object->getStyleSheetId();
 
 3231        if ($fixed_style > 0) {
 
 3234                $this->lng->txt(
"global_fixed") . 
")");
 
 3235            $form->addItem($st);
 
 3243            $st_styles[0] = $this->lng->txt(
"default");
 
 3246            if ($style_id > 0) {
 
 3251                    $form->addItem($st);
 
 3254                    $form->addCommandButton(
"editStyle", $this->lng->txt(
"style_edit_style"));
 
 3255                    $form->addCommandButton(
"deleteStyle", $this->lng->txt(
"style_delete_style"));
 
 3261                    $this->lng->txt(
"style_current_style"),
 
 3264                $style_sel->setOptions($st_styles);
 
 3265                $style_sel->setValue($style_id);
 
 3266                $form->addItem($style_sel);
 
 3268                $form->addCommandButton(
"saveStyleSettings", $this->lng->txt(
"save"));
 
 3269                $form->addCommandButton(
"createStyle", $this->lng->txt(
"sty_create_ind_style"));
 
 3273        $form->setTitle($this->lng->txt(
"blog_style"));
 
 3274        $form->setFormAction($this->ctrl->getFormAction($this));
 
 3281        $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"create");
 
 3286        $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"edit");
 
 3291        $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"delete");
 
 3298        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 3299        if (
$ilSetting->get(
"fixed_content_style_id") <= 0 &&
 
 3301            || $this->object->getStyleSheetId() == 0)) {
 
 3302            $this->
object->setStyleSheetId((
int) 
$_POST[
"style_id"]);
 
 3303            $this->
object->update();
 
 3305            ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"), 
true);
 
 3307        $this->ctrl->redirect($this, 
"editStyleProperties");
 
 3321        if (substr($a_target, -3) == 
"wsp") {
 
 3322            $id = explode(
"_", $a_target);
 
 3324            $ilCtrl->setTargetScript(
"ilias.php");
 
 3325            $ilCtrl->initBaseClass(
"ilSharedResourceGUI");
 
 3326            $ilCtrl->setParameterByClass(
"ilSharedResourceGUI", 
"wsp_id", 
$id[0]);
 
 3328            if (
sizeof(
$id) >= 2) {
 
 3329                if (is_numeric(
$id[1])) {
 
 3330                    $ilCtrl->setParameterByClass(
"ilSharedResourceGUI", 
"gtp", 
$id[1]);
 
 3332                    $ilCtrl->setParameterByClass(
"ilSharedResourceGUI", 
"kwd", 
$id[1]);
 
 3335            $ilCtrl->redirectByClass(
"ilSharedResourceGUI", 
"");
 
 3337            $id = explode(
"_", $a_target);
 
 3339            $ilCtrl->setTargetScript(
"ilias.php");
 
 3340            $ilCtrl->initBaseClass(
"ilRepositoryGUI");
 
 3341            $ilCtrl->setParameterByClass(
"ilRepositoryGUI", 
"ref_id", 
$id[0]);
 
 3343            if (
sizeof(
$id) == 2) {
 
 3344                if (is_numeric(
$id[1])) {
 
 3345                    $ilCtrl->setParameterByClass(
"ilRepositoryGUI", 
"gtp", 
$id[1]);
 
 3347                    $ilCtrl->setParameterByClass(
"ilRepositoryGUI", 
"kwd", 
$id[1]);
 
 3350            $ilCtrl->redirectByClass(
"ilRepositoryGUI", 
"preview");
 
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
static checkExercise($a_node_id)
Class ilBlogPosting GUI class.
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.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
static lookupBlogId($a_posting_id)
Lookup blog id.
static exists($a_blog_id, $a_posting_id)
Checks whether a posting exists.
static getKeywords($a_obj_id, $a_posting_id)
HTML export class for pages.
static _numericMonthToString($a_month, $a_long=true)
numeric month to string
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 getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
List all contributors members of a blog.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static addToDesktop()
Add desktop item @access public.
static removeFromDesktop()
Remove item from personal desktop @access public.
Base class for ILIAS Exception handling.
Export User Interface Class.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static getInstance()
Singleton: get instance.
This class represents a non editable value in a property form.
static _getNotesOfObject( $a_rep_obj_id, $a_obj_id, $a_obj_type, $a_type=IL_NOTE_PRIVATE, $a_incl_sub=false, $a_filter="", $a_all_public="y", $a_repository_mode=true, $a_sort_ascending=false, $a_news_id=0)
get all notes related to a specific object
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
static hasOptOut($obj_id)
Is opt out (disable notification) allowed?
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
renderNavigationByDate(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation by date block.
setSettingsSubTabs($a_active)
initCreationForms($a_new_type)
Init creation froms.
getPreviousPosting($a_items)
Get previous posting.
isAdmin()
Check if user has admin access (approve, may edit & deactivate all postings)
writeExportFile($a_target_directory, $a_file, $a_tpl, $a_content, $a_right_content=null, $a_back=null)
Write HTML to file.
renderNavigationByAuthors(array $a_items, $a_list_cmd="render", $a_show_inactive=false)
executeCommand()
execute command
addUserFromAutoComplete()
Autocomplete submit.
getType()
Functions that must be overwritten.
setContentStyleSheet($a_tpl=null)
renderFullScreen($a_content, $a_navigation)
Build fullscreen context.
static $keyword_export_map
initHeaderAction($sub_type=null, $sub_id=null, $a_is_preview=false)
getPreviousMonth($a_items)
Get next month.
addLocatorItems()
Functions to be overwritten.
removeContributor()
Used in ilContributorTableGUI.
renderList(array $items, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_export_directory=null)
Build posting month list.
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation blocks.
disableNotes($a_value=false)
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
export()
Build and deliver export file.
getHTML()
Return embeddable HTML chunk.
renderFullscreenHeader($a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
static _goto($a_target)
Deep link.
buildExportTemplate($a_back_url="")
Build export "frame".
getNextMonth($a_items)
Get next month.
mayEditPosting($a_posting_id, $a_author_id=null)
Check if user may edit posting.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
Constructor.
render()
Render object context.
initStylePropertiesForm()
getListItems($a_show_inactive=false)
Filter blog postings by month, keyword or author.
buildPostingList($a_obj_id)
Gather all blog postings.
filterInactivePostings()
Filter inactive items from items list.
filterItemsByKeyWord(array $a_items, $a_keyword)
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.
mayContribute()
Check if user may contribute at all.
renderNavigationByKeywords( $a_list_cmd="render", $a_show_inactive=false, $a_link_template=false, $a_blpg=0)
Build navigation by keywords block.
buildExportFile()
Build export file.
setTabs()
create tabs (repository/workspace switch)
static lookupSubObjectTitle($a_blog_id, $a_posting_id)
Get title for blog posting (used in ilNotesGUI)
getLatestMonth($a_items)
Get next month.
getNextPosting($a_items)
Get next posting.
buildExportLink($a_template, $a_type, $a_id)
Build static export link.
addContributor($a_user_ids=array(), $a_user_type=null)
Centralized method to add contributors.
getLatestPosting($a_items)
Get previous posting.
preview()
Render fullscreen presentation.
confirmRemoveContributor()
Used in ilContributorTableGUI.
getKeywords($a_show_inactive, $a_posting_id=null)
Get keywords for single posting or complete blog.
infoScreenForward()
show information screen
updateCustom(ilPropertyFormGUI $a_form)
Insert custom update form values into object.
renderToolbarNavigation($a_items, $single_posting=false)
Toolbar navigation.
createPosting()
Create new posting.
buildEmbedded($a_content, $a_nav)
Combine content (list/posting) and navigation to html chunk.
addHeaderActionForCommand($a_cmd)
afterSave(ilObject $a_new_object)
Post (successful) object creation hook.
const ABSTRACT_DEFAULT_SHORTEN_LENGTH
const ABSTRACT_DEFAULT_IMAGE_WIDTH
const ABSTRACT_DEFAULT_IMAGE_HEIGHT
Handles general notification settings, see e.g.
Class ilObjStyleSheetGUI.
static _lookupStandard($a_id)
Lookup standard flag.
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static _lookupId($a_user_str)
Lookup id by login.
static _lookupName($a_user_id)
lookup user name
New implementation of ilObjectGUI.
getAccessHandler()
Get access handler.
prepareOutput($a_show_subobjects=true)
prepare output
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getCreationMode()
get creation mode
GUI class for the workflow of copying objects.
insertHeaderAction($a_list_gui)
Insert header action into main template.
getObjectService()
Get object service.
Class ilObject Basic functions for all objects.
static _lookupTitle($a_id)
lookup object title
static _lookupOwner($a_id)
lookup object owner
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
const PANEL_STYLE_SECONDARY
const HEADING_STYLE_BLOCK
static getInstance()
Get instance.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents an option in a radio group.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
HTML export class for system styles.
static getRelevanceClass($cnt, $max)
Get style class for tag relevance.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static signFile($path_to_file)
if(!array_key_exists('StateId', $_REQUEST)) $id
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
catch(Exception $e) $message
if(isset($_POST['submit'])) $form
if(isset($_REQUEST['delete'])) $list
foreach($_POST as $key=> $value) $res