|
Moodle
2.2.1
http://www.collinsharper.com
|

Definition at line 48 of file moodleblock.class.php.
| __construct | ( | ) |
Class Functions.
Fake constructor to keep PHP5 happy
Definition at line 117 of file moodleblock.class.php.
Definition at line 611 of file moodleblock.class.php.
| _load_instance | ( | $ | instance, |
| $ | page | ||
| ) |
Set up a particular instance of this class given data from the block_insances table and the current page. (See block_manager::load_blocks().)
| stdClass | $instance | data from block_insances, block_positions, etc. |
| moodle_page | $the | page this block is on. |
Definition at line 415 of file moodleblock.class.php.

| _print_block | ( | ) |
Definition at line 590 of file moodleblock.class.php.
| _print_shadow | ( | ) |
Definition at line 597 of file moodleblock.class.php.
| _self_test | ( | ) |
Tests if this block has been implemented correctly. Also, $errors isn't used right now
Definition at line 296 of file moodleblock.class.php.

| _title_html | ( | ) |
Definition at line 604 of file moodleblock.class.php.
Which page types this block may appear on.
The information returned here is processed by the blocks_name_allowed_in_format() function. Look there if you need to know exactly how this works.
Default case: everything except mod and tag.
Reimplemented in block_myprofile, block_course_overview, block_settings, block_navigation, block_activity_modules, block_admin_bookmarks, block_quiz_results, block_section_links, block_blog_menu, block_blog_tags, block_participants, block_comments, block_search_forums, block_blog_recent, block_private_files, block_rss_client, block_recent_activity, block_html, block_tags, block_feedback, block_mnet_hosts, block_tag_flickr, block_tag_youtube, block_mentees, block_login, block_site_main_menu, and block_social_activities.
Definition at line 364 of file moodleblock.class.php.

| before_delete | ( | ) |
Function that can be overridden to do extra cleanup before the database tables are deleted. (Called once per block, not per instance!)
Reimplemented in block_myprofile, and block_section_links.
Definition at line 125 of file moodleblock.class.php.
| static comment_add | ( | &$ | comments, |
| $ | options | ||
| ) | [static] |
Definition at line 662 of file moodleblock.class.php.
| static comment_display | ( | $ | comments, |
| $ | options | ||
| ) | [static] |
Definition at line 659 of file moodleblock.class.php.
| static comment_permissions | ( | $ | options | ) | [static] |
Definition at line 653 of file moodleblock.class.php.
| static comment_template | ( | $ | options | ) | [static] |
callback functions for comments api
Definition at line 643 of file moodleblock.class.php.
| static comment_url | ( | $ | options | ) | [static] |
Definition at line 656 of file moodleblock.class.php.
| config_print | ( | ) |
Definition at line 618 of file moodleblock.class.php.
| config_save | ( | $ | data | ) |
Default behavior: save all variables as $CFG properties You don't need to override this if you 're satisfied with the above
| array | $data |
Definition at line 346 of file moodleblock.class.php.

| formatted_contents | ( | $ | output | ) | [protected] |
Convert the contents of the block to HTML.
This is used by block base classes like block_list to convert the structured $this->content->list and $this->content->icons arrays to HTML. So, in most blocks, you probaby want to override the get_contents() method, which generates that structured representation of the contents.
| $output | The core_renderer to use when generating the output. |
Reimplemented in block_tree, and block_list.
Definition at line 279 of file moodleblock.class.php.


| get_content | ( | ) |
Parent class version of this function simply returns NULL This should be implemented by the derived class to return the content object.
Reimplemented in block_navigation, block_glossary_random, block_settings, block_quiz_results, block_admin_bookmarks, block_blog_tags, block_blog_menu, block_myprofile, block_community, block_rss_client, block_section_links, block_comments, block_blog_recent, block_html, block_private_files, block_course_overview, block_completionstatus, block_selfcompletion, block_tags, block_tag_youtube, block_tag_flickr, block_mentees, block_mnet_hosts, block_feedback, block_online_users, block_course_list, block_course_summary, block_calendar_month, block_login, block_site_main_menu, block_social_activities, block_recent_activity, block_activity_modules, block_calendar_upcoming, block_messages, block_news_items, block_participants, and block_search_forums.
Definition at line 152 of file moodleblock.class.php.

| get_content_for_output | ( | $ | output | ) |
Return a block_contents object representing the full contents of this block.
This internally calls ->get_content(), and then adds the editing controls etc.
You probably should not override this method, but instead override html_attributes(), formatted_contents() or get_content(), hide_header(), (get_edit_controls), etc.
Definition at line 223 of file moodleblock.class.php.

| get_content_type | ( | ) |
Returns the class $content_type var value.
Intentionally doesn't check if content_type is set. This is already done in _self_test()
Definition at line 178 of file moodleblock.class.php.

Definition at line 574 of file moodleblock.class.php.
Reimplemented in block_navigation, and block_settings.
Definition at line 425 of file moodleblock.class.php.


| get_title | ( | ) |
Returns the class $title var value.
Intentionally doesn't check if a title is set. This is already done in _self_test()
Definition at line 165 of file moodleblock.class.php.

| has_config | ( | ) |
Subclasses should override this and return true if the subclass block has a config_global.html file.
Reimplemented in block_myprofile, block_section_links, block_course_overview, block_rss_client, block_blog_menu, block_blog_tags, block_tags, block_online_users, block_course_list, and block_mnet_hosts.
Definition at line 335 of file moodleblock.class.php.
| hide_header | ( | ) |
Default return is false - header will be shown
Reimplemented in block_glossary_random, and block_course_summary.
Definition at line 374 of file moodleblock.class.php.

| html_attributes | ( | ) |
Return any HTML attributes that you want added to the outer
function html_attributes() { $attributes = parent::html_attributes(); $attributes['class'] .= ' mynewclass'; return $attributes; } Reimplemented in block_list, and block_navigation.
Definition at line 397 of file moodleblock.class.php.


Is each block of this type going to have instance-specific configuration? Normally, this setting is controlled by instance_allow_multiple(): if multiple instances are allowed, then each will surely need its own configuration. However, in some cases it may be necessary to provide instance configuration to blocks that do not want to allow multiple instances. In that case, make this function return true. I stress again that this makes a difference ONLY if instance_allow_multiple() returns false.
Reimplemented in block_myprofile, block_section_links, block_rss_client, block_settings, block_navigation, block_blog_menu, block_blog_tags, block_blog_recent, and block_tags.
Definition at line 450 of file moodleblock.class.php.

Are you going to allow multiple instances of each block? If yes, then it is assumed that the block WILL USE per-instance configuration
Reimplemented in block_quiz_results, block_myprofile, block_rss_client, block_glossary_random, block_navigation, block_settings, block_admin_bookmarks, block_comments, block_html, block_private_files, block_blog_menu, block_blog_tags, block_tag_youtube, block_tag_flickr, block_mentees, and block_tags.
Definition at line 459 of file moodleblock.class.php.

Can be overridden by the block to prevent the block from being dockable.
Reimplemented in block_html, block_navigation, and block_settings.
Definition at line 627 of file moodleblock.class.php.

If overridden and set to true by the block it will not be hidable when editing is turned on.
Reimplemented in block_navigation, and block_settings.
Definition at line 638 of file moodleblock.class.php.
| instance_config_commit | ( | $ | nolongerused = false | ) |
Replace the instance's configuration data with those currently in $this->config;
Definition at line 503 of file moodleblock.class.php.


Default behavior: print the config_instance.html file You don't need to override this if you're satisfied with the above
Reimplemented in block_myprofile.
Definition at line 472 of file moodleblock.class.php.

| instance_config_save | ( | $ | data, |
| $ | nolongerused = false |
||
| ) |
Serialize and store config data
Reimplemented in block_html.
Definition at line 494 of file moodleblock.class.php.

| instance_create | ( | ) |
Do any additional initialization you may need at the time a new block instance is created
Definition at line 512 of file moodleblock.class.php.
| instance_delete | ( | ) |
Delete everything related to this instance if you have been using persistent storage other than the configdata field.
Reimplemented in block_html.
Definition at line 520 of file moodleblock.class.php.
| is_empty | ( | ) |
Returns true or false, depending on whether this block has any content to display and whether the user has permission to view the block
Reimplemented in block_list.
Definition at line 189 of file moodleblock.class.php.


| name | ( | ) |
Returns the block name, as present in the class name, the database, the block directory, etc etc.
Definition at line 134 of file moodleblock.class.php.

| preferred_width | ( | ) |
Default case: the block wants to be 180 pixels wide
Reimplemented in block_course_summary, block_rss_client, block_tag_youtube, block_tag_flickr, and block_calendar_month.
Definition at line 585 of file moodleblock.class.php.

| refresh_content | ( | ) |
First sets the current value of $this->content to NULL then calls the block's get_content() function to set its value back.
Definition at line 205 of file moodleblock.class.php.

| specialization | ( | ) |
This function is called on your subclass right after an instance is loaded Use this function to act on instance data just after it's loaded and before anything else is done For instance: if your block will have different title's depending on location (site, course, blog, etc)
Reimplemented in block_myprofile, block_blog_tags, block_rss_client, block_comments, block_html, block_private_files, block_tags, block_tag_flickr, block_tag_youtube, block_mentees, block_glossary_random, and block_course_summary.
Definition at line 437 of file moodleblock.class.php.

| user_can_addto | ( | $ | page | ) |
Allows the block class to have a say in the user's ability to create new instances of this block. The framework has first say in whether this will be allowed (e.g., no adding allowed unless in edit mode) but if the framework does allow it, the block can still decide to refuse. This function has access to the complete page object, the creation related to which is being determined.
| moodle_page | $page |
Reimplemented in block_community.
Definition at line 557 of file moodleblock.class.php.

| user_can_edit | ( | ) |
Allows the block class to have a say in the user's ability to edit (i.e., configure) blocks of this type. The framework has first say in whether this will be allowed (e.g., no editing allowed unless in edit mode) but if the framework does allow it, the block can still decide to refuse.
Reimplemented in block_community.
Definition at line 530 of file moodleblock.class.php.

| stdObject $config = NULL |
An object containing the instance configuration information for the current instance of this block.
Definition at line 102 of file moodleblock.class.php.
| stdObject $content = NULL |
An object to contain the information to be displayed in the block.
Definition at line 72 of file moodleblock.class.php.
| int $content_type = BLOCK_TYPE_TEXT |
The type of content that this block creates. Currently support options - BLOCK_TYPE_LIST, BLOCK_TYPE_TEXT
Reimplemented in block_tree, and block_list.
Definition at line 66 of file moodleblock.class.php.
| $context = NULL |
Definition at line 96 of file moodleblock.class.php.
| int $cron = NULL |
How often the cronjob should run, 0 if not at all.
Definition at line 109 of file moodleblock.class.php.
| string $edit_controls = NULL |
A string generated by _add_edit_controls() to display block manipulation links when the user is in editing mode.
Definition at line 78 of file moodleblock.class.php.
| block $instance = NULL |
The initialized instance of this block object.
Definition at line 84 of file moodleblock.class.php.
| $page = NULL |
Definition at line 90 of file moodleblock.class.php.
| string $str |
Internal var for storing/caching translated strings
Definition at line 54 of file moodleblock.class.php.
| string $title = NULL |
The title of the block to be displayed in the block title area.
Definition at line 60 of file moodleblock.class.php.