5 require_once
"Services/Object/classes/class.ilObject2.php";
55 $set = $ilDB->query(
"SELECT * FROM il_blog".
56 " WHERE id = ".$ilDB->quote($this->id,
"integer"));
57 $row = $ilDB->fetchAssoc($set);
62 $this->
setRSS($row[
"rss_active"]);
75 if(trim($row[
"nav_order"]))
77 $this->
setOrder(explode(
";", $row[
"nav_order"]));
81 include_once(
"./Services/Notes/classes/class.ilNote.php");
84 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
92 $ilDB->manipulate(
"INSERT INTO il_blog (id,ppic,rss_active,approval".
93 ",abs_shorten,abs_shorten_len,abs_image,abs_img_width,abs_img_height".
94 ",keywords,authors,nav_mode,nav_list_post) VALUES (".
95 $ilDB->quote($this->id,
"integer").
",".
96 $ilDB->quote(
true,
"integer").
",".
97 $ilDB->quote(
true,
"integer").
",".
98 $ilDB->quote(
false,
"integer").
",".
105 $ilDB->quote($this->
hasAuthors(),
"integer").
",".
106 $ilDB->quote($this->
getNavMode(),
"integer").
",".
111 include_once(
"./Services/Notes/classes/class.ilNote.php");
129 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
133 include_once
"./Services/Notification/classes/class.ilNotification.php";
136 $ilDB->manipulate(
"DELETE FROM il_blog".
137 " WHERE id = ".$ilDB->quote($this->id,
"integer"));
146 $ilDB->manipulate(
"UPDATE il_blog".
147 " SET ppic = ".$ilDB->quote($this->hasProfilePicture(),
"integer").
148 ",bg_color = ".$ilDB->quote($this->getBackgroundColor(),
"text").
149 ",font_color = ".$ilDB->quote($this->getFontcolor(),
"text").
150 ",img = ".$ilDB->quote($this->getImage(),
"text").
151 ",rss_active = ".$ilDB->quote($this->hasRSS(),
"integer").
152 ",approval = ".$ilDB->quote($this->hasApproval(),
"integer").
153 ",abs_shorten = ".$ilDB->quote($this->hasAbstractShorten(),
"integer").
154 ",abs_shorten_len = ".$ilDB->quote($this->getAbstractShortenLength(),
"integer").
155 ",abs_image = ".$ilDB->quote($this->hasAbstractImage(),
"integer").
156 ",abs_img_width = ".$ilDB->quote($this->getAbstractImageWidth(),
"integer").
157 ",abs_img_height = ".$ilDB->quote($this->getAbstractImageHeight(),
"integer").
158 ",keywords = ".$ilDB->quote($this->hasKeywords(),
"integer").
159 ",authors = ".$ilDB->quote($this->hasAuthors(),
"integer").
160 ",nav_mode = ".$ilDB->quote($this->getNavMode(),
"integer").
161 ",nav_list_post = ".$ilDB->quote($this->getNavModeListPostings(),
"integer").
162 ",nav_list_mon = ".$ilDB->quote($this->getNavModeListMonths(),
"integer").
163 ",ov_post = ".$ilDB->quote($this->getOverviewPostings(),
"integer").
164 ",nav_order = ".$ilDB->quote(implode(
";", $this->
getOrder()),
"text").
165 " WHERE id = ".$ilDB->quote($this->
id,
"integer"));
168 include_once(
"./Services/Notes/classes/class.ilNote.php");
171 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
187 copy($source.$img, $target.$img);
204 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
209 $new_id = $style_obj->ilClone();
232 $this->notes = (bool)$a_status;
252 $this->ppic = (bool)$a_status;
264 $this->bg_color =
"ffffff";
276 $this->bg_color = (string)$a_value;
286 if(!$this->font_color)
288 $this->font_color =
"505050";
300 $this->font_color = (string)$a_value;
320 $this->img = (string)$a_value;
335 return $path.$this->img;
351 include_once
"Modules/Blog/classes/class.ilFSStorageBlog.php";
370 include_once
"Modules/Blog/classes/class.ilFSStorageBlog.php";
374 $path = $storage->getAbsolutePath().
"/";
378 $path .= $a_subdir.
"/";
405 $clean_name = preg_replace(
"/[^a-zA-Z0-9\_\.\-]/",
"", $a_upload[
"name"]);
408 $original =
"org_".$this->id.
"_".$clean_name;
409 $thumb =
"thb_".$this->id.
"_".$clean_name;
410 $processed = $this->
id.
"_".$clean_name;
412 if(@move_uploaded_file($a_upload[
"tmp_name"],
$path.$original))
414 chmod(
$path.$original, 0770);
421 $dimensions = $blga_set->get(
"banner_width");
428 ilUtil::execConvert($original_file.
"[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
429 ilUtil::execConvert($original_file.
"[0] -geometry ".$dimensions.
" -quality 100 JPEG:".$processed_file);
457 $this->rss = (bool)$a_status;
477 $this->approval = (bool)$a_status;
497 $this->style = (int)$a_style;
507 $this->abstract_shorten = (bool)$a_value;
517 $this->abstract_shorten_length = (int)$a_value;
527 $this->abstract_image = (bool)$a_value;
537 $this->abstract_image_width = (int)$a_value;
547 $this->abstract_image_height = (int)$a_value;
552 $this->keywords = (bool)$a_value;
562 $this->authors = (bool)$a_value;
572 $a_value = (int)$a_value;
573 if(in_array($a_value, array(self::NAV_MODE_LIST, self::NAV_MODE_MONTH)))
575 $this->nav_mode = $a_value;
586 $this->nav_mode_list_postings = (int)$a_value;
602 $a_value = (int)$a_value;
604 $this->nav_mode_list_months = $a_value;
620 $a_value = (int)$a_value;
622 $this->overview_postings = $a_value;
632 $this->order = $a_values;
640 static function sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment = null)
647 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
648 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
656 $access_handler = null;
663 include_once
"./Modules/Blog/classes/class.ilBlogPosting.php";
667 $ignore_threshold = ($a_action ==
"comment");
672 if(!$posting->isApproved())
674 $blog =
new self($blog_obj_id,
false);
675 if($blog->hasApproval())
686 $ignore_threshold =
true;
687 $a_action =
"approve";
694 include_once
"./Services/Notification/classes/class.ilNotification.php";
696 $blog_obj_id, $a_posting_id, $ignore_threshold);
702 include_once
"./Services/Notification/classes/class.ilSystemNotification.php";
704 $ntf->setLangModules(array(
"blog"));
705 $ntf->setRefId($a_blog_node_id);
706 $ntf->setChangedByUserId($ilUser->getId());
707 $ntf->setSubjectLangId(
'blog_change_notification_subject');
708 $ntf->setIntroductionLangId(
'blog_change_notification_body_'.$a_action);
709 $ntf->addAdditionalInfo(
'blog_posting', $posting->getTitle());
712 $ntf->addAdditionalInfo(
'comment', $a_comment,
true);
714 $ntf->setGotoLangId(
'blog_change_notification_link');
715 $ntf->setReasonLangId(
'blog_change_notification_reason');
717 $abstract = $posting->getNotificationAbstract();
720 $ntf->addAdditionalInfo(
'content', $abstract,
true);
723 $notified = $ntf->sendMail($users,
"_".$a_posting_id,
724 ($admin_only ?
"write" :
"read"));
727 if(
sizeof($notified))
742 if(!$ilSetting->get(
'enable_global_profiles'))
748 if(substr($a_wsp_id, -4) !=
"_cll")
750 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
752 $obj_id = $wsp_id->lookupObjectId($a_wsp_id);
757 $a_wsp_id = substr($a_wsp_id, 0, -4);
766 $blog =
new self($obj_id,
false);
772 include_once
"Services/Feeds/classes/class.ilFeedWriter.php";
775 include_once
"Services/Link/classes/class.ilLink.php";
777 $url = str_replace(
"&",
"&", $url);
780 $feed->setChannelTitle(str_replace(
"&",
"&", $blog->getTitle()));
781 $feed->setChannelDescription(str_replace(
"&",
"&", $blog->getDescription()));
782 $feed->setChannelLink($url);
785 $tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
787 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
788 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");
802 $snippet = str_replace(
"&",
"&", $snippet);
803 $snippet =
"<![CDATA[".$snippet.
"]]>";
806 $url = str_replace(
"&",
"&", $url);
809 $feed_item->setTitle(str_replace(
"&",
"&", $item[
"title"]));
811 $feed_item->setDescription($snippet);
812 $feed_item->setLink($url);
813 $feed_item->setAbout($url);
814 $feed->addItem($feed_item);
823 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
825 'il_blog_contributor_'.$this->
getRefId(),
826 "Contributor of blog obj_no.".$this->
getId(),
827 'il_blog_contributor',
844 foreach($rbacreview->getLocalRoles($a_node_id) as $role_id)
857 include_once
"Services/AccessControl/classes/class.ilObjRole.php";
863 foreach($rbacreview->getParentRoleIds($a_node_id) as $role_id => $role)
865 if($role_id != $contr_role_id &&
866 in_array($contr_op_id, $rbacreview->getActiveOperationsOfRole($a_node_id, $role_id)))
877 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
881 array($this->
getId()));