ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjBlog Class Reference

Class ilObjBlog. More...

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

Public Member Functions

 __construct (int $a_id=0, bool $a_reference=true)
 
 getNotesStatus ()
 
 setNotesStatus (bool $a_status)
 
 hasProfilePicture ()
 
 setProfilePicture (bool $a_status)
 
 getBackgroundColor ()
 
 setBackgroundColor (string $a_value)
 
 getFontColor ()
 
 setFontColor (string $a_value)
 
 getImage ()
 
 setImage (string $a_value)
 
 getImageFullPath (bool $a_as_thumb=false)
 
 deleteImage ()
 
 uploadImage (array $a_upload)
 Upload new image file. More...
 
 hasRSS ()
 
 setRSS (bool $a_status)
 
 hasApproval ()
 
 setApproval (bool $a_status)
 
 hasAbstractShorten ()
 
 setAbstractShorten (bool $a_value)
 
 getAbstractShortenLength ()
 
 setAbstractShortenLength (int $a_value)
 
 hasAbstractImage ()
 
 setAbstractImage (bool $a_value)
 
 getAbstractImageWidth ()
 
 setAbstractImageWidth (int $a_value)
 
 getAbstractImageHeight ()
 
 setAbstractImageHeight (int $a_value)
 
 setKeywords (bool $a_value)
 
 hasKeywords ()
 
 setAuthors (bool $a_value)
 
 hasAuthors ()
 
 setNavMode (int $a_value)
 
 getNavMode ()
 
 setNavModeListMonthsWithPostings (int $a_value)
 
 getNavModeListMonthsWithPostings ()
 
 setNavModeListMonths (?int $a_value)
 
 getNavModeListMonths ()
 
 setOverviewPostings (?int $a_value)
 
 getOverviewPostings ()
 
 setOrder (array $a_values=[])
 
 getOrder ()
 
 initDefaultRoles ()
 
 getLocalContributorRole (int $a_node_id)
 
 getLocalEditorRole (int $a_node_id)
 
 getAllLocalRoles (int $a_node_id)
 
 getRolesWithContributeOrRedact (int $a_node_id)
 
- Public Member Functions inherited from ilObject2
 __construct (int $a_id=0, bool $a_reference=true)
 Constructor. More...
 
 read ()
 
 create (bool $a_clone_mode=false)
 
 update ()
 
 delete ()
 
 cloneMetaData (ilObject $target_obj)
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! 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. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static initStorage (int $a_id, string $a_subdir=null)
 Init file system storage. More...
 
static sendNotification (string $a_action, bool $a_in_wsp, int $a_blog_node_id, int $a_posting_id, ?string $a_comment=null)
 
static deliverRSS (string $a_wsp_id)
 Deliver blog as rss feed. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 

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
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Protected Member Functions

 initType ()
 
 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 doDelete ()
 
 doUpdate ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
 handleQuotaUpdate ()
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 beforeCreate ()
 If overwritten this method should return true, there is currently no "abort" handling for cases where "false" is returned. More...
 
 doUpdate ()
 
 beforeUpdate ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
 beforeCloneObject ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Protected Attributes

ILIAS Style Content DomainService $content_style_domain
 
ILIAS Notes Service $notes_service
 
int $nav_mode_list_months_with_post = 0
 
bool $notes = false
 
string $bg_color = ""
 
string $font_color = ""
 
string $img = ""
 
bool $ppic = false
 
bool $rss = false
 
bool $approval = false
 
bool $style = false
 
bool $abstract_shorten = false
 
int $abstract_shorten_length = self::ABSTRACT_DEFAULT_SHORTEN_LENGTH
 
bool $abstract_image = false
 
int $abstract_image_width = self::ABSTRACT_DEFAULT_IMAGE_WIDTH
 
int $abstract_image_height = self::ABSTRACT_DEFAULT_IMAGE_HEIGHT
 
bool $keywords = true
 
int $nav_mode = self::NAV_MODE_LIST
 
int $nav_mode_list_postings = self::NAV_MODE_LIST_DEFAULT_POSTINGS
 
int $nav_mode_list_months = null
 
int $overview_postings = 5
 
bool $authors = true
 
array $order = []
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Private Attributes

ILIAS Filesystem Util Convert LegacyImages $image_conversion
 

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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, and ILIAS\MetaData\Repository\Validation\Data\__construct().

64  {
65  global $DIC;
66 
67  $this->notes_service = $DIC->notes();
68  parent::__construct($a_id, $a_reference);
69  $this->rbac_review = $DIC->rbac()->review();
70  $this->image_conversion = $DIC->fileConverters()->legacyImages();
71 
72  $this->content_style_domain = $DIC
73  ->contentStyle()
74  ->domain();
75  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ deleteImage()

ilObjBlog::deleteImage ( )

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

References handleQuotaUpdate(), and setImage().

Referenced by doDelete(), and uploadImage().

293  : void
294  {
295  if ($this->id) {
296  $storage = new ilFSStorageBlog($this->id);
297  $storage->delete();
298 
299  $this->setImage("");
300 
301  $this->handleQuotaUpdate();
302  }
303  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setImage(string $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deliverRSS()

static ilObjBlog::deliverRSS ( string  $a_wsp_id)
static

Deliver blog as rss feed.

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

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

623  : void
624  {
625  global $DIC;
626 
627  $ilSetting = $DIC->settings();
628 
629  if (!$ilSetting->get('enable_global_profiles')) {
630  return;
631  }
632 
633  // #10827
634  if (!str_ends_with($a_wsp_id, "_cll")) {
635  $wsp_id = new ilWorkspaceTree(0);
636  $obj_id = $wsp_id->lookupObjectId((int) $a_wsp_id);
637  $is_wsp = "_wsp";
638  $pl = $DIC->blog()->internal()->gui()->permanentLink(0, (int) $a_wsp_id);
639  } else {
640  $a_wsp_id = substr($a_wsp_id, 0, -4);
641  $obj_id = ilObject::_lookupObjId((int) $a_wsp_id);
642  $is_wsp = null;
643  $pl = $DIC->blog()->internal()->gui()->permanentLink((int) $a_wsp_id);
644  }
645  if (!$obj_id) {
646  return;
647  }
648 
649  $blog = new self($obj_id, false);
650  if (!$blog->hasRSS()) {
651  return;
652  }
653 
654  $feed = new ilFeedWriter();
655 
656  $url = $pl->getPermanentLink();
657  $url = str_replace("&", "&", $url);
658 
659  // #11870
660  $feed->setChannelTitle(str_replace("&", "&", $blog->getTitle()));
661  $feed->setChannelDescription(str_replace("&", "&", $blog->getDescription()));
662  $feed->setChannelLink($url);
663 
664  // needed for blogpostinggui / pagegui
665  $tpl = new ilGlobalTemplate("tpl.main.html", true, true);
666 
667  foreach (ilBlogPosting::getAllPostings($obj_id) as $item) {
668  $id = $item["id"];
669 
670  // only published items
671  $is_active = ilBlogPosting::_lookupActive($id, "blp");
672  if (!$is_active) {
673  continue;
674  }
675 
676  // #16434
677  $snippet = strip_tags(ilBlogPostingGUI::getSnippet($id), "<br><br/><div><p>");
678  $snippet = str_replace("&", "&amp;", $snippet);
679  $snippet = "<![CDATA[" . $snippet . "]]>";
680 
681  $url = $pl->getPermanentLink((int) $id);
682  $url = str_replace("&", "&amp;", $url);
683 
684  $feed_item = new ilFeedItem();
685  $feed_item->setTitle(str_replace("&", "&amp;", $item["title"])); // #16022
686  $feed_item->setDate($item["created"]->get(IL_CAL_DATETIME));
687  $feed_item->setDescription($snippet);
688  $feed_item->setLink($url);
689  $feed_item->setAbout($url);
690  $feed->addItem($feed_item);
691  }
692 
693  $feed->showFeed();
694  exit();
695  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
exit
Definition: login.php:29
const IL_CAL_DATETIME
static getAllPostings(int $a_blog_id, int $a_limit=1000, int $a_offset=0)
Get all postings of blog.
special template class to simplify handling of ITX/PEAR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
$url
Definition: ltiregstart.php:35
global $ilSetting
Definition: privfeed.php:18
static getSnippet(int $a_id, bool $a_truncate=false, int $a_truncate_length=500, string $a_truncate_sign="...", bool $a_include_picture=false, int $a_picture_width=144, int $a_picture_height=144, string $a_export_directory=null)
Get first text paragraph of page.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ doCloneObject()

ilObjBlog::doCloneObject ( ilObject2  $new_obj,
int  $a_target_id,
?int  $a_copy_id = null 
)
protected

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

References getAbstractImageHeight(), getAbstractImageWidth(), getAbstractShortenLength(), getBackgroundColor(), getFontColor(), ilObject\getId(), getImage(), getNotesStatus(), hasAbstractImage(), hasAbstractShorten(), hasApproval(), hasProfilePicture(), hasRSS(), and ilObject2\update().

192  : void
193  {
194  assert($new_obj instanceof ilObjBlog);
195  // banner?
196  $img = $this->getImage();
197  if ($img) {
198  $new_obj->setImage($img);
199 
200  $source = self::initStorage($this->getId());
201  $target = $new_obj->initStorage($new_obj->getId());
202 
203  copy($source . $img, $target . $img);
204  }
205 
206  $new_obj->setNotesStatus($this->getNotesStatus());
207  $new_obj->setProfilePicture($this->hasProfilePicture());
208  $new_obj->setBackgroundColor($this->getBackgroundColor());
209  $new_obj->setFontColor($this->getFontColor());
210  $new_obj->setRSS($this->hasRSS());
211  $new_obj->setApproval($this->hasApproval());
212  $new_obj->setAbstractShorten($this->hasAbstractShorten());
213  $new_obj->setAbstractShortenLength($this->getAbstractShortenLength());
214  $new_obj->setAbstractImage($this->hasAbstractImage());
215  $new_obj->setAbstractImageWidth($this->getAbstractImageWidth());
216  $new_obj->setAbstractImageHeight($this->getAbstractImageHeight());
217  $new_obj->update();
218 
219  // set/copy stylesheet
220  $this->content_style_domain->styleForObjId($this->getId())->cloneTo($new_obj->getId());
221  }
getAbstractShortenLength()
Class ilObjBlog.
+ Here is the call graph for this function:

◆ doCreate()

ilObjBlog::doCreate ( bool  $clone_mode = false)
protected

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

References ilObject\$db, $ilDB, getAbstractImageHeight(), getAbstractImageWidth(), getAbstractShortenLength(), getNavMode(), getNavModeListMonthsWithPostings(), getOverviewPostings(), hasAbstractImage(), hasAbstractShorten(), hasAuthors(), and hasKeywords().

116  : void
117  {
118  $ilDB = $this->db;
119 
120  $ilDB->manipulate("INSERT INTO il_blog (id,ppic,rss_active,approval" .
121  ",abs_shorten,abs_shorten_len,abs_image,abs_img_width,abs_img_height" .
122  ",keywords,authors,nav_mode,nav_list_mon_with_post,ov_post) VALUES (" .
123  $ilDB->quote($this->id, "integer") . "," .
124  $ilDB->quote(true, "integer") . "," .
125  $ilDB->quote(true, "integer") . "," .
126  $ilDB->quote(false, "integer") . "," .
127  $ilDB->quote($this->hasAbstractShorten(), "integer") . "," .
128  $ilDB->quote($this->getAbstractShortenLength(), "integer") . "," .
129  $ilDB->quote($this->hasAbstractImage(), "integer") . "," .
130  $ilDB->quote($this->getAbstractImageWidth(), "integer") . "," .
131  $ilDB->quote($this->getAbstractImageHeight(), "integer") . "," .
132  $ilDB->quote($this->hasKeywords(), "integer") . "," .
133  $ilDB->quote($this->hasAuthors(), "integer") . "," .
134  $ilDB->quote($this->getNavMode(), "integer") . "," .
135  $ilDB->quote($this->getNavModeListMonthsWithPostings(), "integer") . "," .
136  $ilDB->quote($this->getOverviewPostings(), "integer") .
137  ")");
138 
139  // #14661
140  $this->notes_service->domain()->activateComments($this->id);
141  }
getAbstractShortenLength()
ilDBInterface $db
getNavModeListMonthsWithPostings()
+ Here is the call graph for this function:

◆ doDelete()

ilObjBlog::doDelete ( )
protected

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

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

143  : void
144  {
145  $ilDB = $this->db;
146 
147  $this->deleteImage();
148 
150 
151  // remove all notifications
153 
154  $ilDB->manipulate("DELETE FROM il_blog" .
155  " WHERE id = " . $ilDB->quote($this->id, "integer"));
156  }
static deleteAllBlogPostings(int $a_blog_id)
Delete all postings for blog.
ilDBInterface $db
static removeForObject(int $type, int $id)
Remove all notifications for given object.
+ Here is the call graph for this function:

◆ doRead()

ilObjBlog::doRead ( )
protected

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

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

82  : void
83  {
84  $ilDB = $this->db;
85 
86  $set = $ilDB->query("SELECT * FROM il_blog" .
87  " WHERE id = " . $ilDB->quote($this->id, "integer"));
88  $row = $ilDB->fetchAssoc($set);
89  $this->setProfilePicture((bool) $row["ppic"]);
90  $this->setBackgroundColor((string) $row["bg_color"]);
91  $this->setFontColor((string) $row["font_color"]);
92  $this->setImage((string) $row["img"]);
93  $this->setRSS((bool) $row["rss_active"]);
94  $this->setApproval((bool) $row["approval"]);
95  $this->setAbstractShorten((bool) $row["abs_shorten"]);
96  $this->setAbstractShortenLength($row["abs_shorten_len"]);
97  $this->setAbstractImage((bool) $row["abs_image"]);
98  $this->setAbstractImageWidth($row["abs_img_width"]);
99  $this->setAbstractImageHeight($row["abs_img_height"]);
100  $this->setKeywords((bool) $row["keywords"]);
101  $this->setAuthors((bool) $row["authors"]);
102  $this->setNavMode($row["nav_mode"]);
103  $this->setNavModeListMonthsWithPostings((int) $row["nav_list_mon_with_post"]);
104  $this->setNavModeListMonths($row["nav_list_mon"]);
105  $this->setOverviewPostings($row["ov_post"]);
106  if (trim((string) $row["nav_order"])) {
107  $this->setOrder(explode(";", $row["nav_order"]));
108  }
109 
110  // #14661
111  $this->setNotesStatus(
112  $this->notes_service->domain()->commentsActive($this->id)
113  );
114  }
setNavModeListMonthsWithPostings(int $a_value)
setAbstractShorten(bool $a_value)
setNotesStatus(bool $a_status)
setProfilePicture(bool $a_status)
setApproval(bool $a_status)
setNavModeListMonths(?int $a_value)
setKeywords(bool $a_value)
setOverviewPostings(?int $a_value)
setAbstractImage(bool $a_value)
setOrder(array $a_values=[])
setAbstractImageHeight(int $a_value)
setBackgroundColor(string $a_value)
setFontColor(string $a_value)
ilDBInterface $db
setAbstractShortenLength(int $a_value)
setAuthors(bool $a_value)
setRSS(bool $a_status)
setNavMode(int $a_value)
setAbstractImageWidth(int $a_value)
setImage(string $a_value)
+ Here is the call graph for this function:

◆ doUpdate()

ilObjBlog::doUpdate ( )
protected

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

References ilObject\$db, $ilDB, getNotesStatus(), and getOrder().

158  : void
159  {
160  $ilDB = $this->db;
161 
162  if ($this->id) {
163  $ilDB->manipulate("UPDATE il_blog" .
164  " SET ppic = " . $ilDB->quote($this->hasProfilePicture(), "integer") .
165  ",bg_color = " . $ilDB->quote($this->getBackgroundColor(), "text") .
166  ",font_color = " . $ilDB->quote($this->getFontColor(), "text") .
167  ",img = " . $ilDB->quote($this->getImage(), "text") .
168  ",rss_active = " . $ilDB->quote($this->hasRSS(), "integer") .
169  ",approval = " . $ilDB->quote($this->hasApproval(), "integer") .
170  ",abs_shorten = " . $ilDB->quote($this->hasAbstractShorten(), "integer") .
171  ",abs_shorten_len = " . $ilDB->quote($this->getAbstractShortenLength(), "integer") .
172  ",abs_image = " . $ilDB->quote($this->hasAbstractImage(), "integer") .
173  ",abs_img_width = " . $ilDB->quote($this->getAbstractImageWidth(), "integer") .
174  ",abs_img_height = " . $ilDB->quote($this->getAbstractImageHeight(), "integer") .
175  ",keywords = " . $ilDB->quote($this->hasKeywords(), "integer") .
176  ",authors = " . $ilDB->quote($this->hasAuthors(), "integer") .
177  ",nav_mode = " . $ilDB->quote($this->getNavMode(), "integer") .
178  ",nav_list_mon_with_post = " . $ilDB->quote($this->getNavModeListMonthsWithPostings(), "integer") .
179  ",nav_list_mon = " . $ilDB->quote($this->getNavModeListMonths(), "integer") .
180  ",ov_post = " . $ilDB->quote($this->getOverviewPostings(), "integer") .
181  ",nav_order = " . $ilDB->quote(implode(";", $this->getOrder()), "text") .
182  " WHERE id = " . $ilDB->quote($this->id, "integer"));
183 
184  // #14661
185  $this->notes_service->domain()->activateComments(
186  $this->id,
187  $this->getNotesStatus()
188  );
189  }
190  }
ilDBInterface $db
+ Here is the call graph for this function:

◆ getAbstractImageHeight()

ilObjBlog::getAbstractImageHeight ( )

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

References $abstract_image_height.

Referenced by doCloneObject(), and doCreate().

441  : int
442  {
444  }
int $abstract_image_height
+ Here is the caller graph for this function:

◆ getAbstractImageWidth()

ilObjBlog::getAbstractImageWidth ( )

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

References $abstract_image_width.

Referenced by doCloneObject(), and doCreate().

431  : int
432  {
434  }
int $abstract_image_width
+ Here is the caller graph for this function:

◆ getAbstractShortenLength()

ilObjBlog::getAbstractShortenLength ( )

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

References $abstract_shorten_length.

Referenced by doCloneObject(), and doCreate().

411  : int
412  {
414  }
int $abstract_shorten_length
+ Here is the caller graph for this function:

◆ getAllLocalRoles()

ilObjBlog::getAllLocalRoles ( int  $a_node_id)

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

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

734  : array
735  {
736  $res = array();
737  foreach ($this->rbac_review->getLocalRoles($a_node_id) as $role_id) {
739  }
740 
741  asort($res);
742  return $res;
743  }
$res
Definition: ltiservices.php:69
static _lookupTitle(int $obj_id)
static _getTranslation(string $a_role_title)
+ Here is the call graph for this function:

◆ getBackgroundColor()

ilObjBlog::getBackgroundColor ( )

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

References $bg_color.

Referenced by doCloneObject().

243  : string
244  {
245  if (!$this->bg_color) {
246  $this->bg_color = "ffffff";
247  }
248  return $this->bg_color;
249  }
string $bg_color
+ Here is the caller graph for this function:

◆ getFontColor()

ilObjBlog::getFontColor ( )

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

References $font_color.

Referenced by doCloneObject().

256  : string
257  {
258  if (!$this->font_color) {
259  $this->font_color = "505050";
260  }
261  return $this->font_color;
262  }
string $font_color
+ Here is the caller graph for this function:

◆ getImage()

ilObjBlog::getImage ( )

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

References $img.

Referenced by doCloneObject().

269  : string
270  {
271  return $this->img;
272  }
+ Here is the caller graph for this function:

◆ getImageFullPath()

ilObjBlog::getImageFullPath ( bool  $a_as_thumb = false)

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

References $img, and $path.

281  : string {
282  if ($this->img) {
283  $path = self::initStorage($this->id);
284  if (!$a_as_thumb) {
285  return $path . $this->img;
286  }
287 
288  return $path . "thb_" . $this->img;
289  }
290  return "";
291  }
$path
Definition: ltiservices.php:32

◆ getLocalContributorRole()

ilObjBlog::getLocalContributorRole ( int  $a_node_id)

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

References ilObject\_lookupTitle().

Referenced by getRolesWithContributeOrRedact().

714  : int
715  {
716  foreach ($this->rbac_review->getLocalRoles($a_node_id) as $role_id) {
717  if (str_starts_with(ilObject::_lookupTitle($role_id), "il_blog_contributor")) {
718  return $role_id;
719  }
720  }
721  return 0;
722  }
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocalEditorRole()

ilObjBlog::getLocalEditorRole ( int  $a_node_id)

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

References ilObject\_lookupTitle().

Referenced by getRolesWithContributeOrRedact().

724  : int
725  {
726  foreach ($this->rbac_review->getLocalRoles($a_node_id) as $role_id) {
727  if (strpos(ilObject::_lookupTitle($role_id), "il_blog_editor") === 0) {
728  return $role_id;
729  }
730  }
731  return 0;
732  }
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNavMode()

ilObjBlog::getNavMode ( )

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

References $nav_mode.

Referenced by doCreate().

478  : int
479  {
480  return $this->nav_mode;
481  }
+ Here is the caller graph for this function:

◆ getNavModeListMonths()

ilObjBlog::getNavModeListMonths ( )

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

References $nav_mode_list_months.

498  : ?int
499  {
501  }
int $nav_mode_list_months

◆ getNavModeListMonthsWithPostings()

ilObjBlog::getNavModeListMonthsWithPostings ( )

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

References $nav_mode_list_months_with_post.

Referenced by doCreate().

488  : int
489  {
491  }
int $nav_mode_list_months_with_post
+ Here is the caller graph for this function:

◆ getNotesStatus()

ilObjBlog::getNotesStatus ( )

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

References $notes.

Referenced by doCloneObject(), and doUpdate().

223  : bool
224  {
225  return $this->notes;
226  }
+ Here is the caller graph for this function:

◆ getOrder()

ilObjBlog::getOrder ( )

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

References $order.

Referenced by doUpdate().

518  : array
519  {
520  return $this->order;
521  }
+ Here is the caller graph for this function:

◆ getOverviewPostings()

ilObjBlog::getOverviewPostings ( )

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

References $overview_postings.

Referenced by doCreate().

508  : ?int
509  {
511  }
int $overview_postings
+ Here is the caller graph for this function:

◆ getRolesWithContributeOrRedact()

ilObjBlog::getRolesWithContributeOrRedact ( int  $a_node_id)

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

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

745  : array
746  {
747  $contr_op_id = ilRbacReview::_getOperationIdByName("contribute");
748  $redact_op_id = ilRbacReview::_getOperationIdByName("redact");
749  $contr_role_id = $this->getLocalContributorRole($a_node_id);
750  $editor_role_id = $this->getLocalEditorRole($a_node_id);
751 
752  $res = array();
753  foreach ($this->rbac_review->getParentRoleIds($a_node_id) as $role_id => $role) {
754  if ($role_id != $contr_role_id &&
755  $role_id != $editor_role_id) {
756  $all_ops = $this->rbac_review->getActiveOperationsOfRole($a_node_id, $role_id);
757  if (in_array($contr_op_id, $all_ops) ||
758  in_array($redact_op_id, $all_ops)) {
759  $res[$role_id] = ilObjRole::_getTranslation($role["title"]);
760  }
761  }
762  }
763 
764  return $res;
765  }
$res
Definition: ltiservices.php:69
getLocalContributorRole(int $a_node_id)
static _getTranslation(string $a_role_title)
static _getOperationIdByName(string $a_operation)
get operation id by name of operation
getLocalEditorRole(int $a_node_id)
+ Here is the call graph for this function:

◆ handleQuotaUpdate()

ilObjBlog::handleQuotaUpdate ( )
protected

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

Referenced by deleteImage(), and uploadImage().

767  : void
768  {
769  }
+ Here is the caller graph for this function:

◆ hasAbstractImage()

ilObjBlog::hasAbstractImage ( )

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

References $abstract_image.

Referenced by doCloneObject(), and doCreate().

421  : bool
422  {
423  return $this->abstract_image;
424  }
bool $abstract_image
+ Here is the caller graph for this function:

◆ hasAbstractShorten()

ilObjBlog::hasAbstractShorten ( )

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

References $abstract_shorten.

Referenced by doCloneObject(), and doCreate().

401  : bool
402  {
404  }
bool $abstract_shorten
+ Here is the caller graph for this function:

◆ hasApproval()

ilObjBlog::hasApproval ( )

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

References $approval.

Referenced by doCloneObject().

390  : bool
391  {
392  return $this->approval;
393  }
+ Here is the caller graph for this function:

◆ hasAuthors()

ilObjBlog::hasAuthors ( )

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

References $authors.

Referenced by doCreate().

466  : bool
467  {
468  return $this->authors;
469  }
+ Here is the caller graph for this function:

◆ hasKeywords()

ilObjBlog::hasKeywords ( )

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

References $keywords.

Referenced by doCreate().

456  : bool
457  {
458  return $this->keywords;
459  }
+ Here is the caller graph for this function:

◆ hasProfilePicture()

ilObjBlog::hasProfilePicture ( )

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

References $ppic.

Referenced by doCloneObject().

233  : bool
234  {
235  return $this->ppic;
236  }
+ Here is the caller graph for this function:

◆ hasRSS()

ilObjBlog::hasRSS ( )

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

References $rss.

Referenced by doCloneObject().

380  : bool
381  {
382  return $this->rss;
383  }
+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjBlog::initDefaultRoles ( )

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

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

697  : void
698  {
700  'il_blog_contributor_' . $this->getRefId(),
701  "Contributor of blog obj_no." . $this->getId(),
702  'il_blog_contributor',
703  $this->getRefId()
704  );
705 
707  'il_blog_editor_' . $this->getRefId(),
708  "Editor of blog obj_no." . $this->getId(),
709  'il_blog_editor',
710  $this->getRefId()
711  );
712  }
static createDefaultRole(string $a_title, string $a_description, string $a_tpl_name, int $a_ref_id)
+ Here is the call graph for this function:

◆ initStorage()

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

Init file system storage.

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

References $path.

Referenced by ilBlogDataSet\getXmlRecord(), and ilBlogDataSet\importRecord().

311  : string {
312  $storage = new ilFSStorageBlog($a_id);
313  $storage->create();
314 
315  $path = $storage->getAbsolutePath() . "/";
316 
317  if ($a_subdir) {
318  $path .= $a_subdir . "/";
319 
320  if (!is_dir($path) && !mkdir($path) && !is_dir($path)) {
321  throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
322  }
323  }
324 
325  return $path;
326  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$path
Definition: ltiservices.php:32
+ Here is the caller graph for this function:

◆ initType()

ilObjBlog::initType ( )
protected

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

77  : void
78  {
79  $this->type = "blog";
80  }

◆ sendNotification()

static ilObjBlog::sendNotification ( string  $a_action,
bool  $a_in_wsp,
int  $a_blog_node_id,
int  $a_posting_id,
?string  $a_comment = null 
)
static

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

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

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

529  : void {
530  global $DIC;
531 
532  $ilUser = $DIC->user();
533 
534  // get blog object id (repository or workspace)
535  if ($a_in_wsp) {
536  $tree = new ilWorkspaceTree($ilUser->getId()); // owner of tree is irrelevant
537  $blog_obj_id = $tree->lookupObjectId($a_blog_node_id);
538  $access_handler = new ilWorkspaceAccessHandler($tree);
539  } else {
540  $blog_obj_id = ilObject::_lookupObjId($a_blog_node_id);
541  $access_handler = null;
542  }
543  if (!$blog_obj_id) {
544  return;
545  }
546 
547  $posting = new ilBlogPosting($a_posting_id);
548 
549  // #11138
550  $ignore_threshold = ($a_action === "comment");
551 
552  $admin_only = false;
553 
554  // approval handling
555  if (!$posting->isApproved()) {
556  $blog = new self($blog_obj_id, false);
557  if ($blog->hasApproval()) {
558  switch ($a_action) {
559  case "update":
560  // un-approved posting was updated - no notifications
561  return;
562 
563  case "new":
564  // un-approved posting was activated - admin-only notification
565  $admin_only = true;
566  $ignore_threshold = true;
567  $a_action = "approve";
568  break;
569  }
570  }
571  }
572 
573  // create/update news item (only in repository)
574  if (!$a_in_wsp &&
575  in_array($a_action, array("update", "new"))) {
576  $posting->handleNews(($a_action === "update"));
577  }
578 
579  // recipients
582  $blog_obj_id,
583  $a_posting_id,
584  $ignore_threshold
585  );
586  if (!count($users)) {
587  return;
588  }
589 
590  $ntf = new ilSystemNotification($a_in_wsp);
591  $ntf->setLangModules(array("blog"));
592  $ntf->setRefId($a_blog_node_id);
593  $ntf->setChangedByUserId($ilUser->getId());
594  $ntf->setSubjectLangId('blog_change_notification_subject');
595  $ntf->setIntroductionLangId('blog_change_notification_body_' . $a_action);
596  $ntf->addAdditionalInfo('blog_posting', $posting->getTitle());
597  if ($a_comment) {
598  $ntf->addAdditionalInfo('comment', $a_comment, true);
599  }
600  $ntf->setGotoLangId('blog_change_notification_link');
601  $ntf->setReasonLangId('blog_change_notification_reason');
602 
603  $abstract = $posting->getNotificationAbstract();
604  if ($abstract) {
605  $ntf->addAdditionalInfo('content', $abstract, true);
606  }
607 
608  $notified = $ntf->sendMailAndReturnRecipients(
609  $users,
610  "_" . $a_posting_id,
611  ($admin_only ? "write" : "read")
612  );
613 
614  // #14387
615  if (count($notified)) {
616  ilNotification::updateNotificationTime(ilNotification::TYPE_BLOG, $blog_obj_id, $notified, $a_posting_id);
617  }
618  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilTree $tree
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getNotificationsForObject(int $type, int $id, ?int $page_id=null, bool $ignore_threshold=false)
Get all users/recipients for given object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
static updateNotificationTime(int $type, int $id, array $user_ids, ?int $page_id=null, bool $activate_new_entries=true)
Update the last mail timestamp for given object and users.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAbstractImage()

ilObjBlog::setAbstractImage ( bool  $a_value)

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

Referenced by doRead().

426  : void
427  {
428  $this->abstract_image = $a_value;
429  }
+ Here is the caller graph for this function:

◆ setAbstractImageHeight()

ilObjBlog::setAbstractImageHeight ( int  $a_value)

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

Referenced by doRead().

446  : void
447  {
448  $this->abstract_image_height = $a_value;
449  }
+ Here is the caller graph for this function:

◆ setAbstractImageWidth()

ilObjBlog::setAbstractImageWidth ( int  $a_value)

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

Referenced by doRead().

436  : void
437  {
438  $this->abstract_image_width = $a_value;
439  }
+ Here is the caller graph for this function:

◆ setAbstractShorten()

ilObjBlog::setAbstractShorten ( bool  $a_value)

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

Referenced by doRead().

406  : void
407  {
408  $this->abstract_shorten = $a_value;
409  }
+ Here is the caller graph for this function:

◆ setAbstractShortenLength()

ilObjBlog::setAbstractShortenLength ( int  $a_value)

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

Referenced by doRead().

416  : void
417  {
418  $this->abstract_shorten_length = $a_value;
419  }
+ Here is the caller graph for this function:

◆ setApproval()

ilObjBlog::setApproval ( bool  $a_status)

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

Referenced by doRead().

395  : void
396  {
397  $this->approval = $a_status;
398  }
+ Here is the caller graph for this function:

◆ setAuthors()

ilObjBlog::setAuthors ( bool  $a_value)

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

Referenced by doRead().

461  : void
462  {
463  $this->authors = $a_value;
464  }
+ Here is the caller graph for this function:

◆ setBackgroundColor()

ilObjBlog::setBackgroundColor ( string  $a_value)

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

Referenced by doRead().

251  : void
252  {
253  $this->bg_color = $a_value;
254  }
+ Here is the caller graph for this function:

◆ setFontColor()

ilObjBlog::setFontColor ( string  $a_value)

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

Referenced by doRead().

264  : void
265  {
266  $this->font_color = $a_value;
267  }
+ Here is the caller graph for this function:

◆ setImage()

ilObjBlog::setImage ( string  $a_value)

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

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

274  : void
275  {
276  $this->img = $a_value;
277  }
+ Here is the caller graph for this function:

◆ setKeywords()

ilObjBlog::setKeywords ( bool  $a_value)

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

Referenced by doRead().

451  : void
452  {
453  $this->keywords = $a_value;
454  }
+ Here is the caller graph for this function:

◆ setNavMode()

ilObjBlog::setNavMode ( int  $a_value)

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

Referenced by doRead().

471  : void
472  {
473  if (in_array($a_value, array(self::NAV_MODE_LIST, self::NAV_MODE_MONTH))) {
474  $this->nav_mode = $a_value;
475  }
476  }
+ Here is the caller graph for this function:

◆ setNavModeListMonths()

ilObjBlog::setNavModeListMonths ( ?int  $a_value)

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

Referenced by doRead().

493  : void
494  {
495  $this->nav_mode_list_months = $a_value;
496  }
+ Here is the caller graph for this function:

◆ setNavModeListMonthsWithPostings()

ilObjBlog::setNavModeListMonthsWithPostings ( int  $a_value)

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

Referenced by doRead().

483  : void
484  {
485  $this->nav_mode_list_months_with_post = $a_value;
486  }
+ Here is the caller graph for this function:

◆ setNotesStatus()

ilObjBlog::setNotesStatus ( bool  $a_status)

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

Referenced by doRead().

228  : void
229  {
230  $this->notes = $a_status;
231  }
+ Here is the caller graph for this function:

◆ setOrder()

ilObjBlog::setOrder ( array  $a_values = [])

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

Referenced by doRead().

513  : void
514  {
515  $this->order = $a_values;
516  }
+ Here is the caller graph for this function:

◆ setOverviewPostings()

ilObjBlog::setOverviewPostings ( ?int  $a_value)

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

Referenced by doRead().

503  : void
504  {
505  $this->overview_postings = $a_value;
506  }
+ Here is the caller graph for this function:

◆ setProfilePicture()

ilObjBlog::setProfilePicture ( bool  $a_status)

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

Referenced by doRead().

238  : void
239  {
240  $this->ppic = $a_status;
241  }
+ Here is the caller graph for this function:

◆ setRSS()

ilObjBlog::setRSS ( bool  $a_status)

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

Referenced by doRead().

385  : void
386  {
387  $this->rss = $a_status;
388  }
+ Here is the caller graph for this function:

◆ uploadImage()

ilObjBlog::uploadImage ( array  $a_upload)

Upload new image file.

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

References $path, deleteImage(), handleQuotaUpdate(), ILIAS\Repository\int(), ilFileUtils\moveUploadedFile(), and setImage().

331  : bool
332  {
333  if (!$this->id) {
334  return false;
335  }
336 
337  $this->deleteImage();
338 
339  // #10074
340  $clean_name = preg_replace("/[^a-zA-Z0-9\_\.\-]/", "", $a_upload["name"]);
341 
342  $path = self::initStorage($this->id);
343  $original = "org_" . $this->id . "_" . $clean_name;
344  $thumb = "thb_" . $this->id . "_" . $clean_name;
345  $processed = $this->id . "_" . $clean_name;
346 
347  if (ilFileUtils::moveUploadedFile($a_upload["tmp_name"], $original, $path . $original)) {
348  chmod($path . $original, 0770);
349 
350  $blga_set = new ilSetting("blga");
351 
352  // as banner height should overflow, we only handle width (otherwise resizeToFixedSize could be used)
353  $banner_width = (int) $blga_set->get("banner_width");
354  // $banner_height = (int)$blga_set->get("banner_height");
355 
356  $this->image_conversion->croppedSquare(
357  $path . $original,
358  $path . $thumb,
359  100,
360  ImageOutputOptions::FORMAT_KEEP
361  );
362 
363  $this->image_conversion->resizeByWidth(
364  $path . $original,
365  $path . $processed,
366  $banner_width,
367  ImageOutputOptions::FORMAT_KEEP,
368  100
369  );
370 
371  $this->setImage($processed);
372 
373  $this->handleQuotaUpdate();
374 
375  return true;
376  }
377  return false;
378  }
$path
Definition: ltiservices.php:32
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
setImage(string $a_value)
+ Here is the call graph for this function:

Field Documentation

◆ $abstract_image

bool ilObjBlog::$abstract_image = false
protected

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

Referenced by hasAbstractImage().

◆ $abstract_image_height

int ilObjBlog::$abstract_image_height = self::ABSTRACT_DEFAULT_IMAGE_HEIGHT
protected

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

Referenced by getAbstractImageHeight().

◆ $abstract_image_width

int ilObjBlog::$abstract_image_width = self::ABSTRACT_DEFAULT_IMAGE_WIDTH
protected

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

Referenced by getAbstractImageWidth().

◆ $abstract_shorten

bool ilObjBlog::$abstract_shorten = false
protected

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

Referenced by hasAbstractShorten().

◆ $abstract_shorten_length

int ilObjBlog::$abstract_shorten_length = self::ABSTRACT_DEFAULT_SHORTEN_LENGTH
protected

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

Referenced by getAbstractShortenLength().

◆ $approval

bool ilObjBlog::$approval = false
protected

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

Referenced by hasApproval().

◆ $authors

bool ilObjBlog::$authors = true
protected

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

Referenced by hasAuthors().

◆ $bg_color

string ilObjBlog::$bg_color = ""
protected

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

Referenced by getBackgroundColor().

◆ $content_style_domain

ILIAS Style Content DomainService ilObjBlog::$content_style_domain
protected

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

◆ $font_color

string ilObjBlog::$font_color = ""
protected

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

Referenced by getFontColor().

◆ $image_conversion

ILIAS Filesystem Util Convert LegacyImages ilObjBlog::$image_conversion
private

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

◆ $img

string ilObjBlog::$img = ""
protected

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

Referenced by getImage(), and getImageFullPath().

◆ $keywords

bool ilObjBlog::$keywords = true
protected

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

Referenced by hasKeywords().

◆ $nav_mode

int ilObjBlog::$nav_mode = self::NAV_MODE_LIST
protected

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

Referenced by getNavMode().

◆ $nav_mode_list_months

int ilObjBlog::$nav_mode_list_months = null
protected

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

Referenced by getNavModeListMonths().

◆ $nav_mode_list_months_with_post

int ilObjBlog::$nav_mode_list_months_with_post = 0
protected

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

Referenced by getNavModeListMonthsWithPostings().

◆ $nav_mode_list_postings

int ilObjBlog::$nav_mode_list_postings = self::NAV_MODE_LIST_DEFAULT_POSTINGS
protected

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

◆ $notes

bool ilObjBlog::$notes = false
protected

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

Referenced by getNotesStatus().

◆ $notes_service

ILIAS Notes Service ilObjBlog::$notes_service
protected

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

◆ $order

array ilObjBlog::$order = []
protected

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

Referenced by getOrder().

◆ $overview_postings

int ilObjBlog::$overview_postings = 5
protected

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

Referenced by getOverviewPostings().

◆ $ppic

bool ilObjBlog::$ppic = false
protected

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

Referenced by hasProfilePicture().

◆ $rss

bool ilObjBlog::$rss = false
protected

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

Referenced by hasRSS().

◆ $style

bool ilObjBlog::$style = false
protected

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

◆ ABSTRACT_DEFAULT_IMAGE_HEIGHT

const ilObjBlog::ABSTRACT_DEFAULT_IMAGE_HEIGHT = 144

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

Referenced by ilObjBlogGUI\getEditFormCustomValues().

◆ ABSTRACT_DEFAULT_IMAGE_WIDTH

const ilObjBlog::ABSTRACT_DEFAULT_IMAGE_WIDTH = 144

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

Referenced by ilObjBlogGUI\getEditFormCustomValues().

◆ ABSTRACT_DEFAULT_SHORTEN_LENGTH

const ilObjBlog::ABSTRACT_DEFAULT_SHORTEN_LENGTH = 500

Definition at line 31 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 34 of file class.ilObjBlog.php.

◆ NAV_MODE_MONTH

const ilObjBlog::NAV_MODE_MONTH = 2

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

Referenced by ilObjBlogGUI\initEditCustomForm().


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