5 require_once
"Services/Object/classes/class.ilObject2.php";
35 $set = $ilDB->query(
"SELECT * FROM il_blog".
36 " WHERE id = ".$ilDB->quote($this->id,
"integer"));
37 $row = $ilDB->fetchAssoc($set);
43 $this->
setRSS($row[
"rss_active"]);
46 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
54 $ilDB->manipulate(
"INSERT INTO il_blog (id,notes,ppic,rss_active,approval) VALUES (".
55 $ilDB->quote($this->id,
"integer").
",".
56 $ilDB->quote(
true,
"integer").
",".
57 $ilDB->quote(
true,
"integer").
",".
58 $ilDB->quote(
true,
"integer").
",".
59 $ilDB->quote(
false,
"integer").
")");
76 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
80 include_once
"./Services/Notification/classes/class.ilNotification.php";
83 $ilDB->manipulate(
"DELETE FROM il_blog".
84 " WHERE id = ".$ilDB->quote($this->id,
"integer"));
93 $ilDB->manipulate(
"UPDATE il_blog".
94 " SET notes = ".$ilDB->quote($this->getNotesStatus(),
"integer").
95 ",ppic = ".$ilDB->quote($this->hasProfilePicture(),
"integer").
96 ",bg_color = ".$ilDB->quote($this->getBackgroundColor(),
"text").
97 ",font_color = ".$ilDB->quote($this->getFontcolor(),
"text").
98 ",img = ".$ilDB->quote($this->getImage(),
"text").
99 ",rss_active = ".$ilDB->quote($this->hasRSS(),
"integer").
100 ",approval = ".$ilDB->quote($this->hasApproval(),
"integer").
101 " WHERE id = ".$ilDB->quote($this->id,
"integer"));
104 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
120 copy($source.$img, $target.$img);
132 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
137 $new_id = $style_obj->ilClone();
160 $this->notes = (bool)$a_status;
180 $this->ppic = (bool)$a_status;
192 $this->bg_color =
"ffffff";
204 $this->bg_color = (string)$a_value;
214 if(!$this->font_color)
216 $this->font_color =
"505050";
228 $this->font_color = (string)$a_value;
248 $this->img = (string)$a_value;
263 return $path.$this->img;
279 include_once
"Modules/Blog/classes/class.ilFSStorageBlog.php";
298 include_once
"Modules/Blog/classes/class.ilFSStorageBlog.php";
302 $path = $storage->getAbsolutePath().
"/";
306 $path .= $a_subdir.
"/";
333 $clean_name = preg_replace(
"/[^a-zA-Z0-9\_\.\-]/",
"", $a_upload[
"name"]);
336 $original =
"org_".$this->id.
"_".$clean_name;
337 $thumb =
"thb_".$this->id.
"_".$clean_name;
338 $processed = $this->
id.
"_".$clean_name;
340 if(@move_uploaded_file($a_upload[
"tmp_name"],
$path.$original))
342 chmod(
$path.$original, 0770);
345 $dimensions = $blga_set->get(
"banner_width").
"x".
346 $blga_set->get(
"banner_height");
353 ilUtil::execConvert($original_file.
"[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
354 ilUtil::execConvert($original_file.
"[0] -geometry ".$dimensions.
"! -quality 100 JPEG:".$processed_file);
382 $this->rss = (bool)$a_status;
402 $this->approval = (bool)$a_status;
422 $this->style = (int)$a_style;
425 static function sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment = null)
432 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
433 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
441 $access_handler = null;
448 include_once
"./Modules/Blog/classes/class.ilBlogPosting.php";
452 $ignore_threshold = ($a_action ==
"comment");
456 if(!$posting->isApproved())
458 $blog =
new self($blog_obj_id,
false);
459 if($blog->hasApproval())
470 $ignore_threshold =
true;
477 include_once
"./Services/Notification/classes/class.ilNotification.php";
479 $blog_obj_id, $a_posting_id, $ignore_threshold);
485 include_once
"./Services/Notification/classes/class.ilSystemNotification.php";
487 $ntf->setLangModules(array(
"blog"));
488 $ntf->setRefId($a_blog_node_id);
489 $ntf->setChangedByUserId($ilUser->getId());
490 $ntf->setSubjectLangId(
'blog_change_notification_subject');
491 $ntf->setIntroductionLangId(
'blog_change_notification_body_'.$a_action);
492 $ntf->addAdditionalInfo(
'blog_posting', $posting->getTitle());
495 $ntf->addAdditionalInfo(
'comment', $a_comment,
true);
497 $ntf->setGotoLangId(
'blog_change_notification_link');
498 $ntf->setReasonLangId(
'blog_change_notification_reason');
500 $notified = $ntf->sendMail($users,
"_".$a_posting_id,
501 ($admin_only ?
"write" :
"read"));
504 if(
sizeof($notified))
519 if(!$ilSetting->get(
'enable_global_profiles'))
525 if(substr($a_wsp_id, -4) !=
"_cll")
527 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
529 $obj_id = $wsp_id->lookupObjectId($a_wsp_id);
534 $a_wsp_id = substr($a_wsp_id, 0, -4);
543 $blog =
new self($obj_id,
false);
549 include_once
"Services/Feeds/classes/class.ilFeedWriter.php";
552 include_once
"Services/Link/classes/class.ilLink.php";
554 $url = str_replace(
"&",
"&", $url);
557 $feed->setChannelTitle(str_replace(
"&",
"&", $blog->getTitle()));
558 $feed->setChannelDescription(str_replace(
"&",
"&", $blog->getDescription()));
559 $feed->setChannelLink($url);
562 $tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
564 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
565 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
578 $snippet = str_replace(
"&",
"&", $snippet);
581 $url = str_replace(
"&",
"&", $url);
584 $feed_item->setTitle(str_replace(
"&",
"&", $item[
"title"]));
586 $feed_item->setDescription($snippet);
587 $feed_item->setLink($url);
588 $feed_item->setAbout($url);
589 $feed->addItem($feed_item);
598 global $rbacadmin, $rbacreview, $ilDB;
601 $set = $ilDB->query(
"SELECT obj_id FROM object_data ".
602 " WHERE type=".$ilDB->quote(
"rolt",
"text").
603 " AND title=".$ilDB->quote(
"il_blog_contributor",
"text"));
604 $res = $ilDB->fetchAssoc($set);
610 $role_obj = $rolf_obj->createRole(
"il_blog_contributor_".$this->
getRefId(),
611 "Contributor of blog obj_no.".$this->
getId());
613 $rbacadmin->copyRoleTemplatePermissions(
$res[
"obj_id"], ROLE_FOLDER_ID,
614 $rolf_obj->getRefId(), $role_obj->getId());
617 $ops = $rbacreview->getOperationsOfRole($role_obj->getId(),
"blog", $rolf_obj->getRefId());
618 $rbacadmin->grantPermission($role_obj->getId(), $ops, $this->
getRefId());
636 foreach($rbacreview->getLocalRoles($a_node_id) as $role_id)
649 include_once
"Services/AccessControl/classes/class.ilObjRole.php";
655 foreach($rbacreview->getParentRoleIds($a_node_id) as $role_id => $role)
657 if($role_id != $contr_role_id &&
658 in_array($contr_op_id, $rbacreview->getActiveOperationsOfRole($a_node_id, $role_id)))
669 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
673 array($this->
getId()));