ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjBlog Class Reference

Class ilObjBlog. More...

+ Inheritance diagram for ilObjBlog:
+ Collaboration diagram for ilObjBlog:

Public Member Functions

 __construct ($a_id=0, $a_reference=true)
 Constructor. More...
 
 initType ()
 
 getNotesStatus ()
 Get notes status. More...
 
 setNotesStatus ($a_status)
 Toggle notes status. More...
 
 hasProfilePicture ()
 Get profile picture status. More...
 
 setProfilePicture ($a_status)
 Toggle profile picture status. More...
 
 getBackgroundColor ()
 Get background color. More...
 
 setBackgroundColor ($a_value)
 Set background color. More...
 
 getFontColor ()
 Get font color. More...
 
 setFontColor ($a_value)
 Set font color. More...
 
 getImage ()
 Get banner image. More...
 
 setImage ($a_value)
 Set banner image. More...
 
 getImageFullPath ($a_as_thumb=false)
 Get banner image incl. More...
 
 deleteImage ()
 remove existing file More...
 
 uploadImage (array $a_upload)
 Upload new image file. More...
 
 hasRSS ()
 Get RSS status. More...
 
 setRSS ($a_status)
 Toggle RSS status. More...
 
 hasApproval ()
 Get approval status. More...
 
 setApproval ($a_status)
 Toggle approval status. More...
 
 getStyleSheetId ()
 Get style sheet id. More...
 
 setStyleSheetId ($a_style)
 Set style sheet id. More...
 
 hasAbstractShorten ()
 
 setAbstractShorten ($a_value)
 
 getAbstractShortenLength ()
 
 setAbstractShortenLength ($a_value)
 
 hasAbstractImage ()
 
 setAbstractImage ($a_value)
 
 getAbstractImageWidth ()
 
 setAbstractImageWidth ($a_value)
 
 getAbstractImageHeight ()
 
 setAbstractImageHeight ($a_value)
 
 setKeywords ($a_value)
 
 hasKeywords ()
 
 setAuthors ($a_value)
 
 hasAuthors ()
 
 setNavMode ($a_value)
 
 getNavMode ()
 
 setNavModeListMonthsWithPostings ($a_value)
 
 getNavModeListMonthsWithPostings ()
 
 setNavModeListMonths ($a_value)
 
 getNavModeListMonths ()
 
 setOverviewPostings ($a_value)
 
 getOverviewPostings ()
 
 setOrder (array $a_values=null)
 
 getOrder ()
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public More...
 
 getLocalContributorRole ($a_node_id)
 
 getLocalEditorRole ($a_node_id)
 
 getAllLocalRoles ($a_node_id)
 
 getRolesWithContributeOrRedact ($a_node_id)
 
- Public Member Functions inherited from ilObject2
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 Read data from db. More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 create ($a_clone_mode=false)
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 cloneObject ($a_target_id, $a_copy_id=null, $a_omit_tree=false)
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static initStorage ($a_id, $a_subdir=null)
 Init file system storage. More...
 
static sendNotification ($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment=null)
 
static deliverRSS ($a_wsp_id)
 Deliver blog as rss feed. More...
 
- Static Public Member Functions inherited from ilObject2
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data@access public More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $a_show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date @global type $ilDB. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data@access public More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

const NAV_MODE_LIST = 1
 
const NAV_MODE_MONTH = 2
 
const ABSTRACT_DEFAULT_SHORTEN_LENGTH = 500
 
const ABSTRACT_DEFAULT_IMAGE_WIDTH = 144
 
const ABSTRACT_DEFAULT_IMAGE_HEIGHT = 144
 
const NAV_MODE_LIST_DEFAULT_POSTINGS = 10
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Protected Member Functions

 doRead ()
 
 doCreate ()
 
 doDelete ()
 
 doUpdate ()
 
 doCloneObject ($new_obj, $a_target_id, $a_copy_id=null, $a_omit_tree=false)
 
 handleQuotaUpdate ()
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate ()
 
 beforeCreate ()
 
 doUpdate ()
 
 beforeUpdate ()
 
 doMDUpdateListener ($a_element)
 
 beforeMDUpdateListener ($a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject ($new_obj, $a_target_id, $a_copy_id=null)
 
 beforeCloneObject ()
 

Protected Attributes

 $notes
 
 $bg_color
 
 $font_color
 
 $img
 
 $ppic
 
 $rss
 
 $approval
 
 $style
 
 $abstract_shorten = false
 
 $abstract_shorten_length = self::ABSTRACT_DEFAULT_SHORTEN_LENGTH
 
 $abstract_image = false
 
 $abstract_image_width = self::ABSTRACT_DEFAULT_IMAGE_WIDTH
 
 $abstract_image_height = self::ABSTRACT_DEFAULT_IMAGE_HEIGHT
 
 $keywords = true
 
 $nav_mode = self::NAV_MODE_LIST
 
 $nav_mode_list_postings = self::NAV_MODE_LIST_DEFAULT_POSTINGS
 
 $nav_mode_list_months
 
 $overview_postings
 
 $authors = true
 
 $order
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Detailed Description

Class ilObjBlog.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilObjFolder.php 25528 2010-09-03 10:37:11Z smeyer

Definition at line 15 of file class.ilObjBlog.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjBlog::__construct (   $a_id = 0,
  $a_reference = true 
)

Constructor.

Reimplemented from ilObject2.

Definition at line 21 of file class.ilObjBlog.php.

22 {
23 global $DIC;
24
25 parent::__construct($a_id, $a_reference);
26 $this->rbacreview = $DIC->rbac()->review();
27 }
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ deleteImage()

ilObjBlog::deleteImage ( )

remove existing file

Definition at line 349 of file class.ilObjBlog.php.

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 }
setImage($a_value)
Set banner image.

References handleQuotaUpdate(), and setImage().

Referenced by doDelete(), and uploadImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deliverRSS()

static ilObjBlog::deliverRSS (   $a_wsp_id)
static

Deliver blog as rss feed.

Parameters
int$a_wsp_id

Definition at line 732 of file class.ilObjBlog.php.

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("&", "&", $url);
769
770 // #11870
771 $feed->setChannelTitle(str_replace("&", "&", $blog->getTitle()));
772 $feed->setChannelDescription(str_replace("&", "&", $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 }
$tpl
Definition: ilias.php:10
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.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
A FeedItem represents an item in a News Feed.
Feed writer class.
static _lookupObjId($a_id)
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
special template class to simplify handling of ITX/PEAR
Tree handler for personal workspace.
global $ilSetting
Definition: privfeed.php:17
$url

References $DIC, ilObject\$id, $ilSetting, $tpl, $url, ilLink\_getStaticLink(), ilPageObject\_lookupActive(), ilObject\_lookupObjId(), exit, ilBlogPosting\getAllPostings(), ilBlogPostingGUI\getSnippet(), and IL_CAL_DATETIME.

+ Here is the call graph for this function:

◆ doCloneObject()

ilObjBlog::doCloneObject (   $new_obj,
  $a_target_id,
  $a_copy_id = null,
  $a_omit_tree = false 
)
protected

Definition at line 186 of file class.ilObjBlog.php.

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 }
$source
Definition: linkback.php:22
hasProfilePicture()
Get profile picture status.
getStyleSheetId()
Get style sheet id.
getFontColor()
Get font color.
static initStorage($a_id, $a_subdir=null)
Init file system storage.
getBackgroundColor()
Get background color.
getAbstractShortenLength()
hasApproval()
Get approval status.
hasRSS()
Get RSS status.
getImage()
Get banner image.
getNotesStatus()
Get notes status.
static _lookupStandard($a_id)
Lookup standard flag.
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

References $img, $source, $target, ilObjStyleSheet\_lookupStandard(), getAbstractImageHeight(), getAbstractImageWidth(), getAbstractShortenLength(), getBackgroundColor(), getFontColor(), ilObject2\getId(), getImage(), ilObjectFactory\getInstanceByObjId(), getNotesStatus(), getStyleSheetId(), hasAbstractImage(), hasAbstractShorten(), hasApproval(), hasProfilePicture(), hasRSS(), and initStorage().

+ Here is the call graph for this function:

◆ doCreate()

ilObjBlog::doCreate ( )
protected

Reimplemented from ilObject2.

Definition at line 99 of file class.ilObjBlog.php.

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 }
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
global $ilDB

References ilObject\$db, $ilDB, and ilNote\activateComments().

+ Here is the call graph for this function:

◆ doDelete()

ilObjBlog::doDelete ( )
protected

Reimplemented from ilObject2.

Definition at line 134 of file class.ilObjBlog.php.

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 }
static deleteAllBlogPostings($a_blog_id)
Delete all postings for blog.
static removeForObject($type, $id)
Remove all notifications for given object.
deleteImage()
remove existing file

References ilObject\$db, $ilDB, ilBlogPosting\deleteAllBlogPostings(), deleteImage(), ilNotification\removeForObject(), and ilNotification\TYPE_BLOG.

+ Here is the call graph for this function:

◆ doRead()

ilObjBlog::doRead ( )
protected

Reimplemented from ilObject2.

Definition at line 63 of file class.ilObjBlog.php.

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 }
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
setBackgroundColor($a_value)
Set background color.
setProfilePicture($a_status)
Toggle profile picture status.
setNavModeListMonthsWithPostings($a_value)
setFontColor($a_value)
Set font color.
setAuthors($a_value)
setNotesStatus($a_status)
Toggle notes status.
setAbstractShorten($a_value)
setKeywords($a_value)
setAbstractShortenLength($a_value)
setRSS($a_status)
Toggle RSS status.
setAbstractImage($a_value)
setOrder(array $a_values=null)
setOverviewPostings($a_value)
setAbstractImageHeight($a_value)
setNavMode($a_value)
setStyleSheetId($a_style)
Set style sheet id.
setAbstractImageWidth($a_value)
setNavModeListMonths($a_value)
setApproval($a_status)
Toggle approval status.
static lookupObjectStyle($a_obj_id)
Lookup object style.

References ilObject\$db, $ilDB, $row, ilNote\commentsActivated(), ilObjStyleSheet\lookupObjectStyle(), setAbstractImage(), setAbstractImageHeight(), setAbstractImageWidth(), setAbstractShorten(), setAbstractShortenLength(), setApproval(), setAuthors(), setBackgroundColor(), setFontColor(), setImage(), setKeywords(), setNavMode(), setNavModeListMonths(), setNavModeListMonthsWithPostings(), setNotesStatus(), setOrder(), setOverviewPostings(), setProfilePicture(), setRSS(), and setStyleSheetId().

+ Here is the call graph for this function:

◆ doUpdate()

ilObjBlog::doUpdate ( )
protected

Reimplemented from ilObject2.

Definition at line 151 of file class.ilObjBlog.php.

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 }
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.

References ilObject\$db, $ilDB, ilNote\activateComments(), getNotesStatus(), getOrder(), getStyleSheetId(), and ilObjStyleSheet\writeStyleUsage().

+ Here is the call graph for this function:

◆ getAbstractImageHeight()

ilObjBlog::getAbstractImageHeight ( )

Definition at line 537 of file class.ilObjBlog.php.

538 {
540 }

References $abstract_image_height.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ getAbstractImageWidth()

ilObjBlog::getAbstractImageWidth ( )

Definition at line 527 of file class.ilObjBlog.php.

528 {
530 }

References $abstract_image_width.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ getAbstractShortenLength()

ilObjBlog::getAbstractShortenLength ( )

Definition at line 507 of file class.ilObjBlog.php.

508 {
510 }

References $abstract_shorten_length.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ getAllLocalRoles()

ilObjBlog::getAllLocalRoles (   $a_node_id)

Definition at line 853 of file class.ilObjBlog.php.

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 }
static _getTranslation($a_role_title)
static _lookupTitle($a_id)
lookup object title
foreach($_POST as $key=> $value) $res

References ilObject\$rbacreview, $res, ilObjRole\_getTranslation(), and ilObject\_lookupTitle().

+ Here is the call graph for this function:

◆ getBackgroundColor()

ilObjBlog::getBackgroundColor ( )

Get background color.

Returns
string

Definition at line 268 of file class.ilObjBlog.php.

269 {
270 if (!$this->bg_color) {
271 $this->bg_color = "ffffff";
272 }
273 return $this->bg_color;
274 }

References $bg_color.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ getFontColor()

ilObjBlog::getFontColor ( )

Get font color.

Returns
string

Definition at line 291 of file class.ilObjBlog.php.

292 {
293 if (!$this->font_color) {
294 $this->font_color = "505050";
295 }
296 return $this->font_color;
297 }

References $font_color.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ getImage()

ilObjBlog::getImage ( )

Get banner image.

Returns
string

Definition at line 314 of file class.ilObjBlog.php.

315 {
316 return $this->img;
317 }

References $img.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ getImageFullPath()

ilObjBlog::getImageFullPath (   $a_as_thumb = false)

Get banner image incl.

path

Parameters
bool$a_as_thumb

Definition at line 334 of file class.ilObjBlog.php.

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 }

References $img, $path, and initStorage().

+ Here is the call graph for this function:

◆ getLocalContributorRole()

ilObjBlog::getLocalContributorRole (   $a_node_id)

Definition at line 831 of file class.ilObjBlog.php.

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 }

References ilObject\$rbacreview, and ilObject\_lookupTitle().

Referenced by getRolesWithContributeOrRedact().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocalEditorRole()

ilObjBlog::getLocalEditorRole (   $a_node_id)

Definition at line 842 of file class.ilObjBlog.php.

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 }

References ilObject\$rbacreview, and ilObject\_lookupTitle().

Referenced by getRolesWithContributeOrRedact().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNavMode()

ilObjBlog::getNavMode ( )

Definition at line 575 of file class.ilObjBlog.php.

576 {
577 return $this->nav_mode;
578 }

References $nav_mode.

◆ getNavModeListMonths()

ilObjBlog::getNavModeListMonths ( )

Definition at line 600 of file class.ilObjBlog.php.

601 {
603 }

References $nav_mode_list_months.

◆ getNavModeListMonthsWithPostings()

ilObjBlog::getNavModeListMonthsWithPostings ( )

Definition at line 585 of file class.ilObjBlog.php.

586 {
587 return $this->nav_mode_list_months_with_post;
588 }

◆ getNotesStatus()

ilObjBlog::getNotesStatus ( )

Get notes status.

Returns
bool

Definition at line 228 of file class.ilObjBlog.php.

229 {
230 return $this->notes;
231 }

References $notes.

Referenced by doCloneObject(), and doUpdate().

+ Here is the caller graph for this function:

◆ getOrder()

ilObjBlog::getOrder ( )

Definition at line 625 of file class.ilObjBlog.php.

626 {
627 return (array) $this->order;
628 }

References $order.

Referenced by doUpdate().

+ Here is the caller graph for this function:

◆ getOverviewPostings()

ilObjBlog::getOverviewPostings ( )

Definition at line 615 of file class.ilObjBlog.php.

616 {
618 }

References $overview_postings.

◆ getRolesWithContributeOrRedact()

ilObjBlog::getRolesWithContributeOrRedact (   $a_node_id)

Definition at line 868 of file class.ilObjBlog.php.

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 }
getLocalContributorRole($a_node_id)
getLocalEditorRole($a_node_id)
static _getOperationIdByName($a_operation)
get operation id by name of operation @access public @access static

References ilObject\$rbacreview, $res, ilRbacReview\_getOperationIdByName(), ilObjRole\_getTranslation(), getLocalContributorRole(), and getLocalEditorRole().

+ Here is the call graph for this function:

◆ getStyleSheetId()

ilObjBlog::getStyleSheetId ( )

Get style sheet id.

Returns
bool

Definition at line 482 of file class.ilObjBlog.php.

483 {
484 return (int) $this->style;
485 }

References $style.

Referenced by doCloneObject(), and doUpdate().

+ Here is the caller graph for this function:

◆ handleQuotaUpdate()

ilObjBlog::handleQuotaUpdate ( )
protected

Definition at line 894 of file class.ilObjBlog.php.

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 }
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.
getType()
get object type @access public
static dirsize($directory)
get size of a directory or a file.

References ilUtil\dirsize(), ilObject2\getId(), ilObject2\getType(), ilDiskQuotaHandler\handleUpdatedSourceObject(), and initStorage().

Referenced by deleteImage(), and uploadImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasAbstractImage()

ilObjBlog::hasAbstractImage ( )

Definition at line 517 of file class.ilObjBlog.php.

518 {
520 }

References $abstract_image.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ hasAbstractShorten()

ilObjBlog::hasAbstractShorten ( )

Definition at line 497 of file class.ilObjBlog.php.

498 {
500 }

References $abstract_shorten.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ hasApproval()

ilObjBlog::hasApproval ( )

Get approval status.

Returns
bool

Definition at line 462 of file class.ilObjBlog.php.

463 {
464 return (bool) $this->approval;
465 }

References $approval.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ hasAuthors()

ilObjBlog::hasAuthors ( )

Definition at line 562 of file class.ilObjBlog.php.

563 {
564 return $this->authors;
565 }

References $authors.

◆ hasKeywords()

ilObjBlog::hasKeywords ( )

Definition at line 552 of file class.ilObjBlog.php.

553 {
554 return $this->keywords;
555 }

References $keywords.

◆ hasProfilePicture()

ilObjBlog::hasProfilePicture ( )

Get profile picture status.

Returns
bool

Definition at line 248 of file class.ilObjBlog.php.

249 {
250 return $this->ppic;
251 }

References $ppic.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ hasRSS()

ilObjBlog::hasRSS ( )

Get RSS status.

Returns
bool

Definition at line 442 of file class.ilObjBlog.php.

443 {
444 return $this->rss;
445 }

References $rss.

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjBlog::initDefaultRoles ( )

init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public

Returns
array empty array

Reimplemented from ilObject2.

Definition at line 810 of file class.ilObjBlog.php.

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 }
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
getRefId()
get reference id @access public

References ilObjRole\createDefaultRole(), ilObject2\getId(), and ilObject2\getRefId().

+ Here is the call graph for this function:

◆ initStorage()

static ilObjBlog::initStorage (   $a_id,
  $a_subdir = null 
)
static

Init file system storage.

Parameters
type$a_id
type$a_subdir
Returns
string

Definition at line 369 of file class.ilObjBlog.php.

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 }

References $path.

Referenced by doCloneObject(), getImageFullPath(), ilBlogDataSet\getXmlRecord(), handleQuotaUpdate(), ilBlogDataSet\importRecord(), and uploadImage().

+ Here is the caller graph for this function:

◆ initType()

ilObjBlog::initType ( )

Reimplemented from ilObject2.

Definition at line 58 of file class.ilObjBlog.php.

59 {
60 $this->type = "blog";
61 }

◆ sendNotification()

static ilObjBlog::sendNotification (   $a_action,
  $a_in_wsp,
  $a_blog_node_id,
  $a_posting_id,
  $a_comment = null 
)
static

Definition at line 630 of file class.ilObjBlog.php.

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 }
$users
Definition: authpage.php:44
Class ilBlogPosting.
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.
Wrapper classes for system notifications.
Access handler for personal workspace.
$ilUser
Definition: imgupload.php:18

References $DIC, $ilUser, ilObject\$tree, $users, ilObject\_lookupObjId(), ilNotification\getNotificationsForObject(), ilNotification\TYPE_BLOG, and ilNotification\updateNotificationTime().

Referenced by ilBlogPostingGUI\activatePage(), ilBlogPostingGUI\observeNoteAction(), and ilBlogPosting\update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAbstractImage()

ilObjBlog::setAbstractImage (   $a_value)

Definition at line 522 of file class.ilObjBlog.php.

523 {
524 $this->abstract_image = (bool) $a_value;
525 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setAbstractImageHeight()

ilObjBlog::setAbstractImageHeight (   $a_value)

Definition at line 542 of file class.ilObjBlog.php.

543 {
544 $this->abstract_image_height = (int) $a_value;
545 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setAbstractImageWidth()

ilObjBlog::setAbstractImageWidth (   $a_value)

Definition at line 532 of file class.ilObjBlog.php.

533 {
534 $this->abstract_image_width = (int) $a_value;
535 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setAbstractShorten()

ilObjBlog::setAbstractShorten (   $a_value)

Definition at line 502 of file class.ilObjBlog.php.

503 {
504 $this->abstract_shorten = (bool) $a_value;
505 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setAbstractShortenLength()

ilObjBlog::setAbstractShortenLength (   $a_value)

Definition at line 512 of file class.ilObjBlog.php.

513 {
514 $this->abstract_shorten_length = (int) $a_value;
515 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setApproval()

ilObjBlog::setApproval (   $a_status)

Toggle approval status.

Parameters
bool$a_status

Definition at line 472 of file class.ilObjBlog.php.

473 {
474 $this->approval = (bool) $a_status;
475 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setAuthors()

ilObjBlog::setAuthors (   $a_value)

Definition at line 557 of file class.ilObjBlog.php.

558 {
559 $this->authors = (bool) $a_value;
560 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setBackgroundColor()

ilObjBlog::setBackgroundColor (   $a_value)

Set background color.

Parameters
string$a_value

Definition at line 281 of file class.ilObjBlog.php.

282 {
283 $this->bg_color = (string) $a_value;
284 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setFontColor()

ilObjBlog::setFontColor (   $a_value)

Set font color.

Parameters
string$a_value

Definition at line 304 of file class.ilObjBlog.php.

305 {
306 $this->font_color = (string) $a_value;
307 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setImage()

ilObjBlog::setImage (   $a_value)

Set banner image.

Parameters
string$a_value

Definition at line 324 of file class.ilObjBlog.php.

325 {
326 $this->img = (string) $a_value;
327 }

Referenced by deleteImage(), doRead(), and uploadImage().

+ Here is the caller graph for this function:

◆ setKeywords()

ilObjBlog::setKeywords (   $a_value)

Definition at line 547 of file class.ilObjBlog.php.

548 {
549 $this->keywords = (bool) $a_value;
550 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setNavMode()

ilObjBlog::setNavMode (   $a_value)

Definition at line 567 of file class.ilObjBlog.php.

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 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setNavModeListMonths()

ilObjBlog::setNavModeListMonths (   $a_value)

Definition at line 590 of file class.ilObjBlog.php.

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 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setNavModeListMonthsWithPostings()

ilObjBlog::setNavModeListMonthsWithPostings (   $a_value)

Definition at line 580 of file class.ilObjBlog.php.

581 {
582 $this->nav_mode_list_months_with_post = (int) $a_value;
583 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setNotesStatus()

ilObjBlog::setNotesStatus (   $a_status)

Toggle notes status.

Parameters
bool$a_status

Definition at line 238 of file class.ilObjBlog.php.

239 {
240 $this->notes = (bool) $a_status;
241 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setOrder()

ilObjBlog::setOrder ( array  $a_values = null)

Definition at line 620 of file class.ilObjBlog.php.

621 {
622 $this->order = $a_values;
623 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setOverviewPostings()

ilObjBlog::setOverviewPostings (   $a_value)

Definition at line 605 of file class.ilObjBlog.php.

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 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setProfilePicture()

ilObjBlog::setProfilePicture (   $a_status)

Toggle profile picture status.

Parameters
bool$a_status

Definition at line 258 of file class.ilObjBlog.php.

259 {
260 $this->ppic = (bool) $a_status;
261 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setRSS()

ilObjBlog::setRSS (   $a_status)

Toggle RSS status.

Parameters
bool$a_status

Definition at line 452 of file class.ilObjBlog.php.

453 {
454 $this->rss = (bool) $a_status;
455 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilObjBlog::setStyleSheetId (   $a_style)

Set style sheet id.

Parameters
int$a_style

Definition at line 492 of file class.ilObjBlog.php.

493 {
494 $this->style = (int) $a_style;
495 }

Referenced by doRead().

+ Here is the caller graph for this function:

◆ uploadImage()

ilObjBlog::uploadImage ( array  $a_upload)

Upload new image file.

Parameters
array$a_upload
Returns
bool

Definition at line 394 of file class.ilObjBlog.php.

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 }
ILIAS Setting Class.
static escapeShellArg($a_arg)
static execConvert($args)
execute convert command

References $path, deleteImage(), ilUtil\escapeShellArg(), ilUtil\execConvert(), handleQuotaUpdate(), initStorage(), and setImage().

+ Here is the call graph for this function:

Field Documentation

◆ $abstract_image

ilObjBlog::$abstract_image = false
protected

Definition at line 39 of file class.ilObjBlog.php.

Referenced by hasAbstractImage().

◆ $abstract_image_height

ilObjBlog::$abstract_image_height = self::ABSTRACT_DEFAULT_IMAGE_HEIGHT
protected

Definition at line 41 of file class.ilObjBlog.php.

Referenced by getAbstractImageHeight().

◆ $abstract_image_width

ilObjBlog::$abstract_image_width = self::ABSTRACT_DEFAULT_IMAGE_WIDTH
protected

Definition at line 40 of file class.ilObjBlog.php.

Referenced by getAbstractImageWidth().

◆ $abstract_shorten

ilObjBlog::$abstract_shorten = false
protected

Definition at line 37 of file class.ilObjBlog.php.

Referenced by hasAbstractShorten().

◆ $abstract_shorten_length

ilObjBlog::$abstract_shorten_length = self::ABSTRACT_DEFAULT_SHORTEN_LENGTH
protected

Definition at line 38 of file class.ilObjBlog.php.

Referenced by getAbstractShortenLength().

◆ $approval

ilObjBlog::$approval
protected

Definition at line 35 of file class.ilObjBlog.php.

Referenced by hasApproval().

◆ $authors

ilObjBlog::$authors = true
protected

Definition at line 47 of file class.ilObjBlog.php.

Referenced by hasAuthors().

◆ $bg_color

ilObjBlog::$bg_color
protected

Definition at line 30 of file class.ilObjBlog.php.

Referenced by getBackgroundColor().

◆ $font_color

ilObjBlog::$font_color
protected

Definition at line 31 of file class.ilObjBlog.php.

Referenced by getFontColor().

◆ $img

ilObjBlog::$img
protected

Definition at line 32 of file class.ilObjBlog.php.

Referenced by doCloneObject(), getImage(), and getImageFullPath().

◆ $keywords

ilObjBlog::$keywords = true
protected

Definition at line 42 of file class.ilObjBlog.php.

Referenced by hasKeywords().

◆ $nav_mode

ilObjBlog::$nav_mode = self::NAV_MODE_LIST
protected

Definition at line 43 of file class.ilObjBlog.php.

Referenced by getNavMode().

◆ $nav_mode_list_months

ilObjBlog::$nav_mode_list_months
protected

Definition at line 45 of file class.ilObjBlog.php.

Referenced by getNavModeListMonths().

◆ $nav_mode_list_postings

ilObjBlog::$nav_mode_list_postings = self::NAV_MODE_LIST_DEFAULT_POSTINGS
protected

Definition at line 44 of file class.ilObjBlog.php.

◆ $notes

ilObjBlog::$notes
protected

Definition at line 29 of file class.ilObjBlog.php.

Referenced by getNotesStatus().

◆ $order

ilObjBlog::$order
protected

Definition at line 48 of file class.ilObjBlog.php.

Referenced by getOrder().

◆ $overview_postings

ilObjBlog::$overview_postings
protected

Definition at line 46 of file class.ilObjBlog.php.

Referenced by getOverviewPostings().

◆ $ppic

ilObjBlog::$ppic
protected

Definition at line 33 of file class.ilObjBlog.php.

Referenced by hasProfilePicture().

◆ $rss

ilObjBlog::$rss
protected

Definition at line 34 of file class.ilObjBlog.php.

Referenced by hasRSS().

◆ $style

ilObjBlog::$style
protected

Definition at line 36 of file class.ilObjBlog.php.

Referenced by getStyleSheetId().

◆ ABSTRACT_DEFAULT_IMAGE_HEIGHT

const ilObjBlog::ABSTRACT_DEFAULT_IMAGE_HEIGHT = 144

Definition at line 55 of file class.ilObjBlog.php.

Referenced by ilObjBlogGUI\getEditFormCustomValues().

◆ ABSTRACT_DEFAULT_IMAGE_WIDTH

const ilObjBlog::ABSTRACT_DEFAULT_IMAGE_WIDTH = 144

Definition at line 54 of file class.ilObjBlog.php.

Referenced by ilObjBlogGUI\getEditFormCustomValues().

◆ ABSTRACT_DEFAULT_SHORTEN_LENGTH

const ilObjBlog::ABSTRACT_DEFAULT_SHORTEN_LENGTH = 500

Definition at line 53 of file class.ilObjBlog.php.

Referenced by ilObjBlogGUI\getEditFormCustomValues().

◆ NAV_MODE_LIST

const ilObjBlog::NAV_MODE_LIST = 1

◆ NAV_MODE_LIST_DEFAULT_POSTINGS

const ilObjBlog::NAV_MODE_LIST_DEFAULT_POSTINGS = 10

Definition at line 56 of file class.ilObjBlog.php.

◆ NAV_MODE_MONTH

const ilObjBlog::NAV_MODE_MONTH = 2

Definition at line 51 of file class.ilObjBlog.php.

Referenced by ilObjBlogGUI\initEditCustomForm().


The documentation for this class was generated from the following file: