21        $this->rbacreview = 
$DIC->rbac()->review();
 
   62        $set = 
$ilDB->query(
"SELECT * FROM il_blog" .
 
   63                " WHERE id = " . 
$ilDB->quote($this->id, 
"integer"));
 
   64        $row = 
$ilDB->fetchAssoc($set);
 
   69        $this->
setRSS($row[
"rss_active"]);
 
   82        if (trim($row[
"nav_order"])) {
 
   83            $this->
setOrder(explode(
";", $row[
"nav_order"]));
 
   96        $ilDB->manipulate(
"INSERT INTO il_blog (id,ppic,rss_active,approval" .
 
   97            ",abs_shorten,abs_shorten_len,abs_image,abs_img_width,abs_img_height" .
 
   98            ",keywords,authors,nav_mode,nav_list_mon_with_post,ov_post) VALUES (" .
 
   99            $ilDB->quote($this->id, 
"integer") . 
"," .
 
  100            $ilDB->quote(
true, 
"integer") . 
"," .
 
  101            $ilDB->quote(
true, 
"integer") . 
"," .
 
  102            $ilDB->quote(
false, 
"integer") . 
"," .
 
  103            $ilDB->quote($this->hasAbstractShorten(), 
"integer") . 
"," .
 
  104            $ilDB->quote($this->getAbstractShortenLength(), 
"integer") . 
"," .
 
  105            $ilDB->quote($this->hasAbstractImage(), 
"integer") . 
"," .
 
  106            $ilDB->quote($this->getAbstractImageWidth(), 
"integer") . 
"," .
 
  107            $ilDB->quote($this->getAbstractImageHeight(), 
"integer") . 
"," .
 
  108            $ilDB->quote($this->hasKeywords(), 
"integer") . 
"," .
 
  109            $ilDB->quote($this->hasAuthors(), 
"integer") . 
"," .
 
  110            $ilDB->quote($this->getNavMode(), 
"integer") . 
"," .
 
  111            $ilDB->quote($this->getNavModeListMonthsWithPostings(), 
"integer") . 
"," .
 
  112            $ilDB->quote($this->getOverviewPostings(), 
"integer") .
 
  130        $ilDB->manipulate(
"DELETE FROM il_blog" .
 
  131            " WHERE id = " . 
$ilDB->quote($this->id, 
"integer"));
 
  139            $ilDB->manipulate(
"UPDATE il_blog" .
 
  140                    " SET ppic = " . 
$ilDB->quote($this->hasProfilePicture(), 
"integer") .
 
  141                    ",bg_color = " . 
$ilDB->quote($this->getBackgroundColor(), 
"text") .
 
  142                    ",font_color = " . 
$ilDB->quote($this->getFontcolor(), 
"text") .
 
  143                    ",img = " . 
$ilDB->quote($this->getImage(), 
"text") .
 
  144                    ",rss_active = " . 
$ilDB->quote($this->hasRSS(), 
"integer") .
 
  145                    ",approval = " . 
$ilDB->quote($this->hasApproval(), 
"integer") .
 
  146                    ",abs_shorten = " . 
$ilDB->quote($this->hasAbstractShorten(), 
"integer") .
 
  147                    ",abs_shorten_len = " . 
$ilDB->quote($this->getAbstractShortenLength(), 
"integer") .
 
  148                    ",abs_image = " . 
$ilDB->quote($this->hasAbstractImage(), 
"integer") .
 
  149                    ",abs_img_width = " . 
$ilDB->quote($this->getAbstractImageWidth(), 
"integer") .
 
  150                    ",abs_img_height = " . 
$ilDB->quote($this->getAbstractImageHeight(), 
"integer") .
 
  151                    ",keywords = " . 
$ilDB->quote($this->hasKeywords(), 
"integer") .
 
  152                    ",authors = " . 
$ilDB->quote($this->hasAuthors(), 
"integer") .
 
  153                    ",nav_mode = " . 
$ilDB->quote($this->getNavMode(), 
"integer") .
 
  154                    ",nav_list_mon_with_post = " . 
$ilDB->quote($this->getNavModeListMonthsWithPostings(), 
"integer") .
 
  155                    ",nav_list_mon = " . 
$ilDB->quote($this->getNavModeListMonths(), 
"integer") .
 
  156                    ",ov_post = " . 
$ilDB->quote($this->getOverviewPostings(), 
"integer") .
 
  157                    ",nav_order = " . 
$ilDB->quote(implode(
";", $this->
getOrder()), 
"text") .
 
  158                    " WHERE id = " . 
$ilDB->quote($this->id, 
"integer"));
 
  167    protected function doCloneObject($new_obj, $a_target_id, $a_copy_id = 
null, $a_omit_tree = 
false)
 
  172            $new_obj->setImage(
$img);
 
  175            $target = $new_obj->initStorage($new_obj->getId());
 
  184        $new_obj->setRSS($this->
hasRSS());
 
  197            $new_id = $style_obj->ilClone();
 
  198            $new_obj->setStyleSheetId($new_id);
 
  220        $this->notes = (bool) $a_status;
 
  240        $this->ppic = (bool) $a_status;
 
  250        if (!$this->bg_color) {
 
  251            $this->bg_color = 
"ffffff";
 
  263        $this->bg_color = (string) $a_value;
 
  273        if (!$this->font_color) {
 
  274            $this->font_color = 
"505050";
 
  286        $this->font_color = (string) $a_value;
 
  306        $this->img = (string) $a_value;
 
  353        $path = $storage->getAbsolutePath() . 
"/";
 
  356            $path .= $a_subdir . 
"/";
 
  358            if (!is_dir($path)) {
 
  381        $clean_name = preg_replace(
"/[^a-zA-Z0-9\_\.\-]/", 
"", $a_upload[
"name"]);
 
  384        $original = 
"org_" . $this->
id . 
"_" . $clean_name;
 
  385        $thumb = 
"thb_" . $this->
id . 
"_" . $clean_name;
 
  386        $processed = $this->
id . 
"_" . $clean_name;
 
  389            chmod($path . $original, 0770);
 
  396            $dimensions = $blga_set->get(
"banner_width");
 
  403            ilUtil::execConvert($original_file . 
"[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
 
  404            ilUtil::execConvert($original_file . 
"[0] -geometry " . $dimensions . 
" -quality 100 JPEG:" . $processed_file);
 
  432        $this->rss = (bool) $a_status;
 
  452        $this->approval = (bool) $a_status;
 
  472        $this->style = (int) $a_style;
 
  482        $this->abstract_shorten = (bool) $a_value;
 
  492        $this->abstract_shorten_length = (int) $a_value;
 
  502        $this->abstract_image = (bool) $a_value;
 
  512        $this->abstract_image_width = (int) $a_value;
 
  522        $this->abstract_image_height = (int) $a_value;
 
  527        $this->keywords = (bool) $a_value;
 
  537        $this->authors = (bool) $a_value;
 
  547        $a_value = (int) $a_value;
 
  548        if (in_array($a_value, array(self::NAV_MODE_LIST, self::NAV_MODE_MONTH))) {
 
  549            $this->nav_mode = $a_value;
 
  560        $this->nav_mode_list_months_with_post = (int) $a_value;
 
  565        return $this->nav_mode_list_months_with_post;
 
  573            $a_value = (int) $a_value;
 
  575        $this->nav_mode_list_months = $a_value;
 
  588            $a_value = (int) $a_value;
 
  590        $this->overview_postings = $a_value;
 
  600        $this->order = $a_values;
 
  608    public static function sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment = 
null)
 
  617            $blog_obj_id = 
$tree->lookupObjectId($a_blog_node_id);
 
  621            $access_handler = 
null;
 
  630        $ignore_threshold = ($a_action == 
"comment");
 
  635        if (!$posting->isApproved()) {
 
  636            $blog = 
new self($blog_obj_id, 
false);
 
  637            if ($blog->hasApproval()) {
 
  646                        $ignore_threshold = 
true;
 
  647                        $a_action = 
"approve";
 
  655            in_array($a_action, array(
"update", 
"new"))) {
 
  656            $posting->handleNews(($a_action == 
"update"));
 
  666        if (!
sizeof($users)) {
 
  671        $ntf->setLangModules(array(
"blog"));
 
  672        $ntf->setRefId($a_blog_node_id);
 
  673        $ntf->setChangedByUserId(
$ilUser->getId());
 
  674        $ntf->setSubjectLangId(
'blog_change_notification_subject');
 
  675        $ntf->setIntroductionLangId(
'blog_change_notification_body_' . $a_action);
 
  676        $ntf->addAdditionalInfo(
'blog_posting', $posting->getTitle());
 
  678            $ntf->addAdditionalInfo(
'comment', $a_comment, 
true);
 
  680        $ntf->setGotoLangId(
'blog_change_notification_link');
 
  681        $ntf->setReasonLangId(
'blog_change_notification_reason');
 
  683        $abstract = $posting->getNotificationAbstract();
 
  685            $ntf->addAdditionalInfo(
'content', $abstract, 
true);
 
  688        $notified = $ntf->sendMail(
 
  691            ($admin_only ? 
"write" : 
"read")
 
  695        if (
sizeof($notified)) {
 
  712        if (!
$ilSetting->get(
'enable_global_profiles')) {
 
  717        if (substr($a_wsp_id, -4) != 
"_cll") {
 
  719            $obj_id = $wsp_id->lookupObjectId($a_wsp_id);
 
  722            $a_wsp_id = substr($a_wsp_id, 0, -4);
 
  730        $blog = 
new self($obj_id, 
false);
 
  731        if (!$blog->hasRSS()) {
 
  738        $url = str_replace(
"&", 
"&", 
$url);
 
  741        $feed->setChannelTitle(str_replace(
"&", 
"&", $blog->getTitle()));
 
  742        $feed->setChannelDescription(str_replace(
"&", 
"&", $blog->getDescription()));
 
  743        $feed->setChannelLink(
$url);
 
  759            $snippet = str_replace(
"&", 
"&", $snippet);
 
  760            $snippet = 
"<![CDATA[" . $snippet . 
"]]>";
 
  763            $url = str_replace(
"&", 
"&", 
$url);
 
  766            $feed_item->setTitle(str_replace(
"&", 
"&", $item[
"title"])); 
 
  768            $feed_item->setDescription($snippet);
 
  769            $feed_item->setLink(
$url);
 
  770            $feed_item->setAbout(
$url);
 
  771            $feed->addItem($feed_item);
 
  781            'il_blog_contributor_' . $this->
getRefId(),
 
  782            "Contributor of blog obj_no." . $this->
getId(),
 
  783            'il_blog_contributor',
 
  788            'il_blog_editor_' . $this->
getRefId(),
 
  789            "Editor of blog obj_no." . $this->
getId(),
 
  801        foreach (
$rbacreview->getLocalRoles($a_node_id) as $role_id) {
 
  812        foreach (
$rbacreview->getLocalRoles($a_node_id) as $role_id) {
 
  824        foreach (
$rbacreview->getLocalRoles($a_node_id) as $role_id) {
 
  842        foreach (
$rbacreview->getParentRoleIds($a_node_id) as $role_id => $role) {
 
  843            if ($role_id != $contr_role_id &&
 
  844                $role_id != $editor_role_id) {
 
  845                $all_ops = 
$rbacreview->getActiveOperationsOfRole($a_node_id, $role_id);
 
  846                if (in_array($contr_op_id, $all_ops) ||
 
  847                    in_array($redact_op_id, $all_ops)) {
 
An exception for terminatinating execution or to throw for unit testing.
static getSnippet($a_id, $a_truncate=false, $a_truncate_length=500, $a_truncate_sign="...", $a_include_picture=false, $a_picture_width=144, $a_picture_height=144, $a_export_directory=null)
Get first text paragraph of page.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
static deleteAllBlogPostings($a_blog_id)
Delete all postings for blog.
A FeedItem represents an item in a News Feed.
special template class to simplify handling of ITX/PEAR
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_news_id=0)
Are comments activated for object?
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
static removeForObject($type, $id)
Remove all notifications for given object.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
static updateNotificationTime($type, $id, array $user_ids, $page_id=false)
Update the last mail timestamp for given object and users.
setBackgroundColor($a_value)
Set background color.
getRolesWithContributeOrRedact($a_node_id)
setProfilePicture($a_status)
Toggle profile picture status.
setNavModeListMonthsWithPostings($a_value)
setFontColor($a_value)
Set font color.
hasProfilePicture()
Get profile picture status.
setNotesStatus($a_status)
Toggle notes status.
getStyleSheetId()
Get style sheet id.
static sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment=null)
getLocalContributorRole($a_node_id)
static deliverRSS($a_wsp_id)
Deliver blog as rss feed.
deleteImage()
remove existing file
setAbstractShorten($a_value)
getFontColor()
Get font color.
getImageFullPath($a_as_thumb=false)
Get banner image incl.
setAbstractShortenLength($a_value)
setRSS($a_status)
Toggle RSS status.
initDefaultRoles()
init default roles settings Purpose of this function is to create a local role folder and local roles...
setAbstractImage($a_value)
setOrder(array $a_values=null)
setOverviewPostings($a_value)
uploadImage(array $a_upload)
Upload new image file.
setAbstractImageHeight($a_value)
static initStorage($a_id, $a_subdir=null)
Init file system storage.
getLocalEditorRole($a_node_id)
getBackgroundColor()
Get background color.
getAbstractShortenLength()
const ABSTRACT_DEFAULT_SHORTEN_LENGTH
getAllLocalRoles($a_node_id)
const ABSTRACT_DEFAULT_IMAGE_WIDTH
const NAV_MODE_LIST_DEFAULT_POSTINGS
doCloneObject($new_obj, $a_target_id, $a_copy_id=null, $a_omit_tree=false)
setStyleSheetId($a_style)
Set style sheet id.
setAbstractImageWidth($a_value)
setNavModeListMonths($a_value)
hasApproval()
Get approval status.
setApproval($a_status)
Toggle approval status.
getImage()
Get banner image.
getNavModeListMonthsWithPostings()
getNotesStatus()
Get notes status.
__construct($a_id=0, $a_reference=true)
Constructor.
const ABSTRACT_DEFAULT_IMAGE_HEIGHT
setImage($a_value)
Set banner image.
static _getTranslation($a_role_title)
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
static _lookupStandard($a_id)
Lookup standard flag.
static lookupObjectStyle($a_obj_id)
Lookup object style.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
Class ilObject2 This is an intermediate progress of ilObject class.
getRefId()
get reference id @access public
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
getId()
get object id @access public
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static _getOperationIdByName($a_operation)
get operation id by name of operation @access public @access static
Wrapper classes for system notifications.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static escapeShellArg($a_arg)
static execConvert($args)
execute convert command
Access handler for personal workspace.
Tree handler for personal workspace.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res