5require_once 
"Services/Object/classes/class.ilObject2.php";
 
   55                $set = 
$ilDB->query(
"SELECT * FROM il_blog".
 
   56                                " WHERE id = ".
$ilDB->quote($this->id, 
"integer"));
 
   62                $this->
setRSS($row[
"rss_active"]);
 
   75                if(trim(
$row[
"nav_order"]))
 
   81                include_once(
"./Services/Notes/classes/class.ilNote.php");
 
   84                include_once(
"./Services/Style/Content/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").
",".             
 
   99                        $ilDB->quote($this->hasAbstractShorten(), 
"integer").
",".
 
  100                        $ilDB->quote($this->getAbstractShortenLength(), 
"integer").
",".
 
  101                        $ilDB->quote($this->hasAbstractImage(), 
"integer").
",".
 
  102                        $ilDB->quote($this->getAbstractImageWidth(), 
"integer").
",".
 
  103                        $ilDB->quote($this->getAbstractImageHeight(), 
"integer").
",".   
 
  104                        $ilDB->quote($this->hasKeywords(), 
"integer").
",".      
 
  105                        $ilDB->quote($this->hasAuthors(), 
"integer").
",".       
 
  106                        $ilDB->quote($this->getNavMode(), 
"integer").
",".       
 
  107                        $ilDB->quote($this->getNavModeListPostings(), 
"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/Content/classes/class.ilObjStyleSheet.php");
 
  176        protected function doCloneObject($new_obj, $a_target_id, $a_copy_id = 
null, $a_omit_tree = 
false)
 
  182                        $new_obj->setImage(
$img);
 
  185                        $target = $new_obj->initStorage($new_obj->getId());
 
  187                        copy($source.$img, 
$target.$img);
 
  194                $new_obj->setRSS($this->
hasRSS());
 
  204                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  209                        $new_id = $style_obj->ilClone();
 
  210                        $new_obj->setStyleSheetId($new_id);
 
  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;
 
  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";
 
  650                        $blog_obj_id = $tree->lookupObjectId($a_blog_node_id);                                                  
 
  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";
 
  695                        in_array($a_action, array(
"update", 
"new")))
 
  697                        $posting->handleNews(($a_action == 
"update"));
 
  701                include_once 
"./Services/Notification/classes/class.ilNotification.php";                
 
  703                        $blog_obj_id, $a_posting_id, $ignore_threshold);                        
 
  709                include_once 
"./Services/Notification/classes/class.ilSystemNotification.php";
 
  711                $ntf->setLangModules(array(
"blog"));
 
  712                $ntf->setRefId($a_blog_node_id);
 
  713                $ntf->setChangedByUserId(
$ilUser->getId());
 
  714                $ntf->setSubjectLangId(
'blog_change_notification_subject');
 
  715                $ntf->setIntroductionLangId(
'blog_change_notification_body_'.$a_action);
 
  716                $ntf->addAdditionalInfo(
'blog_posting', $posting->getTitle());
 
  719                        $ntf->addAdditionalInfo(
'comment', $a_comment, 
true);
 
  721                $ntf->setGotoLangId(
'blog_change_notification_link');                           
 
  722                $ntf->setReasonLangId(
'blog_change_notification_reason');               
 
  724                $abstract = $posting->getNotificationAbstract();
 
  727                        $ntf->addAdditionalInfo(
'content', $abstract, 
true);
 
  730                $notified = $ntf->sendMail($users, 
"_".$a_posting_id, 
 
  731                        ($admin_only ? 
"write" : 
"read"));                      
 
  734                if(
sizeof($notified))
 
  749                if(!
$ilSetting->get(
'enable_global_profiles'))
 
  755                if(substr($a_wsp_id, -4) != 
"_cll")
 
  757                        include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  759                        $obj_id = $wsp_id->lookupObjectId($a_wsp_id);   
 
  764                        $a_wsp_id = substr($a_wsp_id, 0, -4);
 
  773                $blog = 
new self($obj_id, 
false);               
 
  779                include_once 
"Services/Feeds/classes/class.ilFeedWriter.php";
 
  782                include_once 
"Services/Link/classes/class.ilLink.php";
 
  784                $url = str_replace(
"&", 
"&", 
$url);
 
  787                $feed->setChannelTitle(str_replace(
"&", 
"&", $blog->getTitle()));
 
  788                $feed->setChannelDescription(str_replace(
"&", 
"&", $blog->getDescription()));
 
  789                $feed->setChannelLink(
$url);
 
  794                include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");                                 
 
  795                include_once(
"./Modules/Blog/classes/class.ilBlogPostingGUI.php");                      
 
  809                        $snippet = str_replace(
"&", 
"&", $snippet); 
 
  810                        $snippet = 
"<![CDATA[".$snippet.
"]]>";
 
  813                        $url = str_replace(
"&", 
"&", 
$url);                         
 
  816                        $feed_item->setTitle(str_replace(
"&", 
"&", $item[
"title"])); 
 
  818                        $feed_item->setDescription($snippet);
 
  819                        $feed_item->setLink(
$url);
 
  820                        $feed_item->setAbout(
$url);                             
 
  821                        $feed->addItem($feed_item);
 
  830                include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
  832                                'il_blog_contributor_'.$this->
getRefId(),
 
  833                                "Contributor of blog obj_no.".$this->
getId(),
 
  834                                'il_blog_contributor',
 
  838                include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
  840                                'il_blog_editor_'.$this->
getRefId(),
 
  841                                "Editor of blog obj_no.".$this->
getId(),
 
  853                foreach($rbacreview->getLocalRoles($a_node_id) as $role_id)
 
  866                foreach($rbacreview->getLocalRoles($a_node_id) as $role_id)
 
  879                include_once 
"Services/AccessControl/classes/class.ilObjRole.php";
 
  882                foreach($rbacreview->getLocalRoles($a_node_id) as $role_id)
 
  895                include_once 
"Services/AccessControl/classes/class.ilObjRole.php";
 
  903                foreach($rbacreview->getParentRoleIds($a_node_id) as $role_id => $role)
 
  905                        if($role_id != $contr_role_id &&
 
  906                                $role_id != $editor_role_id)
 
  908                                $all_ops = $rbacreview->getActiveOperationsOfRole($a_node_id, $role_id);
 
  909                                if(in_array($contr_op_id, $all_ops) ||
 
  910                                        in_array($redact_op_id, $all_ops))
 
  922                include_once 
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
 
  926                        array($this->
getId())); 
 
An exception for terminatinating execution or to throw for unit testing.
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 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.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
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.
setBackgroundColor($a_value)
Set background color.
getRolesWithContributeOrRedact($a_node_id)
setProfilePicture($a_status)
Toggle profile picture status.
setFontColor($a_value)
Set font color.
hasProfilePicture()
Get profile picture status.
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)
getFontColor()
Get font color.
getImageFullPath($a_as_thumb=false)
Get banner image incl.
setAbstractShortenLength($a_value)
setRSS($a_status)
Toggle RSS status.
initDefaultRoles()
init default roles settings Purpose of this function is to create a local role folder and local roles...
setAbstractImage($a_value)
setNavModeListPostings($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()
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.
getImage()
Get banner image.
getNotesStatus()
Get notes status.
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
Wrapper classes for system notifications.
special template class to simplify handling of ITX/PEAR
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
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.