[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/blog/ -> lib.php (summary)

Library of functions and constants for blog

File Size: 705 lines (25 kb)
Included or required: 1 time
Referenced: 7 times
Includes or requires: 0 files

Defines 15 functions

  blog_check_and_install_blocks()
  blog_isediting()
  blog_print_html_formatted_entries()
  blog_print_entry()
  blog_file_area_name()
  blog_file_area()
  blog_delete_old_attachments()
  blog_print_attachments()
  blog_applicable_publish_states()
  blog_user_can_edit_post()
  blog_user_can_view_user_post()
  blog_fetch_entries()
  get_viewable_entry_count()
  get_baseurl()
  blog_get_participants()

Functions
Functions that are not part of a class:

blog_check_and_install_blocks()   X-Ref
Checks to see if user has visited blogpages before, if not, install 2
default blocks (blog_menu and blog_tags).


blog_isediting()   X-Ref
Adaptation of isediting in moodlelib.php for blog module

return: bool

blog_print_html_formatted_entries($postid, $filtertype, $filterselect, $tagid, $tag)   X-Ref
This function is in lib and not in BlogInfo because entries being searched
might be found in any number of blogs rather than just one.

$@param ...

blog_print_entry($blogEntry, $viewtype='full', $filtertype='', $filterselect='', $mode='loud')   X-Ref
This function is in lib and not in BlogInfo because entries being searched
might be found in any number of blogs rather than just one.

This function builds an array which can be used by the included
template file, making predefined and nicely formatted variables available
to the template. Template creators will not need to become intimate
with the internal objects and vars of moodle blog nor will they need to worry
about properly formatting their data

param: BlogEntry blogEntry - a hopefully fully populated BlogEntry object
param: string viewtype Default is 'full'. If 'full' then display this blog entry

blog_file_area_name($blogentry)   X-Ref
No description

blog_file_area($blogentry)   X-Ref
No description

blog_delete_old_attachments($post, $exception="")   X-Ref
No description

blog_print_attachments($blogentry, $return=NULL)   X-Ref
No description

blog_applicable_publish_states($courseid='')   X-Ref
Use this function to retrieve a list of publish states available for
the currently logged in user.

return: array This function returns an array ideal for sending to moodles'

blog_user_can_edit_post($blogEntry)   X-Ref
User can edit a blog entry if this is their own blog post and they have
the capability moodle/blog:create, or if they have the capability
moodle/blog:manageentries.

This also applies to deleting of posts.

blog_user_can_view_user_post($targetuserid, $blogEntry=null)   X-Ref
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


blog_fetch_entries($postid='', $fetchlimit=10, $fetchstart='', $filtertype='', $filterselect='', $tagid='', $tag ='', $sort='lastmodified DESC', $limit=true)   X-Ref
Main filter function.


get_viewable_entry_count($postid='', $fetchlimit=10,$fetchstart='', $filtertype='', $filterselect='', $tagid='',$tag ='', $sort='lastmodified DESC')   X-Ref
get the count of viewable entries, easiest way is to count blog_fetch_entries
this is used for print_paging_bar
this is not ideal, but because of the UNION in the sql in blog_fetch_entries,
it is hard to use count_records_sql


get_baseurl($filtertype, $filterselect)   X-Ref
No description

blog_get_participants()   X-Ref
Returns a list of all user ids who have used blogs in the site
Used in backup of site courses.




Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7