Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
core_blog

Namespaces

namespace  core_blog
  
 
namespace  core_blog\external
  
 
namespace  core_blog\privacy
  
 
namespace  core_blog\reportbuilder\datasource
  
 
namespace  core_blog\reportbuilder\local\entities
  
 

Classes

class  behat_core_blog_generator
 Behat data generator for core_blog. More...
 
class  core_blog\external
 This is the external API for blogs. More...
 
class  core_blog\external\post_exporter
 Class for exporting a blog post (entry). More...
 
class  core_blog\privacy\provider
 Data provider class. More...
 
class  core_blog\reportbuilder\datasource\blogs
 
class  core_blog\reportbuilder\local\entities\blog
 
class  core_blog_generator
 Blog module test data generator class. More...
 
class  core_blog_renderer
 Blog renderer. More...
 

Functions

 blog_comment_permissions ($commentparam)
 Running addtional permission check on plugin, for example, plugins may have switch to turn on/off comments option, this callback will affect UI display, not like pluginname_comment_validate only throw exceptions.
 
 blog_comment_validate ($commentparam)
 Validate comment parameter before perform other comments actions.
 
 blog_rss_add_http_header ($context, $title, $filtertype, $filterselect=0, $tagid=0)
 Build the URL for the RSS feed amd add it as a header.
 
 blog_rss_delete_file ($userid)
 Delete the supplied user's cached blog post RSS feed.
 
 blog_rss_file_name ($type, $id, $tagid=0)
 Retrieve the location and file name of a cached RSS feed.
 
 blog_rss_get_feed ($context, $args)
 Generate any blog RSS feed via one function.
 
 blog_rss_get_params ($filters)
 Utility function to extract parameters needed to generate RSS URLs from the blog filters.
 
 blog_rss_get_url ($contextid, $userid, $filtertype, $filterselect=0, $tagid=0)
 Build the URL for the RSS feed.
 
 blog_rss_print_link ($context, $filtertype, $filterselect=0, $tagid=0, $tooltiptext='')
 Print the link for the RSS feed with the correct RSS icon (Theme based)
 
 blog_rss_save_file ($type, $id, $tagid=0, $contents='')
 This function saves to file the rss feed specified in the parameters.
 

Detailed Description

Function Documentation

◆ blog_comment_permissions()

blog_comment_permissions ( $commentparam)

Running addtional permission check on plugin, for example, plugins may have switch to turn on/off comments option, this callback will affect UI display, not like pluginname_comment_validate only throw exceptions.

blog_comment_validate will be called before viewing/adding/deleting comment, so don't repeat checks. Capability check has been done in comment->check_permissions(), we don't need to do it again here.

Parameters
stdClass$commentparam{ context => context the context object courseid => int course id cm => stdClass course module object commentarea => string comment area itemid => int itemid }
Return values
array

◆ blog_comment_validate()

blog_comment_validate ( $commentparam)

Validate comment parameter before perform other comments actions.

Parameters
stdClass$comment{ context => context the context object courseid => int course id cm => stdClass course module object commentarea => string comment area itemid => int itemid }
Return values
boolean

◆ blog_rss_add_http_header()

blog_rss_add_http_header ( $context,
$title,
$filtertype,
$filterselect = 0,
$tagid = 0 )

Build the URL for the RSS feed amd add it as a header.

Parameters
stdClass$contextThe context under which the URL should be created
string$titleName for the link to be added to the page header
string$filtertypeThe source of the RSS feed (site/course/group/user)
int$filterselectThe id of the item defined by $filtertype
int$tagidThe id of the row in the tag table that identifies the RSS Feed

◆ blog_rss_delete_file()

blog_rss_delete_file ( $userid)

Delete the supplied user's cached blog post RSS feed.

Only user blogs are available by RSS. This doesn't call rss_delete_file() as blog RSS caching uses it's own file structure.

Parameters
int$userid

◆ blog_rss_file_name()

blog_rss_file_name ( $type,
$id,
$tagid = 0 )

Retrieve the location and file name of a cached RSS feed.

Parameters
string$typeThe source of the RSS feed (site/course/group/user)
int$idThe id of the item defined by $type
int$tagidThe id of the row in the tag table that identifies the RSS Feed
Return values
string

◆ blog_rss_get_feed()

blog_rss_get_feed ( $context,
$args )

Generate any blog RSS feed via one function.

Parameters
stdClass$contextThe context of the blog for which the feed it being generated
array$argsAn array of arguements needed to build the feed (contextid, token, componentname, type, id, tagid)

◆ blog_rss_get_params()

blog_rss_get_params ( $filters)

Utility function to extract parameters needed to generate RSS URLs from the blog filters.

Parameters
array$filtersfilters for the blog
Return values
arrayarray containing the id of the user/course/group, the relevant context and the filter type: site/user/course/group

◆ blog_rss_get_url()

blog_rss_get_url ( $contextid,
$userid,
$filtertype,
$filterselect = 0,
$tagid = 0 )

Build the URL for the RSS feed.

Parameters
int$contextidThe context under which the URL should be created
int$useridThe id of the user requesting the RSS Feed
string$filtertypeThe source of the RSS feed (site/course/group/user)
int$filterselectThe id of the item defined by $filtertype
int$tagidThe id of the row in the tag table that identifies the RSS Feed
Return values
string

◆ blog_rss_print_link()

blog_rss_print_link ( $context,
$filtertype,
$filterselect = 0,
$tagid = 0,
$tooltiptext = '' )

Print the link for the RSS feed with the correct RSS icon (Theme based)

Parameters
stdClass$contextThe context under which the URL should be created
string$filtertypeThe source of the RSS feed (site/course/group/user)
int$filterselectThe id of the item defined by $filtertype
int$tagidThe id of the row in the tag table that identifies the RSS Feed
string$tooltiptextThe tooltip to be displayed with the link

◆ blog_rss_save_file()

blog_rss_save_file ( $type,
$id,
$tagid = 0,
$contents = '' )

This function saves to file the rss feed specified in the parameters.

Parameters
string$typeThe source of the RSS feed (site/course/group/user)
int$idThe id of the item defined by $type
int$tagidThe id of the row in the tag table that identifies the RSS Feed
string$contentsThe contents of the RSS Feed file
Return values
boolwhether the save was successful or not