19 declare(strict_types=1);
42 bool $a_reference =
true 46 $this->notes_service = $DIC->notes();
47 $this->settings_manager = $DIC->blog()->internal()->domain()->blogSettings();
50 $this->rbac_review = $DIC->rbac()->review();
52 $this->content_style_domain = $DIC
56 if ($this->
getId() > 0) {
57 $this->blog_settings = $this->settings_manager->getByObjId($this->
getId());
70 $this->notes_service->domain()->commentsActive($this->
id)
72 $this->blog_settings = $this->settings_manager->getByObjId($this->
getId());
75 protected function doCreate(
bool $clone_mode =
false): void
81 $ilDB->manipulate(
"INSERT INTO il_blog (id,ppic,rss_active,approval" .
82 ",abs_shorten,abs_shorten_len,abs_image,abs_img_width,abs_img_height" .
83 ",keywords,authors,nav_mode,nav_list_mon_with_post,ov_post) VALUES (" .
84 $ilDB->quote($this->id,
"integer") .
"," .
85 $ilDB->quote(
true,
"integer") .
"," .
86 $ilDB->quote(
true,
"integer") .
"," .
87 $ilDB->quote(
false,
"integer") .
"," .
88 $ilDB->quote(
false,
"integer") .
"," .
89 $ilDB->quote(0,
"integer") .
"," .
90 $ilDB->quote(
false,
"integer") .
"," .
91 $ilDB->quote(0,
"integer") .
"," .
92 $ilDB->quote(0,
"integer") .
"," .
93 $ilDB->quote(
true,
"integer") .
"," .
94 $ilDB->quote(
false,
"integer") .
"," .
95 $ilDB->quote(self::NAV_MODE_LIST,
"integer") .
"," .
96 $ilDB->quote(5,
"integer") .
"," .
97 $ilDB->quote(5,
"integer") .
101 $this->notes_service->domain()->activateComments($this->
id);
115 $ilDB->manipulate(
"DELETE FROM il_blog" .
116 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
125 $this->notes_service->domain()->activateComments(
139 $this->settings_manager->clone($this->
getId(), $new_obj->
getId());
142 $this->content_style_domain->styleForObjId($this->
getId())->cloneTo($new_obj->
getId());
154 $this->notes = $a_status;
162 ?
string $a_comment =
null 166 $DIC->blog()->internal()->domain()->notification()->sendNotification(
184 if (!
$ilSetting->get(
'enable_global_profiles')) {
189 if (!str_ends_with($a_wsp_id,
"_cll")) {
191 $obj_id = $wsp_id->lookupObjectId((
int) $a_wsp_id);
193 $pl = $DIC->blog()->internal()->gui()->permanentLink(0, (
int) $a_wsp_id);
195 $a_wsp_id = substr($a_wsp_id, 0, -4);
198 $pl = $DIC->blog()->internal()->gui()->permanentLink((
int) $a_wsp_id);
204 $blog_settings = $DIC->blog()->internal()->domain()->blogSettings()
205 ->getByObjId($obj_id);
206 if (!$blog_settings?->getRSS()) {
210 $blog =
new self($obj_id,
false);
213 $url = $pl->getPermanentLink();
214 $url = str_replace(
"&",
"&",
$url);
217 $feed->setChannelTitle(str_replace(
"&",
"&", $blog->getTitle()));
218 $feed->setChannelDescription(str_replace(
"&",
"&", $blog->getDescription()));
219 $feed->setChannelLink(
$url);
235 $snippet = str_replace(
"&",
"&", $snippet);
236 $snippet =
"<![CDATA[" . $snippet .
"]]>";
238 $url = $pl->getPermanentLink((
int)
$id);
239 $url = str_replace(
"&",
"&",
$url);
242 $feed_item->setTitle(str_replace(
"&",
"&", $item[
"title"]));
244 $feed_item->setDescription($snippet);
245 $feed_item->setLink(
$url);
246 $feed_item->setAbout(
$url);
247 $feed->addItem($feed_item);
257 'il_blog_contributor_' . $this->
getRefId(),
258 "Contributor of blog obj_no." . $this->
getId(),
259 'il_blog_contributor',
264 'il_blog_editor_' . $this->
getRefId(),
265 "Editor of blog obj_no." . $this->
getId(),
273 foreach ($this->rbac_review->getLocalRoles($a_node_id) as $role_id) {
283 foreach ($this->rbac_review->getLocalRoles($a_node_id) as $role_id) {
294 foreach ($this->rbac_review->getLocalRoles($a_node_id) as $role_id) {
310 foreach ($this->rbac_review->getParentRoleIds($a_node_id) as $role_id => $role) {
311 if ($role_id != $contr_role_id &&
312 $role_id != $editor_role_id) {
313 $all_ops = $this->rbac_review->getActiveOperationsOfRole($a_node_id, $role_id);
314 if (in_array($contr_op_id, $all_ops) ||
315 in_array($redact_op_id, $all_ops)) {
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ABSTRACT_DEFAULT_IMAGE_WIDTH
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
const NAV_MODE_LIST_DEFAULT_POSTINGS
static getAllPostings(int $a_blog_id, int $a_limit=1000, int $a_offset=0)
Get all postings of blog.
cloneMetaData(ilObject $target_obj)
special template class to simplify handling of ITX/PEAR
SettingsManager $settings_manager
getLocalContributorRole(int $a_node_id)
getRolesWithContributeOrRedact(int $a_node_id)
ILIAS Style Content DomainService $content_style_domain
setNotesStatus(bool $a_status)
static createDefaultRole(string $a_title, string $a_description, string $a_tpl_name, int $a_ref_id)
getAllLocalRoles(int $a_node_id)
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.
const ABSTRACT_DEFAULT_SHORTEN_LENGTH
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...
static deleteAllBlogPostings(int $a_blog_id)
Delete all postings for blog.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(int $a_id=0, bool $a_reference=true)
static sendNotification(string $a_action, bool $a_in_wsp, int $a_blog_node_id, int $a_posting_id, ?string $a_comment=null)
static _lookupTitle(int $obj_id)
const ABSTRACT_DEFAULT_IMAGE_HEIGHT
static _getTranslation(string $a_role_title)
static deliverRSS(string $a_wsp_id)
Deliver blog as rss feed.
doCloneObject(ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
static _getOperationIdByName(string $a_operation)
get operation id by name of operation
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
getLocalEditorRole(int $a_node_id)
static removeForObject(int $type, int $id)
Remove all notifications for given object.
doCreate(bool $clone_mode=false)
ILIAS Notes Service $notes_service