|
Moodle
2.2.1
http://www.collinsharper.com
|
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() | |
Definition at line 42 of file locallib.php.
| __construct | ( | $ | id = null, |
| $ | params = null, |
||
| $ | form = null |
||
| ) |
Constructor. If given an id, will fetch the corresponding record from the DB.
| mixed | $idorparams | A blog entry id if INT, or data for a new entry if array |
Definition at line 75 of file locallib.php.
| add | ( | ) |
Inserts this entry in the database. Access control checks must be done by calling code. TODO Set the publishstate correctly
| mform | $form | Used for attachments |
Definition at line 339 of file locallib.php.

| add_association | ( | $ | contextid, |
| $ | action = 'add' |
||
| ) |
add a single association for a blog entry
| int | contextid - id of context to associate with the blog entry |
Definition at line 435 of file locallib.php.


| add_associations | ( | $ | action = 'add' | ) |
function to add all context associations to an entry
| int | entry - data object processed to include all 'entry' fields and extra data from the edit_form object |
Definition at line 417 of file locallib.php.


| add_tags_info | ( | ) |
function to attach tags into an entry
Definition at line 543 of file locallib.php.


| 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.
| int | $userid | Optional. If not given, $USER is used |
Definition at line 568 of file locallib.php.

| 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
| int | $targetuserid | ID of the user we are checking |
Definition at line 597 of file locallib.php.

| delete | ( | ) |
Deletes this entry from the database. Access control checks must be done by calling code.
Definition at line 400 of file locallib.php.

Deletes all the user files in the attachments area for an entry
Definition at line 470 of file locallib.php.


| edit | ( | $ | params = array(), |
| $ | form = null, |
||
| $ | summaryoptions = array(), |
||
| $ | attachmentoptions = array() |
||
| ) |
Updates this entry in the database. Access control checks must be done by calling code.
| mform | $form | Used for attachments |
Definition at line 368 of file locallib.php.

| static get_applicable_publish_states | ( | ) | [static] |
Use this function to retrieve a list of publish states available for the currently logged in user.
Definition at line 651 of file locallib.php.

| 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
| bool | $return | Whether to return or print the generated code |
Definition at line 484 of file locallib.php.


| print_html | ( | $ | return = false | ) |
Prints or returns the HTML for this blog entry.
| bool | $return |
Commands
Definition at line 98 of file locallib.php.

| process_attachment | ( | $ | form | ) |
Inserts this entry in the database. Access control checks must be done by calling code.
| mform | $form | Used for attachments |
Definition at line 329 of file locallib.php.
remove all associations for a blog entry
Definition at line 460 of file locallib.php.

| $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.