Moodle  2.2.1
http://www.collinsharper.com
blog_entry Class Reference

Public Member Functions

 __construct ($id=null, $params=null, $form=null)
 print_html ($return=false)
 process_attachment ($form)
 add ()
 edit ($params=array(), $form=null, $summaryoptions=array(), $attachmentoptions=array())
 delete ()
 add_associations ($action='add')
 add_association ($contextid, $action='add')
 remove_associations ()
 delete_attachments ()
 print_attachments ($return=false)
 add_tags_info ()
 can_user_edit ($userid=null)
 can_user_view ($targetuserid)

Static Public Member Functions

static get_applicable_publish_states ()

Data Fields

 $id
 $userid
 $subject
 $summary
 $rating = 0
 $attachment
 $publishstate
 $courseid = 0
 $groupid = 0
 $module = 'blog'
 $moduleid = 0
 $coursemoduleid = 0
 $content
 $format = 1
 $uniquehash = ''
 $lastmodified
 $created
 $usermodified
 $form
 $tags = array()

Detailed Description

Definition at line 42 of file locallib.php.


Constructor & Destructor Documentation

__construct ( id = null,
params = null,
form = null 
)

Constructor. If given an id, will fetch the corresponding record from the DB.

Parameters:
mixed$idorparamsA blog entry id if INT, or data for a new entry if array

Definition at line 75 of file locallib.php.


Member Function Documentation

add ( )

Inserts this entry in the database. Access control checks must be done by calling code. TODO Set the publishstate correctly

Parameters:
mform$formUsed for attachments
Returns:
void

Definition at line 339 of file locallib.php.

Here is the call graph for this function:

add_association ( contextid,
action = 'add' 
)

add a single association for a blog entry

Parameters:
intcontextid - id of context to associate with the blog entry

Definition at line 435 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

add_associations ( action = 'add')

function to add all context associations to an entry

Parameters:
intentry - data object processed to include all 'entry' fields and extra data from the edit_form object

Definition at line 417 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

function to attach tags into an entry

Returns:
void

Definition at line 543 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

can_user_edit ( userid = null)

User can edit a blog entry if this is their own blog entry and they have the capability moodle/blog:create, or if they have the capability moodle/blog:manageentries. This also applies to deleting of entries.

Parameters:
int$useridOptional. If not given, $USER is used
Returns:
boolean

Definition at line 568 of file locallib.php.

Here is the call graph for this function:

can_user_view ( targetuserid)

Checks to see if a user can view the blogs of another user. Only blog level is checked here, the capabilities are enforced in blog/index.php

Parameters:
int$targetuseridID of the user we are checking
Returns:
bool

Definition at line 597 of file locallib.php.

Here is the call graph for this function:

delete ( )

Deletes this entry from the database. Access control checks must be done by calling code.

Returns:
void

Definition at line 400 of file locallib.php.

Here is the call graph for this function:

Deletes all the user files in the attachments area for an entry

Returns:
void

Definition at line 470 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

edit ( params = array(),
form = null,
summaryoptions = array(),
attachmentoptions = array() 
)

Updates this entry in the database. Access control checks must be done by calling code.

Parameters:
mform$formUsed for attachments
Returns:
void

Definition at line 368 of file locallib.php.

Here is the call graph for this function:

static get_applicable_publish_states ( ) [static]

Use this function to retrieve a list of publish states available for the currently logged in user.

Returns:
array This function returns an array ideal for sending to moodles' choose_from_menu function.

Definition at line 651 of file locallib.php.

Here is the caller graph for this function:

print_attachments ( return = false)

if return=html, then return a html string. if return=text, then return a text-only string. otherwise, print HTML for non-images, and return image HTML

Parameters:
bool$returnWhether to return or print the generated code
Returns:
void

Definition at line 484 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_html ( return = false)

Prints or returns the HTML for this blog entry.

Parameters:
bool$return
Returns:
string

Commands

Definition at line 98 of file locallib.php.

Here is the call graph for this function:

process_attachment ( form)

Inserts this entry in the database. Access control checks must be done by calling code.

Parameters:
mform$formUsed for attachments
Returns:
void

Definition at line 329 of file locallib.php.

remove all associations for a blog entry

Returns:
voic

Definition at line 460 of file locallib.php.

Here is the caller graph for this function:


Field Documentation

$attachment

Definition at line 49 of file locallib.php.

$content

Definition at line 58 of file locallib.php.

$courseid = 0

Definition at line 53 of file locallib.php.

$coursemoduleid = 0

Definition at line 57 of file locallib.php.

$created

Definition at line 62 of file locallib.php.

$form

Definition at line 66 of file locallib.php.

$format = 1

Definition at line 59 of file locallib.php.

$groupid = 0

Definition at line 54 of file locallib.php.

$id

Definition at line 44 of file locallib.php.

$lastmodified

Definition at line 61 of file locallib.php.

$module = 'blog'

Definition at line 55 of file locallib.php.

$moduleid = 0

Definition at line 56 of file locallib.php.

$publishstate

Definition at line 50 of file locallib.php.

$rating = 0

Definition at line 48 of file locallib.php.

$subject

Definition at line 46 of file locallib.php.

Definition at line 47 of file locallib.php.

$tags = array()

Definition at line 67 of file locallib.php.

$uniquehash = ''

Definition at line 60 of file locallib.php.

Definition at line 45 of file locallib.php.

$usermodified

Definition at line 63 of file locallib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations