ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilBlogPosting Class Reference

Class ilBlogPosting. More...

+ Inheritance diagram for ilBlogPosting:
+ Collaboration diagram for ilBlogPosting:

Public Member Functions

 getParentType ()
 Get parent type.
 setTitle ($a_title)
 Set title.
 getTitle ()
 Get title.
 setBlogId ($a_id)
 Set blog object id.
 getBlogId ()
 Get blog object id.
 setCreated (ilDateTime $a_date)
 Set creation date.
 getCreated ()
 Get creation date.
 setAuthor ($a_id)
 Set author user id.
 getAuthor ()
 Get author user id.
 setApproved ($a_status)
 Toggle approval status.
 isApproved ()
 Get approved status.
 create ($a_import=false)
 Create new blog posting.
 update ($a_validate=true, $a_no_history=false, $a_notify=true, $a_notify_action="update")
 Update blog posting.
 read ()
 Read blog posting.
 checkApproval ()
 delete ()
 Delete blog posting and all related data.
 setBlogNodeId ($a_id, $a_is_in_workspace=false)
 Set blog node id (needed for notification)
 getNotificationAbstract ()
 getMDSection ()
 updateKeywords (array $keywords)
- Public Member Functions inherited from ilPageObject
 ilPageObject ($a_id=0, $a_old_nr=0, $a_lang="-")
 Constructor public.
 afterConstructor ()
 After constructor.
 initPageConfig ()
 Init page config.
 setLanguage ($a_val)
 Set language.
 getLanguage ()
 Get language.
 setPageConfig ($a_val)
 Set page config object.
 getPageConfig ()
 Get page config object.
 setRenderMd5 ($a_rendermd5)
 Set Render MD5.
 getRenderMd5 ()
 Get Render MD5.
 setRenderedContent ($a_renderedcontent)
 Set Rendered Content.
 getRenderedContent ()
 Get Rendered Content.
 setRenderedTime ($a_renderedtime)
 Set Rendered Time.
 getRenderedTime ()
 Get Rendered Time.
 setLastChange ($a_lastchange)
 Set Last Change.
 getLastChange ()
 Get Last Change.
 setLastChangeUser ($a_val)
 Set last change user.
 getLastChangeUser ()
 Get last change user.
 setShowActivationInfo ($a_val)
 Set show page activation info.
 getShowActivationInfo ()
 Get show page activation info.
 buildDom ($a_force=false)
 freeDom ()
 getDom ()
 Deprecated php4DomDocument.
 getDomDoc ()
 Get dom doc (php5 dom document)
 setId ($a_id)
 set id
 getId ()
 setParentId ($a_id)
 getParentId ()
 addUpdateListener (&$a_object, $a_method, $a_parameters="")
 callUpdateListeners ()
 setActive ($a_active)
 set activation
 getActive ($a_check_scheduled_activation=false)
 get activation
 _writeActive ($a_id, $a_parent_type, $a_active, $a_reset_scheduled_activation=true, $a_lang="-")
 write activation status
 _lookupActivationData ($a_id, $a_parent_type, $a_lang="-")
 Lookup activation data.
 _writeParentId ($a_parent_type, $a_pg_id, $a_par_id)
 Write parent id.
 setActivationStart ($a_activationstart)
 Set Activation Start.
 getActivationStart ()
 Get Activation Start.
 setActivationEnd ($a_activationend)
 Set Activation End.
 getActivationEnd ()
 Get Activation End.
 getContentObject ($a_hier_id, $a_pc_id="")
 Get a content object of the page.
getContentNode ($a_hier_id, $a_pc_id="")
 Get content node from dom.
 checkForTag ($a_content_tag, $a_hier_id, $a_pc_id="")
 Get content node from dom.
 lookforhier ($a_hier_id)
getNode ()
 setXMLContent ($a_xml, $a_encoding="UTF-8")
 set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD, omit MetaData, use utf-8!
 appendXMLContent ($a_xml)
 append xml content to page setXMLContent must be called before and the same encoding must be used
 getXMLContent ($a_incl_head=false)
 get xml content of page
 copyXmlContent ($a_clone_mobs=false)
 Copy content of page; replace page components with copies where necessary (e.g.
 handleCopiedContent ($a_dom, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content.
 newIIMCopies ($temp_dom)
 Replaces media objects in interactive images with copies of the interactive images.
 newMobCopies ($temp_dom)
 Replaces media objects with copies.
 newQuestionCopies (&$temp_dom)
 Replaces existing question content elements with new copies.
 removeQuestions (&$temp_dom)
 Remove questions from document.
 countPageContents ()
 Remove questions from document.
 getXMLFromDom ($a_incl_head=false, $a_append_mobs=false, $a_append_bib=false, $a_append_str="", $a_omit_pageobject_tag=false)
 get xml content of page from dom (use this, if any changes are made to the document)
 getLanguageVariablesXML ()
 Get language variables as XML.
 appendLangVarXML (&$xml, $var)
 getFirstParagraphText ()
 setParagraphContent ($a_hier_id, $a_content)
 Set content of paragraph.
 setContainsIntLink ($a_contains_link)
 lm parser set this flag to true, if the page contains intern links (this method should only be called by the import parser)
 containsIntLink ()
 returns true, if page was marked as containing an intern link (via setContainsIntLink) (this method should only be called by the import parser)
 setImportMode ($a_val)
 Set import mode.
 getImportMode ()
 Get import mode.
 needsImportParsing ($a_parse="")
 setContainsQuestion ($a_val)
 Set contains question.
 getContainsQuestion ()
 Get contains question.
 collectMediaObjects ($a_inline_only=true)
 get all media objects, that are referenced and used within the page
 getInternalLinks ($a_cnt_multiple=false)
 get all internal links that are used within the page
 getMultimediaXML ()
 get a xml string that contains all media object elements, that are referenced by any media alias in the page
 getMediaAliasElement ($a_mob_id, $a_nr=1)
 get complete media object (alias) element
 validateDom ()
 Validate the page content agains page DTD.
 addHierIDs ()
 Add hierarchical ID (e.g.
 getHierIds ()
 get all hierarchical ids
 getFirstRowIds ()
 get ids of all first table rows
 getFirstColumnIds ()
 get ids of all first table columns
 getListItemIds ()
 get ids of all list items
 getFileItemIds ()
 get ids of all file items
 stripHierIDs ()
 strip all hierarchical id attributes out of the dom tree
 getHierIdsForPCIds ($a_pc_ids)
 Get hier ids for a set of pc ids.
 addFileSizes ()
 add file sizes
 resolveIntLinks ()
 Resolves all internal link targets of the page, if targets are available (after import)
 resolveMediaAliases ($a_mapping)
 Resolve media aliases (after import)
 resolveIIMMediaAliases ($a_mapping)
 Resolve iim media aliases (in ilContObjParse)
 resolveFileItems ($a_mapping)
 Resolve file items (after import)
 resolveQuestionReferences ($a_mapping)
 Resolve all quesion references (after import)
 moveIntLinks ($a_from_to)
 Move internal links from one destination to another.
 handleImportRepositoryLink ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 createFromXML ()
 Create new page object with current xml content.
 updateFromXML ()
 Updates page object with current xml content.
 afterUpdate ()
 After update.
 update ($a_validate=true, $a_no_history=false)
 update complete page content in db (dom xml content is used)
 saveStyleUsage ($a_domdoc, $a_old_nr=0)
 Save all style class/template usages.
 deleteStyleUsages ($a_old_nr=0)
 Delete style usages.
 getLastUpdateOfIncludedElements ()
 Get last update of included elements (media objects and files).
 deleteInternalLinks ()
 Delete internal links.
 saveInternalLinks ($a_domdoc)
 save internal links of page
 create ()
 create new page (with current xml data)
 deleteContent ($a_hid, $a_update=true, $a_pcid="")
 delete content object with hierarchical id $a_hid
 deleteContents ($a_hids, $a_update=true, $a_self_ass=false)
 Delete multiple content objects.
 cutContents ($a_hids)
 Copy contents to clipboard and cut them from the page.
 copyContents ($a_hids)
 Copy contents to clipboard.
 pasteContents ($a_hier_id, $a_self_ass=false)
 Paste contents from pc clipboard.
 switchEnableMultiple ($a_hids, $a_update=true, $a_self_ass=false)
 (De-)activate elements
 deleteContentFromHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id >= $a_hid
 deleteContentBeforeHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id < $a_hid
 _moveContentAfterHierId (&$a_source_page, &$a_target_page, $a_hid)
 move content of hierarchical id >= $a_hid to other page
 insertContent (&$a_cont_obj, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent
 insertContentNode (&$a_cont_node, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent
 moveContentBefore ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids)
 moveContentAfter ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids)
 bbCode2XML (&$a_content)
 transforms bbCode to corresponding xml
 insertInstIntoIDs ($a_inst, $a_res_ref_to_obj_id=true)
 inserts installation id into ids (e.g.
 checkPCIds ()
 Check, whether (all) page content hashes are set.
 getAllPCIds ()
 Get all pc ids.
 existsPCId ($a_pc_id)
 existsPCId
 generatePcId ($a_pc_ids=false)
 Generate new pc id.
 insertPCIds ()
 Insert Page Content IDs.
 getPageContentsHashes ()
 Get page contents hashes.
 getQuestionIds ()
 Get question ids.
 send_paragraph ($par_id, $filename)
 getFO ()
 get fo page content
 registerOfflineHandler ($handler)
 getOfflineHandler ()
 Get offline handler.
 containsDeactivatedElements ($a_content)
 Check whether content contains deactivated elements.
 getHistoryEntries ()
 Get History Entries.
 getHistoryEntry ($a_old_nr)
 Get History Entry.
 getHistoryInfo ($a_nr)
 Get information about a history entry, its predecessor and its successor.
 addChangeDivClasses ($a_hashes)
 compareVersion ($a_left, $a_right)
 Compares to revisions of the page.
 increaseViewCnt ()
 Increase view cnt.
 writeRenderedContent ($a_content, $a_md5)
 Write rendered content.
 containsIntLinks ($a_content)
 Check whether content contains internal links.
 performAutomaticModifications ()
 Perform automatic modifications (may be overwritten by sub classes)
 saveInitialOpenedContent ($a_type, $a_id, $a_target)
 Save initial opened content.
 getInitialOpenedContent ()
 Get initial opened content.
 beforePageContentUpdate ($a_page_content)
 Before page content update.
 copy ($a_id, $a_parent_type="", $a_parent_id=0, $a_clone_mobs=false)
 Copy page.
 copyPageToTranslation ($a_target_lang)
 Copy page to translation.
 getEditLock ()
 Get page lock.
 releasePageLock ()
 Release page lock.
 getEditLockInfo ()
 Get edit lock info.
 getContentTemplates ()
 Get content templates.

Static Public Member Functions

static deleteAllBlogPostings ($a_blog_id)
 Delete all postings for blog.
static lookupBlogId ($a_posting_id)
 Lookup blog id.
static getAllPostings ($a_blog_id, $a_limit=1000, $a_offset=0)
 Get all postings of blog.
static exists ($a_blog_id, $a_posting_id)
 Checks whether a posting exists.
static getLastPost ($a_blog_id)
 Get newest posting for blog.
static searchBlogsByAuthor ($a_user_id)
 Get all blogs where user has postings.
static getKeywords ($a_obj_id, $a_posting_id)
- Static Public Member Functions inherited from ilPageObject
static _exists ($a_parent_type, $a_id, $a_lang="")
 Checks whether page exists.
static _existsAndNotEmpty ($a_parent_type, $a_id, $a_lang="-")
 Checks whether page exists and is not empty (may return true on some empty pages)
static preloadActivationDataByParentId ($a_parent_id)
 Preload activation data by Parent Id.
static _lookupActive ($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
 lookup activation status
static _isScheduledActivation ($a_id, $a_parent_type, $a_lang="-")
 Check whether page is activated by time schedule.
static lookupParentId ($a_id, $a_type)
 Lookup parent id.
static _handleImportRepositoryLinks ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 Change targest of repository links.
static _lookupContainsDeactivatedElements ($a_id, $a_parent_type, $a_lang="-")
 lookup whether page contains deactivated elements
static getRecentChanges ($a_parent_type, $a_parent_id, $a_period=30, $a_lang="")
 Get recent pages changes for parent object.
static getAllPages ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all pages for parent object.
static getNewPages ($a_parent_type, $a_parent_id, $a_lang="-")
 Get new pages.
static getParentObjectContributors ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all contributors for parent object.
static getPageContributors ($a_parent_type, $a_page_id, $a_lang="-")
 Get all contributors for parent object.
static getPagesWithLinks ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all pages for parent object that contain internal links.
static lookupTranslations ($a_parent_type, $a_id)
 Lookup translations.
static truncateHTML ($a_text, $a_length=100, $a_ending= '...', $a_exact=false, $a_consider_html=true)
 Truncate (html) string.

Protected Attributes

 $title
 $created
 $blog_node_id
 $blog_node_is_wsp
 $author
 $approved
- Protected Attributes inherited from ilPageObject
 $import_mode = false

Additional Inherited Members

- Data Fields inherited from ilPageObject
 $id
 $ilias
 $dom
 $xml
 $encoding
 $node
 $cur_dtd = "ilias_pg_4_5.dtd"
 $contains_int_link
 $needs_parsing
 $parent_type
 $parent_id
 $update_listeners
 $update_listener_cnt
 $offline_handler
 $dom_builded
 $history_saved
 $language = "-"
- Static Public Attributes inherited from ilPageObject
static $exists = array()
- Protected Member Functions inherited from ilPageObject
 __afterUpdate ($a_domdoc, $a_xml, $a_creation=false, $a_empty=false)
 After update event handler (internal).
 __beforeDelete ()
 Before deletion handler (internal).
 __afterHistoryEntry ($a_old_domdoc, $a_old_content, $a_old_nr)
 Before deletion handler (internal).
- Static Protected Attributes inherited from ilPageObject
static $activation_data = array()

Detailed Description

Class ilBlogPosting.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 14 of file class.ilBlogPosting.php.

Member Function Documentation

ilBlogPosting::checkApproval ( )

Definition at line 230 of file class.ilBlogPosting.php.

References ilPageObject\getActive(), isApproved(), and update().

{
if(!$this->getActive() && $this->isApproved())
{
$this->approved = false;
$this->update();
}
}

+ Here is the call graph for this function:

ilBlogPosting::create (   $a_import = false)

Create new blog posting.

Definition at line 135 of file class.ilBlogPosting.php.

References $created, ilPageObject\$id, $ilDB, $query, ilPageObject\create(), getAuthor(), getBlogId(), getCreated(), ilPageObject\getId(), getTitle(), IL_CAL_DATETIME, ilUtil\now(), and ilPageObject\setId().

{
global $ilDB;
$id = $ilDB->nextId("il_blog_posting");
$this->setId($id);
if(!$a_import)
{
}
else
{
}
// we are using a separate creation date to enable sorting without JOINs
$query = "INSERT INTO il_blog_posting (id, title, blog_id, created, author, approved)".
" VALUES (".
$ilDB->quote($this->getId(), "integer").",".
$ilDB->quote($this->getTitle(), "text").",".
$ilDB->quote($this->getBlogId(), "integer").",".
$ilDB->quote($created, "timestamp").",".
$ilDB->quote($this->getAuthor(), "integer").",".
$ilDB->quote(false, "integer").")";
$ilDB->manipulate($query);
if(!$a_import)
{
// $this->saveInternalLinks($this->getXMLContent());
}
}

+ Here is the call graph for this function:

ilBlogPosting::delete ( )

Delete blog posting and all related data.

Returns
bool

Reimplemented from ilPageObject.

Definition at line 244 of file class.ilBlogPosting.php.

References $ilDB, $query, and ilPageObject\getId().

{
global $ilDB;
$query = "DELETE FROM il_blog_posting".
" WHERE id = ".$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

static ilBlogPosting::deleteAllBlogPostings (   $a_blog_id)
static

Delete all postings for blog.

Parameters
int$a_blog_id

Definition at line 262 of file class.ilBlogPosting.php.

References ilPageObject\$id, $ilDB, and $query.

Referenced by ilObjBlog\doDelete().

{
global $ilDB;
include_once 'Services/MetaData/classes/class.ilMD.php';
$query = "SELECT * FROM il_blog_posting".
" WHERE blog_id = ".$ilDB->quote($a_blog_id, "integer");
$set = $ilDB->query($query);
while($rec = $ilDB->fetchAssoc($set))
{
// delete all md keywords
$md_obj = new ilMD($a_blog_id, $rec["id"], "blp");
if(is_object($md_section = $md_obj->getGeneral()))
{
foreach($md_section->getKeywordIds() as $id)
{
$md_key = $md_section->getKeyword($id);
$md_key->delete();
}
}
$post = new ilBlogPosting($rec["id"]);
$post->delete();
}
}

+ Here is the caller graph for this function:

static ilBlogPosting::exists (   $a_blog_id,
  $a_posting_id 
)
static

Checks whether a posting exists.

Parameters
int$a_blog_id
int$a_posting_id
Returns
bool

Definition at line 355 of file class.ilBlogPosting.php.

References $ilDB, and $query.

Referenced by ilObjBlogGUI\executeCommand().

{
global $ilDB;
$query = "SELECT id FROM il_blog_posting".
" WHERE blog_id = ".$ilDB->quote($a_blog_id, "integer").
" AND id = ".$ilDB->quote($a_posting_id, "integer");
$set = $ilDB->query($query);
if($rec = $ilDB->fetchAssoc($set))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilBlogPosting::getAllPostings (   $a_blog_id,
  $a_limit = 1000,
  $a_offset = 0 
)
static

Get all postings of blog.

Parameters
int$a_blog_id
int$a_limit
int$a_offset
Returns
array

Definition at line 317 of file class.ilBlogPosting.php.

References $ilDB, $query, ilPageObject\getAllPages(), and IL_CAL_DATETIME.

Referenced by ilObjBlogGUI\buildPostingList(), ilObjBlog\deliverRSS(), ilObjBlogGUI\exportHTMLPages(), getLastPost(), ilBlogExporter\getXmlExportTailDependencies(), ilBlogPostingGUI\initKeywordsForm(), and ilPCBlogGUI\initPostingForm().

{
global $ilDB;
$pages = parent::getAllPages("blp", $a_blog_id);
if($a_limit)
{
$ilDB->setLimit($a_limit, $a_offset);
}
$query = "SELECT * FROM il_blog_posting".
" WHERE blog_id = ".$ilDB->quote($a_blog_id, "integer").
" ORDER BY created DESC";
$set = $ilDB->query($query);
$post = array();
while($rec = $ilDB->fetchAssoc($set))
{
if (isset($pages[$rec["id"]]))
{
$post[$rec["id"]] = $pages[$rec["id"]];
$post[$rec["id"]]["title"] = $rec["title"];
$post[$rec["id"]]["created"] = new ilDateTime($rec["created"], IL_CAL_DATETIME);
$post[$rec["id"]]["author"] = $rec["author"];
$post[$rec["id"]]["approved"] = (bool)$rec["approved"];
}
}
return $post;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPosting::getAuthor ( )

Get author user id.

Returns
int

Definition at line 109 of file class.ilBlogPosting.php.

References $author.

Referenced by create().

{
return $this->author;
}

+ Here is the caller graph for this function:

ilBlogPosting::getBlogId ( )

Get blog object id.

Returns
int

Definition at line 69 of file class.ilBlogPosting.php.

References ilPageObject\getParentId().

Referenced by create(), and getMDSection().

{
return $this->getParentId();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPosting::getCreated ( )

Get creation date.

Returns
ilDateTime

Definition at line 89 of file class.ilBlogPosting.php.

References $created.

Referenced by create(), and update().

{
}

+ Here is the caller graph for this function:

static ilBlogPosting::getKeywords (   $a_obj_id,
  $a_posting_id 
)
static

Definition at line 463 of file class.ilBlogPosting.php.

References ilMDKeyword\lookupKeywords().

Referenced by ilObjBlogGUI\filterItemsByKeyWord(), ilObjBlogGUI\getKeywords(), ilBlogPostingGUI\initKeywordsForm(), and ilBlogDataSet\readData().

{
include_once("./Services/MetaData/classes/class.ilMDKeyword.php");
return ilMDKeyword::lookupKeywords($a_obj_id, $a_posting_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBlogPosting::getLastPost (   $a_blog_id)
static

Get newest posting for blog.

Parameters
int$a_blog_id
Returns
int

Definition at line 376 of file class.ilBlogPosting.php.

References getAllPostings().

{
$data = self::getAllPostings($a_blog_id, 1);
if($data)
{
return array_pop(array_keys($data));
}
}

+ Here is the call graph for this function:

ilBlogPosting::getMDSection ( )

Definition at line 437 of file class.ilBlogPosting.php.

References getBlogId(), and ilPageObject\getId().

Referenced by updateKeywords().

{
// general section available?
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->getBlogId(), $this->getId(), "blp");
if(!is_object($md_section = $md_obj->getGeneral()))
{
$md_section = $md_obj->addGeneral();
$md_section->save();
}
return $md_section;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPosting::getNotificationAbstract ( )

Definition at line 420 of file class.ilBlogPosting.php.

References ilPageObject\getId(), and ilBlogPostingGUI\getSnippet().

{
include_once "Modules/Blog/classes/class.ilBlogPostingGUI.php";
$snippet = ilBlogPostingGUI::getSnippet($this->getId(), true);
// making things more readable
$snippet = str_replace('<br/>', "\n", $snippet);
$snippet = str_replace('<br />', "\n", $snippet);
$snippet = str_replace('</p>', "\n", $snippet);
$snippet = str_replace('</div>', "\n", $snippet);
return trim(strip_tags($snippet));
}

+ Here is the call graph for this function:

ilBlogPosting::getParentType ( )

Get parent type.

Returns
string parent type

Reimplemented from ilPageObject.

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

{
return "blp";
}
ilBlogPosting::getTitle ( )

Get title.

Returns
string

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

References $title.

Referenced by create(), and update().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilBlogPosting::isApproved ( )

Get approved status.

Returns
bool

Definition at line 127 of file class.ilBlogPosting.php.

References $approved.

Referenced by checkApproval(), and update().

{
return (bool)$this->approved;
}

+ Here is the caller graph for this function:

static ilBlogPosting::lookupBlogId (   $a_posting_id)
static

Lookup blog id.

Parameters
int$a_posting_id
Returns
int

Definition at line 295 of file class.ilBlogPosting.php.

References $ilDB, and $query.

Referenced by ilBlogImporter\finalProcessing(), and ilBlogDataSet\readData().

{
global $ilDB;
$query = "SELECT blog_id FROM il_blog_posting".
" WHERE id = ".$ilDB->quote($a_posting_id, "integer");
$set = $ilDB->query($query);
if ($rec = $ilDB->fetchAssoc($set))
{
return $rec["blog_id"];
}
return false;
}

+ Here is the caller graph for this function:

ilBlogPosting::read ( )

Read blog posting.

Reimplemented from ilPageObject.

Definition at line 206 of file class.ilBlogPosting.php.

References $ilDB, $query, ilPageObject\addUpdateListener(), ilPageObject\getId(), IL_CAL_DATETIME, setApproved(), setAuthor(), setBlogId(), setCreated(), and setTitle().

{
global $ilDB;
$query = "SELECT * FROM il_blog_posting".
" WHERE id = ".$ilDB->quote($this->getId(), "integer");
$set = $ilDB->query($query);
$rec = $ilDB->fetchAssoc($set);
$this->setTitle($rec["title"]);
$this->setBlogId($rec["blog_id"]);
$this->setCreated(new ilDateTime($rec["created"], IL_CAL_DATETIME));
$this->setAuthor($rec["author"]);
if((bool)$rec["approved"])
{
$this->setApproved(true);
}
// when posting is deactivated it should loose the approval
$this->addUpdateListener($this, "checkApproval");
}

+ Here is the call graph for this function:

static ilBlogPosting::searchBlogsByAuthor (   $a_user_id)
static

Get all blogs where user has postings.

Parameters
int$a_user_id
Returns
array

Definition at line 403 of file class.ilBlogPosting.php.

References $ilDB, and $row.

Referenced by ilPCBlogGUI\initForm().

{
global $ilDB;
$ids = array();
$sql = "SELECT DISTINCT(blog_id)".
" FROM il_blog_posting".
" WHERE author = ".$ilDB->quote($a_user_id);
$set = $ilDB->query($sql);
while($row = $ilDB->fetchAssoc($set))
{
$ids[] = $row["blog_id"];
}
return $ids;
}

+ Here is the caller graph for this function:

ilBlogPosting::setApproved (   $a_status)

Toggle approval status.

Definition at line 117 of file class.ilBlogPosting.php.

Referenced by read().

{
$this->approved = (bool)$a_status;
}

+ Here is the caller graph for this function:

ilBlogPosting::setAuthor (   $a_id)

Set author user id.

Parameters
int$a_id

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

Referenced by read().

{
$this->author = (int)$a_id;
}

+ Here is the caller graph for this function:

ilBlogPosting::setBlogId (   $a_id)

Set blog object id.

Parameters
int$a_id

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

References ilPageObject\setParentId().

Referenced by read().

{
$this->setParentId($a_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPosting::setBlogNodeId (   $a_id,
  $a_is_in_workspace = false 
)

Set blog node id (needed for notification)

Parameters
int$a_id
bool$a_is_in_workspace

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

{
$this->blog_node_id = (int)$a_id;
$this->blog_node_is_wsp = (bool)$a_is_in_workspace;
}
ilBlogPosting::setCreated ( ilDateTime  $a_date)

Set creation date.

Parameters
ilDateTime$a_date

Definition at line 79 of file class.ilBlogPosting.php.

Referenced by read().

{
$this->created = $a_date;
}

+ Here is the caller graph for this function:

ilBlogPosting::setTitle (   $a_title)

Set title.

Parameters
string$a_title

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

Referenced by read().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilBlogPosting::update (   $a_validate = true,
  $a_no_history = false,
  $a_notify = true,
  $a_notify_action = "update" 
)

Update blog posting.

Parameters
bool$a_validate
bool$a_no_history
bool$a_notify
string$a_notify_action
Returns
boolean

Definition at line 179 of file class.ilBlogPosting.php.

References $ilDB, $query, ilPageObject\getActive(), getCreated(), ilPageObject\getId(), getTitle(), IL_CAL_DATETIME, isApproved(), and ilObjBlog\sendNotification().

Referenced by checkApproval().

{
global $ilDB;
// blog_id, author and created cannot be changed
$query = "UPDATE il_blog_posting SET".
" title = ".$ilDB->quote($this->getTitle(), "text").
",created = ".$ilDB->quote($this->getCreated()->get(IL_CAL_DATETIME), "text").
",approved =".$ilDB->quote($this->isApproved(), "integer").
" WHERE id = ".$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($query);
parent::update($a_validate, $a_no_history);
if($a_notify && $this->getActive())
{
include_once "Modules/Blog/classes/class.ilObjBlog.php";
ilObjBlog::sendNotification($a_notify_action, $this->blog_node_is_wsp, $this->blog_node_id, $this->getId());
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlogPosting::updateKeywords ( array  $keywords)

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

References $ilUser, and getMDSection().

{
global $ilUser;
// language is not "used" anywhere
$ulang = $ilUser->getLanguage();
$keywords = array($ulang=>$keywords);
include_once("./Services/MetaData/classes/class.ilMDKeyword.php");
}

+ Here is the call graph for this function:

Field Documentation

ilBlogPosting::$approved
protected

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

Referenced by isApproved().

ilBlogPosting::$author
protected

Definition at line 20 of file class.ilBlogPosting.php.

Referenced by getAuthor().

ilBlogPosting::$blog_node_id
protected

Definition at line 18 of file class.ilBlogPosting.php.

ilBlogPosting::$blog_node_is_wsp
protected

Definition at line 19 of file class.ilBlogPosting.php.

ilBlogPosting::$created
protected

Definition at line 17 of file class.ilBlogPosting.php.

Referenced by create(), and getCreated().

ilBlogPosting::$title
protected

Definition at line 16 of file class.ilBlogPosting.php.

Referenced by getTitle().


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