ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjBlog Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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
 __construct (int $id=0, bool $reference=true)
 
 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 $desc)
 
 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 = ""
 
string $ppic = ""
 
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
 
int $id
 
bool $referenced
 
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 = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 23 of file class.ilObjBlog.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

59  {
60  global $DIC;
61 
62  $this->notes_service = $DIC->notes();
63  parent::__construct($a_id, $a_reference);
64  $this->rbac_review = $DIC->rbac()->review();
65 
66  $this->content_style_domain = $DIC
67  ->contentStyle()
68  ->domain();
69  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ deleteImage()

ilObjBlog::deleteImage ( )

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

References handleQuotaUpdate(), and setImage().

Referenced by doDelete(), and uploadImage().

287  : void
288  {
289  if ($this->id) {
290  $storage = new ilFSStorageBlog($this->id);
291  $storage->delete();
292 
293  $this->setImage("");
294 
295  $this->handleQuotaUpdate();
296  }
297  }
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 613 of file class.ilObjBlog.php.

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

613  : void
614  {
615  global $DIC;
616 
617  $tpl = $DIC["tpl"];
618  $ilSetting = $DIC->settings();
619 
620  if (!$ilSetting->get('enable_global_profiles')) {
621  return;
622  }
623 
624  // #10827
625  if (substr($a_wsp_id, -4) !== "_cll") {
626  $wsp_id = new ilWorkspaceTree(0);
627  $obj_id = $wsp_id->lookupObjectId((int) $a_wsp_id);
628  $is_wsp = "_wsp";
629  } else {
630  $a_wsp_id = substr($a_wsp_id, 0, -4);
631  $obj_id = ilObject::_lookupObjId((int) $a_wsp_id);
632  $is_wsp = null;
633  }
634  if (!$obj_id) {
635  return;
636  }
637 
638  $blog = new self($obj_id, false);
639  if (!$blog->hasRSS()) {
640  return;
641  }
642 
643  $feed = new ilFeedWriter();
644 
645  $url = ilLink::_getStaticLink($a_wsp_id, "blog", true, (string) $is_wsp);
646  $url = str_replace("&", "&", $url);
647 
648  // #11870
649  $feed->setChannelTitle(str_replace("&", "&", $blog->getTitle()));
650  $feed->setChannelDescription(str_replace("&", "&", $blog->getDescription()));
651  $feed->setChannelLink($url);
652 
653  // needed for blogpostinggui / pagegui
654  $tpl = new ilGlobalTemplate("tpl.main.html", true, true);
655 
656  foreach (ilBlogPosting::getAllPostings($obj_id) as $item) {
657  $id = $item["id"];
658 
659  // only published items
660  $is_active = ilBlogPosting::_lookupActive($id, "blp");
661  if (!$is_active) {
662  continue;
663  }
664 
665  // #16434
666  $snippet = strip_tags(ilBlogPostingGUI::getSnippet($id), "<br><br/><div><p>");
667  $snippet = str_replace("&", "&amp;", $snippet);
668  $snippet = "<![CDATA[" . $snippet . "]]>";
669 
670  $url = ilLink::_getStaticLink($a_wsp_id, "blog", true, "_" . $id . $is_wsp);
671  $url = str_replace("&", "&amp;", $url);
672 
673  $feed_item = new ilFeedItem();
674  $feed_item->setTitle(str_replace("&", "&amp;", $item["title"])); // #16022
675  $feed_item->setDate($item["created"]->get(IL_CAL_DATETIME));
676  $feed_item->setDescription($snippet);
677  $feed_item->setLink($url);
678  $feed_item->setAbout($url);
679  $feed->addItem($feed_item);
680  }
681 
682  $feed->showFeed();
683  exit();
684  }
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:28
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
global $ilSetting
Definition: privfeed.php:17
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.
$url
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ 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 186 of file class.ilObjBlog.php.

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

186  : void
187  {
188  assert($new_obj instanceof ilObjBlog);
189  // banner?
190  $img = $this->getImage();
191  if ($img) {
192  $new_obj->setImage($img);
193 
194  $source = self::initStorage($this->getId());
195  $target = $new_obj->initStorage($new_obj->getId());
196 
197  copy($source . $img, $target . $img);
198  }
199 
200  $new_obj->setNotesStatus($this->getNotesStatus());
201  $new_obj->setProfilePicture($this->hasProfilePicture());
202  $new_obj->setBackgroundColor($this->getBackgroundColor());
203  $new_obj->setFontColor($this->getFontColor());
204  $new_obj->setRSS($this->hasRSS());
205  $new_obj->setApproval($this->hasApproval());
206  $new_obj->setAbstractShorten($this->hasAbstractShorten());
207  $new_obj->setAbstractShortenLength($this->getAbstractShortenLength());
208  $new_obj->setAbstractImage($this->hasAbstractImage());
209  $new_obj->setAbstractImageWidth($this->getAbstractImageWidth());
210  $new_obj->setAbstractImageHeight($this->getAbstractImageHeight());
211  $new_obj->update();
212 
213  // set/copy stylesheet
214  $this->content_style_domain->styleForObjId($this->getId())->cloneTo($new_obj->getId());
215  }
getAbstractShortenLength()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$source
Definition: metadata.php:93
+ Here is the call graph for this function:

◆ doCreate()

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

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

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

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

◆ doDelete()

ilObjBlog::doDelete ( )
protected

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

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

137  : void
138  {
139  $ilDB = $this->db;
140 
141  $this->deleteImage();
142 
144 
145  // remove all notifications
147 
148  $ilDB->manipulate("DELETE FROM il_blog" .
149  " WHERE id = " . $ilDB->quote($this->id, "integer"));
150  }
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 76 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().

76  : void
77  {
78  $ilDB = $this->db;
79 
80  $set = $ilDB->query("SELECT * FROM il_blog" .
81  " WHERE id = " . $ilDB->quote($this->id, "integer"));
82  $row = $ilDB->fetchAssoc($set);
83  $this->setProfilePicture((bool) $row["ppic"]);
84  $this->setBackgroundColor((string) $row["bg_color"]);
85  $this->setFontColor((string) $row["font_color"]);
86  $this->setImage((string) $row["img"]);
87  $this->setRSS($row["rss_active"]);
88  $this->setApproval($row["approval"]);
89  $this->setAbstractShorten($row["abs_shorten"]);
90  $this->setAbstractShortenLength($row["abs_shorten_len"]);
91  $this->setAbstractImage($row["abs_image"]);
92  $this->setAbstractImageWidth($row["abs_img_width"]);
93  $this->setAbstractImageHeight($row["abs_img_height"]);
94  $this->setKeywords($row["keywords"]);
95  $this->setAuthors($row["authors"]);
96  $this->setNavMode($row["nav_mode"]);
97  $this->setNavModeListMonthsWithPostings((int) $row["nav_list_mon_with_post"]);
98  $this->setNavModeListMonths($row["nav_list_mon"]);
99  $this->setOverviewPostings($row["ov_post"]);
100  if (trim($row["nav_order"])) {
101  $this->setOrder(explode(";", $row["nav_order"]));
102  }
103 
104  // #14661
105  $this->setNotesStatus(
106  $this->notes_service->domain()->commentsActive($this->id)
107  );
108  }
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 152 of file class.ilObjBlog.php.

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

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

◆ getAbstractImageHeight()

ilObjBlog::getAbstractImageHeight ( )

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

References $abstract_image_height.

Referenced by doCloneObject(), and doCreate().

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

◆ getAbstractImageWidth()

ilObjBlog::getAbstractImageWidth ( )

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

References $abstract_image_width.

Referenced by doCloneObject(), and doCreate().

421  : int
422  {
424  }
int $abstract_image_width
+ Here is the caller graph for this function:

◆ getAbstractShortenLength()

ilObjBlog::getAbstractShortenLength ( )

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

References $abstract_shorten_length.

Referenced by doCloneObject(), and doCreate().

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

◆ getAllLocalRoles()

ilObjBlog::getAllLocalRoles ( int  $a_node_id)

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

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

723  : array
724  {
725  $res = array();
726  foreach ($this->rbac_review->getLocalRoles($a_node_id) as $role_id) {
728  }
729 
730  asort($res);
731  return $res;
732  }
$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 237 of file class.ilObjBlog.php.

References $bg_color.

Referenced by doCloneObject().

237  : string
238  {
239  if (!$this->bg_color) {
240  $this->bg_color = "ffffff";
241  }
242  return $this->bg_color;
243  }
string $bg_color
+ Here is the caller graph for this function:

◆ getFontColor()

ilObjBlog::getFontColor ( )

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

References $font_color.

Referenced by doCloneObject().

250  : string
251  {
252  if (!$this->font_color) {
253  $this->font_color = "505050";
254  }
255  return $this->font_color;
256  }
string $font_color
+ Here is the caller graph for this function:

◆ getImage()

ilObjBlog::getImage ( )

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

References $img.

Referenced by doCloneObject().

263  : string
264  {
265  return $this->img;
266  }
+ Here is the caller graph for this function:

◆ getImageFullPath()

ilObjBlog::getImageFullPath ( bool  $a_as_thumb = false)

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

References $img, and $path.

275  : string {
276  if ($this->img) {
277  $path = self::initStorage($this->id);
278  if (!$a_as_thumb) {
279  return $path . $this->img;
280  }
281 
282  return $path . "thb_" . $this->img;
283  }
284  return "";
285  }
$path
Definition: ltiservices.php:32

◆ getLocalContributorRole()

ilObjBlog::getLocalContributorRole ( int  $a_node_id)

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

References ilObject\_lookupTitle().

Referenced by getRolesWithContributeOrRedact().

703  : int
704  {
705  foreach ($this->rbac_review->getLocalRoles($a_node_id) as $role_id) {
706  if (strpos(ilObject::_lookupTitle($role_id), "il_blog_contributor") === 0) {
707  return $role_id;
708  }
709  }
710  return 0;
711  }
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 713 of file class.ilObjBlog.php.

References ilObject\_lookupTitle().

Referenced by getRolesWithContributeOrRedact().

713  : int
714  {
715  foreach ($this->rbac_review->getLocalRoles($a_node_id) as $role_id) {
716  if (strpos(ilObject::_lookupTitle($role_id), "il_blog_editor") === 0) {
717  return $role_id;
718  }
719  }
720  return 0;
721  }
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 468 of file class.ilObjBlog.php.

References $nav_mode.

Referenced by doCreate().

468  : int
469  {
470  return $this->nav_mode;
471  }
+ Here is the caller graph for this function:

◆ getNavModeListMonths()

ilObjBlog::getNavModeListMonths ( )

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

References $nav_mode_list_months.

488  : ?int
489  {
491  }
int $nav_mode_list_months

◆ getNavModeListMonthsWithPostings()

ilObjBlog::getNavModeListMonthsWithPostings ( )

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

References $nav_mode_list_months_with_post.

Referenced by doCreate().

478  : int
479  {
481  }
int $nav_mode_list_months_with_post
+ Here is the caller graph for this function:

◆ getNotesStatus()

ilObjBlog::getNotesStatus ( )

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

References $notes.

Referenced by doCloneObject(), and doUpdate().

217  : bool
218  {
219  return $this->notes;
220  }
+ Here is the caller graph for this function:

◆ getOrder()

ilObjBlog::getOrder ( )

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

References $order.

Referenced by doUpdate().

508  : array
509  {
510  return $this->order;
511  }
+ Here is the caller graph for this function:

◆ getOverviewPostings()

ilObjBlog::getOverviewPostings ( )

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

References $overview_postings.

Referenced by doCreate().

498  : ?int
499  {
501  }
int $overview_postings
+ Here is the caller graph for this function:

◆ getRolesWithContributeOrRedact()

ilObjBlog::getRolesWithContributeOrRedact ( int  $a_node_id)

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

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

734  : array
735  {
736  $contr_op_id = ilRbacReview::_getOperationIdByName("contribute");
737  $redact_op_id = ilRbacReview::_getOperationIdByName("redact");
738  $contr_role_id = $this->getLocalContributorRole($a_node_id);
739  $editor_role_id = $this->getLocalEditorRole($a_node_id);
740 
741  $res = array();
742  foreach ($this->rbac_review->getParentRoleIds($a_node_id) as $role_id => $role) {
743  if ($role_id != $contr_role_id &&
744  $role_id != $editor_role_id) {
745  $all_ops = $this->rbac_review->getActiveOperationsOfRole($a_node_id, $role_id);
746  if (in_array($contr_op_id, $all_ops) ||
747  in_array($redact_op_id, $all_ops)) {
748  $res[$role_id] = ilObjRole::_getTranslation($role["title"]);
749  }
750  }
751  }
752 
753  return $res;
754  }
$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 756 of file class.ilObjBlog.php.

Referenced by deleteImage(), and uploadImage().

756  : void
757  {
758  }
+ Here is the caller graph for this function:

◆ hasAbstractImage()

ilObjBlog::hasAbstractImage ( )

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

References $abstract_image.

Referenced by doCloneObject(), and doCreate().

411  : bool
412  {
413  return $this->abstract_image;
414  }
bool $abstract_image
+ Here is the caller graph for this function:

◆ hasAbstractShorten()

ilObjBlog::hasAbstractShorten ( )

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

References $abstract_shorten.

Referenced by doCloneObject(), and doCreate().

391  : bool
392  {
394  }
bool $abstract_shorten
+ Here is the caller graph for this function:

◆ hasApproval()

ilObjBlog::hasApproval ( )

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

References $approval.

Referenced by doCloneObject().

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

◆ hasAuthors()

ilObjBlog::hasAuthors ( )

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

References $authors.

Referenced by doCreate().

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

◆ hasKeywords()

ilObjBlog::hasKeywords ( )

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

References $keywords.

Referenced by doCreate().

446  : bool
447  {
448  return $this->keywords;
449  }
+ Here is the caller graph for this function:

◆ hasProfilePicture()

ilObjBlog::hasProfilePicture ( )

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

References $ppic.

Referenced by doCloneObject().

227  : bool
228  {
229  return $this->ppic;
230  }
+ Here is the caller graph for this function:

◆ hasRSS()

ilObjBlog::hasRSS ( )

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

References $rss.

Referenced by doCloneObject().

370  : bool
371  {
372  return $this->rss;
373  }
+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjBlog::initDefaultRoles ( )

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

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

686  : void
687  {
689  'il_blog_contributor_' . $this->getRefId(),
690  "Contributor of blog obj_no." . $this->getId(),
691  'il_blog_contributor',
692  $this->getRefId()
693  );
694 
696  'il_blog_editor_' . $this->getRefId(),
697  "Editor of blog obj_no." . $this->getId(),
698  'il_blog_editor',
699  $this->getRefId()
700  );
701  }
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 302 of file class.ilObjBlog.php.

References $path.

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

305  : string {
306  $storage = new ilFSStorageBlog($a_id);
307  $storage->create();
308 
309  $path = $storage->getAbsolutePath() . "/";
310 
311  if ($a_subdir) {
312  $path .= $a_subdir . "/";
313 
314  if (!is_dir($path) && !mkdir($path) && !is_dir($path)) {
315  throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
316  }
317  }
318 
319  return $path;
320  }
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 71 of file class.ilObjBlog.php.

71  : void
72  {
73  $this->type = "blog";
74  }

◆ 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 513 of file class.ilObjBlog.php.

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

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

519  : void {
520  global $DIC;
521 
522  $ilUser = $DIC->user();
523 
524  // get blog object id (repository or workspace)
525  if ($a_in_wsp) {
526  $tree = new ilWorkspaceTree($ilUser->getId()); // owner of tree is irrelevant
527  $blog_obj_id = $tree->lookupObjectId($a_blog_node_id);
528  $access_handler = new ilWorkspaceAccessHandler($tree);
529  } else {
530  $blog_obj_id = ilObject::_lookupObjId($a_blog_node_id);
531  $access_handler = null;
532  }
533  if (!$blog_obj_id) {
534  return;
535  }
536 
537  $posting = new ilBlogPosting($a_posting_id);
538 
539  // #11138
540  $ignore_threshold = ($a_action === "comment");
541 
542  $admin_only = false;
543 
544  // approval handling
545  if (!$posting->isApproved()) {
546  $blog = new self($blog_obj_id, false);
547  if ($blog->hasApproval()) {
548  switch ($a_action) {
549  case "update":
550  // un-approved posting was updated - no notifications
551  return;
552 
553  case "new":
554  // un-approved posting was activated - admin-only notification
555  $admin_only = true;
556  $ignore_threshold = true;
557  $a_action = "approve";
558  break;
559  }
560  }
561  }
562 
563  // create/update news item (only in repository)
564  if (!$a_in_wsp &&
565  in_array($a_action, array("update", "new"))) {
566  $posting->handleNews(($a_action === "update"));
567  }
568 
569  // recipients
572  $blog_obj_id,
573  $a_posting_id,
574  $ignore_threshold
575  );
576  if (!count($users)) {
577  return;
578  }
579 
580  $ntf = new ilSystemNotification($a_in_wsp);
581  $ntf->setLangModules(array("blog"));
582  $ntf->setRefId($a_blog_node_id);
583  $ntf->setChangedByUserId($ilUser->getId());
584  $ntf->setSubjectLangId('blog_change_notification_subject');
585  $ntf->setIntroductionLangId('blog_change_notification_body_' . $a_action);
586  $ntf->addAdditionalInfo('blog_posting', $posting->getTitle());
587  if ($a_comment) {
588  $ntf->addAdditionalInfo('comment', $a_comment, true);
589  }
590  $ntf->setGotoLangId('blog_change_notification_link');
591  $ntf->setReasonLangId('blog_change_notification_reason');
592 
593  $abstract = $posting->getNotificationAbstract();
594  if ($abstract) {
595  $ntf->addAdditionalInfo('content', $abstract, true);
596  }
597 
598  $notified = $ntf->sendMailAndReturnRecipients(
599  $users,
600  "_" . $a_posting_id,
601  ($admin_only ? "write" : "read")
602  );
603 
604  // #14387
605  if (count($notified)) {
606  ilNotification::updateNotificationTime(ilNotification::TYPE_BLOG, $blog_obj_id, $notified, $a_posting_id);
607  }
608  }
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.
$ilUser
Definition: imgupload.php:34
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 416 of file class.ilObjBlog.php.

Referenced by doRead().

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

◆ setAbstractImageHeight()

ilObjBlog::setAbstractImageHeight ( int  $a_value)

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

Referenced by doRead().

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

◆ setAbstractImageWidth()

ilObjBlog::setAbstractImageWidth ( int  $a_value)

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

Referenced by doRead().

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

◆ setAbstractShorten()

ilObjBlog::setAbstractShorten ( bool  $a_value)

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

Referenced by doRead().

396  : void
397  {
398  $this->abstract_shorten = $a_value;
399  }
+ Here is the caller graph for this function:

◆ setAbstractShortenLength()

ilObjBlog::setAbstractShortenLength ( int  $a_value)

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

Referenced by doRead().

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

◆ setApproval()

ilObjBlog::setApproval ( bool  $a_status)

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

Referenced by doRead().

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

◆ setAuthors()

ilObjBlog::setAuthors ( bool  $a_value)

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

Referenced by doRead().

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

◆ setBackgroundColor()

ilObjBlog::setBackgroundColor ( string  $a_value)

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

Referenced by doRead().

245  : void
246  {
247  $this->bg_color = $a_value;
248  }
+ Here is the caller graph for this function:

◆ setFontColor()

ilObjBlog::setFontColor ( string  $a_value)

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

Referenced by doRead().

258  : void
259  {
260  $this->font_color = $a_value;
261  }
+ Here is the caller graph for this function:

◆ setImage()

ilObjBlog::setImage ( string  $a_value)

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

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

268  : void
269  {
270  $this->img = $a_value;
271  }
+ Here is the caller graph for this function:

◆ setKeywords()

ilObjBlog::setKeywords ( bool  $a_value)

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

Referenced by doRead().

441  : void
442  {
443  $this->keywords = $a_value;
444  }
+ Here is the caller graph for this function:

◆ setNavMode()

ilObjBlog::setNavMode ( int  $a_value)

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

Referenced by doRead().

461  : void
462  {
463  if (in_array($a_value, array(self::NAV_MODE_LIST, self::NAV_MODE_MONTH))) {
464  $this->nav_mode = $a_value;
465  }
466  }
+ Here is the caller graph for this function:

◆ setNavModeListMonths()

ilObjBlog::setNavModeListMonths ( ?int  $a_value)

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

Referenced by doRead().

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

◆ setNavModeListMonthsWithPostings()

ilObjBlog::setNavModeListMonthsWithPostings ( int  $a_value)

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

Referenced by doRead().

473  : void
474  {
475  $this->nav_mode_list_months_with_post = $a_value;
476  }
+ Here is the caller graph for this function:

◆ setNotesStatus()

ilObjBlog::setNotesStatus ( bool  $a_status)

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

Referenced by doRead().

222  : void
223  {
224  $this->notes = $a_status;
225  }
+ Here is the caller graph for this function:

◆ setOrder()

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

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

Referenced by doRead().

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

◆ setOverviewPostings()

ilObjBlog::setOverviewPostings ( ?int  $a_value)

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

Referenced by doRead().

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

◆ setProfilePicture()

ilObjBlog::setProfilePicture ( bool  $a_status)

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

Referenced by doRead().

232  : void
233  {
234  $this->ppic = $a_status;
235  }
+ Here is the caller graph for this function:

◆ setRSS()

ilObjBlog::setRSS ( bool  $a_status)

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

Referenced by doRead().

375  : void
376  {
377  $this->rss = $a_status;
378  }
+ Here is the caller graph for this function:

◆ uploadImage()

ilObjBlog::uploadImage ( array  $a_upload)

Upload new image file.

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

References $path, deleteImage(), ilShellUtil\escapeShellArg(), ilShellUtil\execConvert(), handleQuotaUpdate(), ilFileUtils\moveUploadedFile(), and setImage().

325  : bool
326  {
327  if (!$this->id) {
328  return false;
329  }
330 
331  $this->deleteImage();
332 
333  // #10074
334  $clean_name = preg_replace("/[^a-zA-Z0-9\_\.\-]/", "", $a_upload["name"]);
335 
336  $path = self::initStorage($this->id);
337  $original = "org_" . $this->id . "_" . $clean_name;
338  $thumb = "thb_" . $this->id . "_" . $clean_name;
339  $processed = $this->id . "_" . $clean_name;
340 
341  if (ilFileUtils::moveUploadedFile($a_upload["tmp_name"], $original, $path . $original)) {
342  chmod($path . $original, 0770);
343 
344  $blga_set = new ilSetting("blga");
345  /* as banner height should overflow, we only handle width
346  $dimensions = $blga_set->get("banner_width")."x".
347  $blga_set->get("banner_height");
348  */
349  $dimensions = $blga_set->get("banner_width");
350 
351  // take quality 100 to avoid jpeg artefacts when uploading jpeg files
352  // taking only frame [0] to avoid problems with animated gifs
353  $original_file = ilShellUtil::escapeShellArg($path . $original);
354  $thumb_file = ilShellUtil::escapeShellArg($path . $thumb);
355  $processed_file = ilShellUtil::escapeShellArg($path . $processed);
356  ilShellUtil::execConvert($original_file . "[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
358  $original_file . "[0] -geometry " . $dimensions . " -quality 100 JPEG:" . $processed_file
359  );
360 
361  $this->setImage($processed);
362 
363  $this->handleQuotaUpdate();
364 
365  return true;
366  }
367  return false;
368  }
static escapeShellArg(string $a_arg)
$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
static execConvert(string $args)
execute convert command
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 45 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 47 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 46 of file class.ilObjBlog.php.

Referenced by getAbstractImageWidth().

◆ $abstract_shorten

bool ilObjBlog::$abstract_shorten = false
protected

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

Referenced by getAbstractShortenLength().

◆ $approval

bool ilObjBlog::$approval = false
protected

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

Referenced by hasApproval().

◆ $authors

bool ilObjBlog::$authors = true
protected

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

Referenced by hasAuthors().

◆ $bg_color

string ilObjBlog::$bg_color = ""
protected

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

Referenced by getBackgroundColor().

◆ $content_style_domain

ILIAS Style Content DomainService ilObjBlog::$content_style_domain
protected

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

◆ $font_color

string ilObjBlog::$font_color = ""
protected

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

Referenced by getFontColor().

◆ $img

string ilObjBlog::$img = ""
protected

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

Referenced by getImage(), and getImageFullPath().

◆ $keywords

bool ilObjBlog::$keywords = true
protected

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

Referenced by hasKeywords().

◆ $nav_mode

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

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

Referenced by getNavMode().

◆ $nav_mode_list_months

int ilObjBlog::$nav_mode_list_months = null
protected

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

◆ $notes

bool ilObjBlog::$notes = false
protected

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

Referenced by getNotesStatus().

◆ $notes_service

ILIAS Notes Service ilObjBlog::$notes_service
protected

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

◆ $order

array ilObjBlog::$order = []
protected

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

Referenced by getOrder().

◆ $overview_postings

int ilObjBlog::$overview_postings = 5
protected

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

Referenced by getOverviewPostings().

◆ $ppic

string ilObjBlog::$ppic = ""
protected

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

Referenced by hasProfilePicture().

◆ $rss

bool ilObjBlog::$rss = false
protected

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

Referenced by hasRSS().

◆ $style

bool ilObjBlog::$style = false
protected

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

◆ ABSTRACT_DEFAULT_IMAGE_HEIGHT

const ilObjBlog::ABSTRACT_DEFAULT_IMAGE_HEIGHT = 144

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

Referenced by ilObjBlogGUI\getEditFormCustomValues().

◆ ABSTRACT_DEFAULT_IMAGE_WIDTH

const ilObjBlog::ABSTRACT_DEFAULT_IMAGE_WIDTH = 144

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

Referenced by ilObjBlogGUI\getEditFormCustomValues().

◆ ABSTRACT_DEFAULT_SHORTEN_LENGTH

const ilObjBlog::ABSTRACT_DEFAULT_SHORTEN_LENGTH = 500

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

◆ NAV_MODE_MONTH

const ilObjBlog::NAV_MODE_MONTH = 2

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

Referenced by ilObjBlogGUI\initEditCustomForm().


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