5 require_once 
"Services/Object/classes/class.ilObject2.php";
 
   34                 $set = $ilDB->query(
"SELECT * FROM il_blog".
 
   35                                 " WHERE id = ".$ilDB->quote($this->id, 
"integer"));
 
   36                 $row = $ilDB->fetchAssoc($set);
 
   42                 $this->
setRSS($row[
"rss_active"]);
 
   50                 $ilDB->manipulate(
"INSERT INTO il_blog (id,notes,ppic,rss_active,approval) VALUES (".
 
   51                         $ilDB->quote($this->id, 
"integer").
",".
 
   52                         $ilDB->quote(
true, 
"integer").
",".
 
   53                         $ilDB->quote(
true, 
"integer").
",".
 
   54                         $ilDB->quote(
true, 
"integer").
",".
 
   55                         $ilDB->quote(
false, 
"integer").
")");
 
   64                 include_once 
"Modules/Blog/classes/class.ilBlogPosting.php";
 
   68                 include_once 
"./Services/Notification/classes/class.ilNotification.php";
 
   71                 $ilDB->manipulate(
"DELETE FROM il_blog".
 
   72                         " WHERE id = ".$ilDB->quote($this->id, 
"integer"));
 
   81                         $ilDB->manipulate(
"UPDATE il_blog".
 
   82                                         " SET notes = ".$ilDB->quote($this->getNotesStatus(), 
"integer").
 
   83                                         ",ppic = ".$ilDB->quote($this->hasProfilePicture(), 
"integer").
 
   84                                         ",bg_color = ".$ilDB->quote($this->getBackgroundColor(), 
"text").
 
   85                                         ",font_color = ".$ilDB->quote($this->getFontcolor(), 
"text").
 
   86                                         ",img = ".$ilDB->quote($this->getImage(), 
"text").
 
   87                                         ",rss_active = ".$ilDB->quote($this->hasRSS(), 
"integer").
 
   88                                         ",approval = ".$ilDB->quote($this->hasApproval(), 
"integer").
 
   89                                         " WHERE id = ".$ilDB->quote($this->id, 
"integer"));
 
  110                 $this->notes = (bool)$a_status;
 
  130                 $this->ppic = (bool)$a_status;
 
  142                         $this->bg_color = 
"ffffff";
 
  154                 $this->bg_color = (string)$a_value;
 
  164                 if(!$this->font_color)
 
  166                         $this->font_color = 
"505050";
 
  178                 $this->font_color = (string)$a_value;
 
  198                 $this->img = (string)$a_value;
 
  213                                 return $path.$this->img;
 
  229                         include_once 
"Modules/Blog/classes/class.ilFSStorageBlog.php";
 
  246                 include_once 
"Modules/Blog/classes/class.ilFSStorageBlog.php";
 
  250                 $path = $storage->getAbsolutePath().
"/";
 
  254                         $path .= $a_subdir.
"/";
 
  281                 $clean_name = preg_replace(
"/[^a-zA-Z0-9\_\.\-]/", 
"", $a_upload[
"name"]);
 
  284                 $original = 
"org_".$this->id.
"_".$clean_name;
 
  285                 $thumb = 
"thb_".$this->id.
"_".$clean_name;
 
  286                 $processed = $this->
id.
"_".$clean_name;
 
  288                 if(@move_uploaded_file($a_upload[
"tmp_name"], 
$path.$original))
 
  290                         chmod(
$path.$original, 0770);
 
  293                         $dimensions = $blga_set->get(
"banner_width").
"x".
 
  294                                 $blga_set->get(
"banner_height");
 
  301                         ilUtil::execConvert($original_file.
"[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
 
  302                         ilUtil::execConvert($original_file.
"[0] -geometry ".$dimensions.
"! -quality 100 JPEG:".$processed_file);
 
  327                 $this->rss = (bool)$a_status;
 
  347                 $this->approval = (bool)$a_status;
 
  350         static function sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment = null)
 
  357                         include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  358                         include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
 
  368                         $access_handler = null;
 
  370                         include_once 
"Services/Link/classes/class.ilLink.php";
 
  378                 include_once 
"./Modules/Blog/classes/class.ilBlogPosting.php";
 
  382                 $ignore_threshold = ($a_action == 
"comment");           
 
  386                 if(!$posting->isApproved())
 
  388                         $blog = 
new self($blog_obj_id, 
false);
 
  389                         if($blog->hasApproval())
 
  400                                                 $ignore_threshold = 
true;
 
  407                 include_once 
"./Services/Notification/classes/class.ilNotification.php";                
 
  409                         $blog_obj_id, $a_posting_id, $ignore_threshold);                
 
  418                 include_once 
"./Services/Mail/classes/class.ilMail.php";
 
  419                 include_once 
"./Services/User/classes/class.ilObjUser.php";
 
  420                 include_once 
"./Services/Language/classes/class.ilLanguageFactory.php";
 
  421                 include_once(
"./Services/User/classes/class.ilUserUtil.php");
 
  423                 $posting_title = $posting->getTitle();          
 
  425                 $author = $posting->getAuthor();
 
  428                 foreach(array_unique($users) as $idx => $user_id)
 
  431                         if($user_id == $ilUser->getId())
 
  440                                         !$access_handler->checkAccessOfUser($tree, $user_id, 
'write', 
'', $a_blog_node_id))
 
  444                                 if(!$access_handler->checkAccessOfUser($tree, $user_id, 
'read', 
'', $a_blog_node_id))
 
  453                                         !$ilAccess->checkAccessOfUser($user_id, 
'write', 
'', $a_blog_node_id))
 
  457                                 if(!$ilAccess->checkAccessOfUser($user_id, 
'read', 
'', $a_blog_node_id))
 
  465                         $ulng->loadLanguageModule(
'blog');
 
  467                         $subject = sprintf($ulng->txt(
'blog_change_notification_subject'), $blog_title);
 
  470                         $message .= $ulng->txt(
'blog_change_notification_body_'.$a_action).
":\n\n";
 
  471                         $message .= $ulng->txt(
'obj_blog').
": ".$blog_title.
"\n";
 
  472                         $message .= $ulng->txt(
'blog_posting').
": ".$posting_title.
"\n";
 
  476                                 $message .= 
"\n".$ulng->txt(
'comment').
":\n\"".trim($a_comment).
"\"\n";
 
  478                         $message .= 
"\n".$ulng->txt(
'blog_change_notification_link').
": ".$link;                                
 
  480                         $mail_obj = 
new ilMail(ANONYMOUS_USER_ID);
 
  481                         $mail_obj->appendInstallationSignature(
true);
 
  483                                 "", 
"", $subject, $message, array(), array(
"system"));
 
  485                         $notified[] = $user_id;                 
 
  488                 if(
sizeof($notified))
 
  504                 if(!$ilSetting->get(
'enable_global_profiles'))
 
  510                 if(substr($a_wsp_id, -4) != 
"_cll")
 
  512                         include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  514                         $obj_id = $wsp_id->lookupObjectId($a_wsp_id);           
 
  519                         $a_wsp_id = substr($a_wsp_id, 0, -4);
 
  528                 $blog = 
new self($obj_id, 
false);               
 
  534                 include_once 
"Services/Feeds/classes/class.ilFeedWriter.php";
 
  537                 include_once 
"Services/Link/classes/class.ilLink.php";
 
  539                 $url = str_replace(
"&", 
"&", $url);
 
  542                 $feed->setChannelTitle(str_replace(
"&", 
"&", $blog->getTitle()));
 
  543                 $feed->setChannelDescription(str_replace(
"&", 
"&", $blog->getDescription()));
 
  544                 $feed->setChannelLink($url);
 
  547                 $tpl = 
new ilTemplate(
"tpl.main.html", 
true, 
true);
 
  549                 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");                                 
 
  550                 include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");                      
 
  563                         $snippet = str_replace(
"&", 
"&", $snippet); 
 
  566                         $url = str_replace(
"&", 
"&", $url);                         
 
  569                         $feed_item->setTitle($item[
"title"]);
 
  571                         $feed_item->setDescription($snippet);
 
  572                         $feed_item->setLink($url);
 
  573                         $feed_item->setAbout($url);                             
 
  574                         $feed->addItem($feed_item);
 
  591                 $crs_id = $tree->checkForParentType($a_node_id, 
"crs");
 
  597                 $grp_id = $tree->checkForParentType($a_node_id, 
"grp");
 
  619                                 include_once 
"Modules/Course/classes/class.ilCourseParticipants.php";
 
  624                                 include_once 
"Modules/Group/classes/class.ilGroupParticipants.php";
 
  629                         if($members && $members->getCountParticipants() < 100)
 
  631                                 return $members->getParticipants();                                                     
 
  638                 global $rbacadmin, $rbacreview, $ilDB;
 
  641                 $set = $ilDB->query(
"SELECT obj_id FROM object_data ".
 
  642                         " WHERE type=".$ilDB->quote(
"rolt", 
"text").
 
  643                         " AND title=".$ilDB->quote(
"il_blog_contributor", 
"text"));
 
  644                 $res = $ilDB->fetchAssoc($set);
 
  650                         $role_obj = $rolf_obj->createRole(
"il_blog_contributor_".$this->
getRefId(),
 
  651                                 "Contributor of blog obj_no.".$this->
getId());
 
  653                         $rbacadmin->copyRoleTemplatePermissions(
$res[
"obj_id"], ROLE_FOLDER_ID, 
 
  654                                 $rolf_obj->getRefId(), $role_obj->getId());
 
  657                         $ops = $rbacreview->getOperationsOfRole($role_obj->getId(), 
"blog", $rolf_obj->getRefId());
 
  658                         $rbacadmin->grantPermission($role_obj->getId(), $ops, $this->
getRefId());
 
  676                 foreach($rbacreview->getLocalRoles($a_node_id) as $role_id)
 
  689                 include_once 
"Services/AccessControl/classes/class.ilObjRole.php";
 
  695                 foreach($rbacreview->getParentRoleIds($a_node_id) as $role_id => $role)
 
  697                         if($role_id != $contr_role_id &&
 
  698                                 in_array($contr_op_id, $rbacreview->getActiveOperationsOfRole($a_node_id, $role_id)))