ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilObjBlog.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once "Services/Object/classes/class.ilObject2.php";
6
15class ilObjBlog extends ilObject2
16{
17
21 public function __construct($a_id = 0, $a_reference = true)
22 {
23 global $DIC;
24
25 parent::__construct($a_id, $a_reference);
26 $this->rbacreview = $DIC->rbac()->review();
27 }
28
29 protected $notes; // [bool]
30 protected $bg_color; // [string]
31 protected $font_color; // [string]
32 protected $img; // [string]
33 protected $ppic; // [string]
34 protected $rss; // [bool]
35 protected $approval; // [bool]
36 protected $style; // [bool]
37 protected $abstract_shorten = false; // [bool]
39 protected $abstract_image = false; // [bool]
42 protected $keywords = true; // [bool]
43 protected $nav_mode = self::NAV_MODE_LIST; // [int]
45 protected $nav_mode_list_months; // [int]
46 protected $overview_postings; // [int]
47 protected $authors = true; // [bool]
48 protected $order;
49
50 const NAV_MODE_LIST = 1;
51 const NAV_MODE_MONTH = 2;
52
57
58 public function initType()
59 {
60 $this->type = "blog";
61 }
62
63 protected function doRead()
64 {
66
67 $set = $ilDB->query("SELECT * FROM il_blog" .
68 " WHERE id = " . $ilDB->quote($this->id, "integer"));
69 $row = $ilDB->fetchAssoc($set);
70 $this->setProfilePicture((bool) $row["ppic"]);
71 $this->setBackgroundColor($row["bg_color"]);
72 $this->setFontColor($row["font_color"]);
73 $this->setImage($row["img"]);
74 $this->setRSS($row["rss_active"]);
75 $this->setApproval($row["approval"]);
76 $this->setAbstractShorten($row["abs_shorten"]);
77 $this->setAbstractShortenLength($row["abs_shorten_len"]);
78 $this->setAbstractImage($row["abs_image"]);
79 $this->setAbstractImageWidth($row["abs_img_width"]);
80 $this->setAbstractImageHeight($row["abs_img_height"]);
81 $this->setKeywords($row["keywords"]);
82 $this->setAuthors($row["authors"]);
83 $this->setNavMode($row["nav_mode"]);
84 $this->setNavModeListMonthsWithPostings($row["nav_list_mon_with_post"]);
85 $this->setNavModeListMonths($row["nav_list_mon"]);
86 $this->setOverviewPostings($row["ov_post"]);
87 if (trim($row["nav_order"])) {
88 $this->setOrder(explode(";", $row["nav_order"]));
89 }
90
91 // #14661
92 include_once("./Services/Notes/classes/class.ilNote.php");
93 $this->setNotesStatus(ilNote::commentsActivated($this->id, 0, "blog"));
94
95 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
97 }
98
99 protected function doCreate()
100 {
102
103 $ilDB->manipulate("INSERT INTO il_blog (id,ppic,rss_active,approval" .
104 ",abs_shorten,abs_shorten_len,abs_image,abs_img_width,abs_img_height" .
105 ",keywords,authors,nav_mode,nav_list_mon_with_post) VALUES (" .
106 $ilDB->quote($this->id, "integer") . "," .
107 $ilDB->quote(true, "integer") . "," .
108 $ilDB->quote(true, "integer") . "," .
109 $ilDB->quote(false, "integer") . "," .
110 $ilDB->quote($this->hasAbstractShorten(), "integer") . "," .
111 $ilDB->quote($this->getAbstractShortenLength(), "integer") . "," .
112 $ilDB->quote($this->hasAbstractImage(), "integer") . "," .
113 $ilDB->quote($this->getAbstractImageWidth(), "integer") . "," .
114 $ilDB->quote($this->getAbstractImageHeight(), "integer") . "," .
115 $ilDB->quote($this->hasKeywords(), "integer") . "," .
116 $ilDB->quote($this->hasAuthors(), "integer") . "," .
117 $ilDB->quote($this->getNavMode(), "integer") . "," .
118 $ilDB->quote($this->getNavModeListMonthsWithPostings(), "integer") .
119 ")");
120
121 // #14661
122 include_once("./Services/Notes/classes/class.ilNote.php");
123 ilNote::activateComments($this->id, 0, "blog", true);
124
125 /*
126 if ($this->getStyleSheetId() > 0)
127 {
128 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
129 ilObjStyleSheet::writeStyleUsage($this->id, $this->getStyleSheetId());
130 }
131 */
132 }
133
134 protected function doDelete()
135 {
137
138 $this->deleteImage();
139
140 include_once "Modules/Blog/classes/class.ilBlogPosting.php";
142
143 // remove all notifications
144 include_once "./Services/Notification/classes/class.ilNotification.php";
146
147 $ilDB->manipulate("DELETE FROM il_blog" .
148 " WHERE id = " . $ilDB->quote($this->id, "integer"));
149 }
150
151 protected function doUpdate()
152 {
154
155 if ($this->id) {
156 $ilDB->manipulate("UPDATE il_blog" .
157 " SET ppic = " . $ilDB->quote($this->hasProfilePicture(), "integer") .
158 ",bg_color = " . $ilDB->quote($this->getBackgroundColor(), "text") .
159 ",font_color = " . $ilDB->quote($this->getFontcolor(), "text") .
160 ",img = " . $ilDB->quote($this->getImage(), "text") .
161 ",rss_active = " . $ilDB->quote($this->hasRSS(), "integer") .
162 ",approval = " . $ilDB->quote($this->hasApproval(), "integer") .
163 ",abs_shorten = " . $ilDB->quote($this->hasAbstractShorten(), "integer") .
164 ",abs_shorten_len = " . $ilDB->quote($this->getAbstractShortenLength(), "integer") .
165 ",abs_image = " . $ilDB->quote($this->hasAbstractImage(), "integer") .
166 ",abs_img_width = " . $ilDB->quote($this->getAbstractImageWidth(), "integer") .
167 ",abs_img_height = " . $ilDB->quote($this->getAbstractImageHeight(), "integer") .
168 ",keywords = " . $ilDB->quote($this->hasKeywords(), "integer") .
169 ",authors = " . $ilDB->quote($this->hasAuthors(), "integer") .
170 ",nav_mode = " . $ilDB->quote($this->getNavMode(), "integer") .
171 ",nav_list_mon_with_post = " . $ilDB->quote($this->getNavModeListMonthsWithPostings(), "integer") .
172 ",nav_list_mon = " . $ilDB->quote($this->getNavModeListMonths(), "integer") .
173 ",ov_post = " . $ilDB->quote($this->getOverviewPostings(), "integer") .
174 ",nav_order = " . $ilDB->quote(implode(";", $this->getOrder()), "text") .
175 " WHERE id = " . $ilDB->quote($this->id, "integer"));
176
177 // #14661
178 include_once("./Services/Notes/classes/class.ilNote.php");
179 ilNote::activateComments($this->id, 0, "blog", $this->getNotesStatus());
180
181 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
183 }
184 }
185
186 protected function doCloneObject($new_obj, $a_target_id, $a_copy_id = null, $a_omit_tree = false)
187 {
188 // banner?
189 $img = $this->getImage();
190 if ($img) {
191 $new_obj->setImage($img);
192
193 $source = $this->initStorage($this->getId());
194 $target = $new_obj->initStorage($new_obj->getId());
195
196 copy($source . $img, $target . $img);
197 }
198
199 $new_obj->setNotesStatus($this->getNotesStatus());
200 $new_obj->setProfilePicture($this->hasProfilePicture());
201 $new_obj->setBackgroundColor($this->getBackgroundColor());
202 $new_obj->setFontColor($this->getFontColor());
203 $new_obj->setRSS($this->hasRSS());
204 $new_obj->setApproval($this->hasApproval());
205 $new_obj->setAbstractShorten($this->hasAbstractShorten());
206 $new_obj->setAbstractShortenLength($this->getAbstractShortenLength());
207 $new_obj->setAbstractImage($this->hasAbstractImage());
208 $new_obj->setAbstractImageWidth($this->getAbstractImageWidth());
209 $new_obj->setAbstractImageHeight($this->getAbstractImageHeight());
210 $new_obj->update();
211
212 // set/copy stylesheet
213 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
214 $style_id = $this->getStyleSheetId();
215 if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id)) {
216 $style_obj = ilObjectFactory::getInstanceByObjId($style_id);
217 $new_id = $style_obj->ilClone();
218 $new_obj->setStyleSheetId($new_id);
219 $new_obj->update();
220 }
221 }
222
228 public function getNotesStatus()
229 {
230 return $this->notes;
231 }
232
238 public function setNotesStatus($a_status)
239 {
240 $this->notes = (bool) $a_status;
241 }
242
248 public function hasProfilePicture()
249 {
250 return $this->ppic;
251 }
252
258 public function setProfilePicture($a_status)
259 {
260 $this->ppic = (bool) $a_status;
261 }
262
268 public function getBackgroundColor()
269 {
270 if (!$this->bg_color) {
271 $this->bg_color = "ffffff";
272 }
273 return $this->bg_color;
274 }
275
281 public function setBackgroundColor($a_value)
282 {
283 $this->bg_color = (string) $a_value;
284 }
285
291 public function getFontColor()
292 {
293 if (!$this->font_color) {
294 $this->font_color = "505050";
295 }
296 return $this->font_color;
297 }
298
304 public function setFontColor($a_value)
305 {
306 $this->font_color = (string) $a_value;
307 }
308
314 public function getImage()
315 {
316 return $this->img;
317 }
318
324 public function setImage($a_value)
325 {
326 $this->img = (string) $a_value;
327 }
328
334 public function getImageFullPath($a_as_thumb = false)
335 {
336 if ($this->img) {
337 $path = $this->initStorage($this->id);
338 if (!$a_as_thumb) {
339 return $path . $this->img;
340 } else {
341 return $path . "thb_" . $this->img;
342 }
343 }
344 }
345
349 public function deleteImage()
350 {
351 if ($this->id) {
352 include_once "Modules/Blog/classes/class.ilFSStorageBlog.php";
353 $storage = new ilFSStorageBlog($this->id);
354 $storage->delete();
355
356 $this->setImage(null);
357
358 $this->handleQuotaUpdate();
359 }
360 }
361
369 public static function initStorage($a_id, $a_subdir = null)
370 {
371 include_once "Modules/Blog/classes/class.ilFSStorageBlog.php";
372 $storage = new ilFSStorageBlog($a_id);
373 $storage->create();
374
375 $path = $storage->getAbsolutePath() . "/";
376
377 if ($a_subdir) {
378 $path .= $a_subdir . "/";
379
380 if (!is_dir($path)) {
381 mkdir($path);
382 }
383 }
384
385 return $path;
386 }
387
394 public function uploadImage(array $a_upload)
395 {
396 if (!$this->id) {
397 return false;
398 }
399
400 $this->deleteImage();
401
402 // #10074
403 $clean_name = preg_replace("/[^a-zA-Z0-9\_\.\-]/", "", $a_upload["name"]);
404
405 $path = $this->initStorage($this->id);
406 $original = "org_" . $this->id . "_" . $clean_name;
407 $thumb = "thb_" . $this->id . "_" . $clean_name;
408 $processed = $this->id . "_" . $clean_name;
409
410 if (ilUtil::moveUploadedFile($a_upload["tmp_name"], $original, $path . $original)) {
411 chmod($path . $original, 0770);
412
413 $blga_set = new ilSetting("blga");
414 /* as banner height should overflow, we only handle width
415 $dimensions = $blga_set->get("banner_width")."x".
416 $blga_set->get("banner_height");
417 */
418 $dimensions = $blga_set->get("banner_width");
419
420 // take quality 100 to avoid jpeg artefacts when uploading jpeg files
421 // taking only frame [0] to avoid problems with animated gifs
422 $original_file = ilUtil::escapeShellArg($path . $original);
423 $thumb_file = ilUtil::escapeShellArg($path . $thumb);
424 $processed_file = ilUtil::escapeShellArg($path . $processed);
425 ilUtil::execConvert($original_file . "[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
426 ilUtil::execConvert($original_file . "[0] -geometry " . $dimensions . " -quality 100 JPEG:" . $processed_file);
427
428 $this->setImage($processed);
429
430 $this->handleQuotaUpdate();
431
432 return true;
433 }
434 return false;
435 }
436
442 public function hasRSS()
443 {
444 return $this->rss;
445 }
446
452 public function setRSS($a_status)
453 {
454 $this->rss = (bool) $a_status;
455 }
456
462 public function hasApproval()
463 {
464 return (bool) $this->approval;
465 }
466
472 public function setApproval($a_status)
473 {
474 $this->approval = (bool) $a_status;
475 }
476
482 public function getStyleSheetId()
483 {
484 return (int) $this->style;
485 }
486
492 public function setStyleSheetId($a_style)
493 {
494 $this->style = (int) $a_style;
495 }
496
497 public function hasAbstractShorten()
498 {
500 }
501
502 public function setAbstractShorten($a_value)
503 {
504 $this->abstract_shorten = (bool) $a_value;
505 }
506
507 public function getAbstractShortenLength()
508 {
510 }
511
512 public function setAbstractShortenLength($a_value)
513 {
514 $this->abstract_shorten_length = (int) $a_value;
515 }
516
517 public function hasAbstractImage()
518 {
520 }
521
522 public function setAbstractImage($a_value)
523 {
524 $this->abstract_image = (bool) $a_value;
525 }
526
527 public function getAbstractImageWidth()
528 {
530 }
531
532 public function setAbstractImageWidth($a_value)
533 {
534 $this->abstract_image_width = (int) $a_value;
535 }
536
537 public function getAbstractImageHeight()
538 {
540 }
541
542 public function setAbstractImageHeight($a_value)
543 {
544 $this->abstract_image_height = (int) $a_value;
545 }
546
547 public function setKeywords($a_value)
548 {
549 $this->keywords = (bool) $a_value;
550 }
551
552 public function hasKeywords()
553 {
554 return $this->keywords;
555 }
556
557 public function setAuthors($a_value)
558 {
559 $this->authors = (bool) $a_value;
560 }
561
562 public function hasAuthors()
563 {
564 return $this->authors;
565 }
566
567 public function setNavMode($a_value)
568 {
569 $a_value = (int) $a_value;
570 if (in_array($a_value, array(self::NAV_MODE_LIST, self::NAV_MODE_MONTH))) {
571 $this->nav_mode = $a_value;
572 }
573 }
574
575 public function getNavMode()
576 {
577 return $this->nav_mode;
578 }
579
580 public function setNavModeListMonthsWithPostings($a_value)
581 {
582 $this->nav_mode_list_months_with_post = (int) $a_value;
583 }
584
586 {
587 return $this->nav_mode_list_months_with_post;
588 }
589
590 public function setNavModeListMonths($a_value)
591 {
592 if (!$a_value) {
593 $a_value = null;
594 } else {
595 $a_value = (int) $a_value;
596 }
597 $this->nav_mode_list_months = $a_value;
598 }
599
600 public function getNavModeListMonths()
601 {
603 }
604
605 public function setOverviewPostings($a_value)
606 {
607 if (!$a_value) {
608 $a_value = null;
609 } else {
610 $a_value = (int) $a_value;
611 }
612 $this->overview_postings = $a_value;
613 }
614
615 public function getOverviewPostings()
616 {
618 }
619
620 public function setOrder(array $a_values = null)
621 {
622 $this->order = $a_values;
623 }
624
625 public function getOrder()
626 {
627 return (array) $this->order;
628 }
629
630 public static function sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment = null)
631 {
632 global $DIC;
633
634 $ilUser = $DIC->user();
635
636 // get blog object id (repository or workspace)
637 if ($a_in_wsp) {
638 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
639 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
640 $tree = new ilWorkspaceTree($ilUser->getId()); // owner of tree is irrelevant
641 $blog_obj_id = $tree->lookupObjectId($a_blog_node_id);
642 $access_handler = new ilWorkspaceAccessHandler($tree);
643 } else {
644 $blog_obj_id = ilObject::_lookupObjId($a_blog_node_id);
645 $access_handler = null;
646 }
647 if (!$blog_obj_id) {
648 return;
649 }
650
651 include_once "./Modules/Blog/classes/class.ilBlogPosting.php";
652 $posting = new ilBlogPosting($a_posting_id);
653
654 // #11138
655 $ignore_threshold = ($a_action == "comment");
656
657 $admin_only = false;
658
659 // approval handling
660 if (!$posting->isApproved()) {
661 $blog = new self($blog_obj_id, false);
662 if ($blog->hasApproval()) {
663 switch ($a_action) {
664 case "update":
665 // un-approved posting was updated - no notifications
666 return;
667
668 case "new":
669 // un-approved posting was activated - admin-only notification
670 $admin_only = true;
671 $ignore_threshold = true;
672 $a_action = "approve";
673 break;
674 }
675 }
676 }
677
678 // create/update news item (only in repository)
679 if (!$a_in_wsp &&
680 in_array($a_action, array("update", "new"))) {
681 $posting->handleNews(($a_action == "update"));
682 }
683
684 // recipients
685 include_once "./Services/Notification/classes/class.ilNotification.php";
688 $blog_obj_id,
689 $a_posting_id,
690 $ignore_threshold
691 );
692 if (!sizeof($users)) {
693 return;
694 }
695
696 include_once "./Services/Notification/classes/class.ilSystemNotification.php";
697 $ntf = new ilSystemNotification($a_in_wsp);
698 $ntf->setLangModules(array("blog"));
699 $ntf->setRefId($a_blog_node_id);
700 $ntf->setChangedByUserId($ilUser->getId());
701 $ntf->setSubjectLangId('blog_change_notification_subject');
702 $ntf->setIntroductionLangId('blog_change_notification_body_' . $a_action);
703 $ntf->addAdditionalInfo('blog_posting', $posting->getTitle());
704 if ($a_comment) {
705 $ntf->addAdditionalInfo('comment', $a_comment, true);
706 }
707 $ntf->setGotoLangId('blog_change_notification_link');
708 $ntf->setReasonLangId('blog_change_notification_reason');
709
710 $abstract = $posting->getNotificationAbstract();
711 if ($abstract) {
712 $ntf->addAdditionalInfo('content', $abstract, true);
713 }
714
715 $notified = $ntf->sendMail(
716 $users,
717 "_" . $a_posting_id,
718 ($admin_only ? "write" : "read")
719 );
720
721 // #14387
722 if (sizeof($notified)) {
723 ilNotification::updateNotificationTime(ilNotification::TYPE_BLOG, $blog_obj_id, $notified, $a_posting_id);
724 }
725 }
726
732 public static function deliverRSS($a_wsp_id)
733 {
734 global $DIC;
735
736 $tpl = $DIC["tpl"];
737 $ilSetting = $DIC->settings();
738
739 if (!$ilSetting->get('enable_global_profiles')) {
740 return;
741 }
742
743 // #10827
744 if (substr($a_wsp_id, -4) != "_cll") {
745 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
746 $wsp_id = new ilWorkspaceTree(0);
747 $obj_id = $wsp_id->lookupObjectId($a_wsp_id);
748 $is_wsp = "_wsp";
749 } else {
750 $a_wsp_id = substr($a_wsp_id, 0, -4);
751 $obj_id = ilObject::_lookupObjId($a_wsp_id);
752 $is_wsp = null;
753 }
754 if (!$obj_id) {
755 return;
756 }
757
758 $blog = new self($obj_id, false);
759 if (!$blog->hasRSS()) {
760 return;
761 }
762
763 include_once "Services/Feeds/classes/class.ilFeedWriter.php";
764 $feed = new ilFeedWriter();
765
766 include_once "Services/Link/classes/class.ilLink.php";
767 $url = ilLink::_getStaticLink($a_wsp_id, "blog", true, $is_wsp);
768 $url = str_replace("&", "&amp;", $url);
769
770 // #11870
771 $feed->setChannelTitle(str_replace("&", "&amp;", $blog->getTitle()));
772 $feed->setChannelDescription(str_replace("&", "&amp;", $blog->getDescription()));
773 $feed->setChannelLink($url);
774
775 // needed for blogpostinggui / pagegui
776 $tpl = new ilTemplate("tpl.main.html", true, true);
777
778 include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
779 include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
780 foreach (ilBlogPosting::getAllPostings($obj_id) as $item) {
781 $id = $item["id"];
782
783 // only published items
784 $is_active = ilBlogPosting::_lookupActive($id, "blp");
785 if (!$is_active) {
786 continue;
787 }
788
789 // #16434
790 $snippet = strip_tags(ilBlogPostingGUI::getSnippet($id), "<br><br/><div><p>");
791 $snippet = str_replace("&", "&amp;", $snippet);
792 $snippet = "<![CDATA[" . $snippet . "]]>";
793
794 $url = ilLink::_getStaticLink($a_wsp_id, "blog", true, "_" . $id . $is_wsp);
795 $url = str_replace("&", "&amp;", $url);
796
797 $feed_item = new ilFeedItem();
798 $feed_item->setTitle(str_replace("&", "&amp;", $item["title"])); // #16022
799 $feed_item->setDate($item["created"]->get(IL_CAL_DATETIME));
800 $feed_item->setDescription($snippet);
801 $feed_item->setLink($url);
802 $feed_item->setAbout($url);
803 $feed->addItem($feed_item);
804 }
805
806 $feed->showFeed();
807 exit();
808 }
809
810 public function initDefaultRoles()
811 {
812 include_once './Services/AccessControl/classes/class.ilObjRole.php';
814 'il_blog_contributor_' . $this->getRefId(),
815 "Contributor of blog obj_no." . $this->getId(),
816 'il_blog_contributor',
817 $this->getRefId()
818 );
819
820 include_once './Services/AccessControl/classes/class.ilObjRole.php';
822 'il_blog_editor_' . $this->getRefId(),
823 "Editor of blog obj_no." . $this->getId(),
824 'il_blog_editor',
825 $this->getRefId()
826 );
827
828 return array();
829 }
830
831 public function getLocalContributorRole($a_node_id)
832 {
834
835 foreach ($rbacreview->getLocalRoles($a_node_id) as $role_id) {
836 if (substr(ilObject::_lookupTitle($role_id), 0, 19) == "il_blog_contributor") {
837 return $role_id;
838 }
839 }
840 }
841
842 public function getLocalEditorRole($a_node_id)
843 {
845
846 foreach ($rbacreview->getLocalRoles($a_node_id) as $role_id) {
847 if (substr(ilObject::_lookupTitle($role_id), 0, 14) == "il_blog_editor") {
848 return $role_id;
849 }
850 }
851 }
852
853 public function getAllLocalRoles($a_node_id)
854 {
856
857 include_once "Services/AccessControl/classes/class.ilObjRole.php";
858
859 $res = array();
860 foreach ($rbacreview->getLocalRoles($a_node_id) as $role_id) {
862 }
863
864 asort($res);
865 return $res;
866 }
867
868 public function getRolesWithContributeOrRedact($a_node_id)
869 {
871
872 include_once "Services/AccessControl/classes/class.ilObjRole.php";
873
874 $contr_op_id = ilRbacReview::_getOperationIdByName("contribute");
875 $redact_op_id = ilRbacReview::_getOperationIdByName("redact");
876 $contr_role_id = $this->getLocalContributorRole($a_node_id);
877 $editor_role_id = $this->getLocalEditorRole($a_node_id);
878
879 $res = array();
880 foreach ($rbacreview->getParentRoleIds($a_node_id) as $role_id => $role) {
881 if ($role_id != $contr_role_id &&
882 $role_id != $editor_role_id) {
883 $all_ops = $rbacreview->getActiveOperationsOfRole($a_node_id, $role_id);
884 if (in_array($contr_op_id, $all_ops) ||
885 in_array($redact_op_id, $all_ops)) {
886 $res[$role_id] = ilObjRole:: _getTranslation($role["title"]);
887 }
888 }
889 }
890
891 return $res;
892 }
893
894 protected function handleQuotaUpdate()
895 {
896 include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
898 $this->getType(),
899 $this->getId(),
900 ilUtil::dirsize($this->initStorage($this->getId())),
901 array($this->getId())
902 );
903 }
904}
$tpl
Definition: ilias.php:10
$path
Definition: aliased.php:25
$source
Definition: linkback.php:22
$users
Definition: authpage.php:44
exit
Definition: backend.php:16
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_DATETIME
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.
Class ilBlogPosting.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
static deleteAllBlogPostings($a_blog_id)
Delete all postings for blog.
static handleUpdatedSourceObject($a_src_obj_type, $a_src_obj_id, $a_src_filesize, $a_owner_obj_ids=null, $a_is_prtf=false)
Find and update/create all related entries for source object.
A FeedItem represents an item in a News Feed.
Feed writer class.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_news_id=0)
Are comments activated for object?
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
static removeForObject($type, $id)
Remove all notifications for given object.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
static updateNotificationTime($type, $id, array $user_ids, $page_id=false)
Update the last mail timestamp for given object and users.
Class ilObjBlog.
setBackgroundColor($a_value)
Set background color.
getRolesWithContributeOrRedact($a_node_id)
setProfilePicture($a_status)
Toggle profile picture status.
setNavModeListMonthsWithPostings($a_value)
setFontColor($a_value)
Set font color.
hasProfilePicture()
Get profile picture status.
setAuthors($a_value)
setNotesStatus($a_status)
Toggle notes status.
getStyleSheetId()
Get style sheet id.
static sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment=null)
getLocalContributorRole($a_node_id)
static deliverRSS($a_wsp_id)
Deliver blog as rss feed.
deleteImage()
remove existing file
setAbstractShorten($a_value)
const NAV_MODE_MONTH
setKeywords($a_value)
getFontColor()
Get font color.
getImageFullPath($a_as_thumb=false)
Get banner image incl.
setAbstractShortenLength($a_value)
setRSS($a_status)
Toggle RSS status.
const NAV_MODE_LIST
initDefaultRoles()
init default roles settings Purpose of this function is to create a local role folder and local roles...
setAbstractImage($a_value)
setOrder(array $a_values=null)
setOverviewPostings($a_value)
uploadImage(array $a_upload)
Upload new image file.
setAbstractImageHeight($a_value)
static initStorage($a_id, $a_subdir=null)
Init file system storage.
getLocalEditorRole($a_node_id)
getBackgroundColor()
Get background color.
getAbstractShortenLength()
setNavMode($a_value)
const ABSTRACT_DEFAULT_SHORTEN_LENGTH
getAllLocalRoles($a_node_id)
const ABSTRACT_DEFAULT_IMAGE_WIDTH
const NAV_MODE_LIST_DEFAULT_POSTINGS
doCloneObject($new_obj, $a_target_id, $a_copy_id=null, $a_omit_tree=false)
setStyleSheetId($a_style)
Set style sheet id.
setAbstractImageWidth($a_value)
setNavModeListMonths($a_value)
hasApproval()
Get approval status.
setApproval($a_status)
Toggle approval status.
hasRSS()
Get RSS status.
getImage()
Get banner image.
getNavModeListMonthsWithPostings()
getNotesStatus()
Get notes status.
__construct($a_id=0, $a_reference=true)
Constructor.
const ABSTRACT_DEFAULT_IMAGE_HEIGHT
setImage($a_value)
Set banner image.
static _getTranslation($a_role_title)
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
static _lookupStandard($a_id)
Lookup standard flag.
static lookupObjectStyle($a_obj_id)
Lookup object style.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
Class ilObject2 This is an intermediate progress of ilObject class.
getRefId()
get reference id @access public
getType()
get object type @access public
getId()
get object id @access public
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static _getOperationIdByName($a_operation)
get operation id by name of operation @access public @access static
ILIAS Setting Class.
Wrapper classes for system notifications.
special template class to simplify handling of ITX/PEAR
static escapeShellArg($a_arg)
static execConvert($args)
execute convert command
static dirsize($directory)
get size of a directory or a file.
Access handler for personal workspace.
Tree handler for personal workspace.
$target
Definition: test.php:19
$row
global $ilSetting
Definition: privfeed.php:17
$url
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB
$ilUser
Definition: imgupload.php:18