|
| | _load_instance ($instance, $page) |
| | Set up a particular instance of this class given data from the block_insances table and the current page.
|
| |
| | _self_test () |
| | Tests if this block has been implemented correctly.
|
| |
|
| after_install () |
| | post install configurations
|
| |
| | applicable_formats () |
| | locations where block can be displayed
|
| |
| | before_delete () |
| | post delete configurations
|
| |
| | can_block_be_added (moodle_page $page) |
| | This method can be overriden to add some extra checks to decide whether the block can be added or not to a page.
|
| |
| | get_aria_role () |
| | Returns the aria role attribute that best describes this block.
|
| |
| | get_config_for_external () |
| | Return the plugin config settings for external functions.
|
| |
| | get_content () |
| | block contents
|
| |
| | get_content_for_external ($output) |
| | Return an object containing all the block content to be returned by external functions.
|
| |
| | get_content_for_output ($output) |
| | Return a block_contents object representing the full contents of this block.
|
| |
| | get_content_type () |
| | Returns the class $content_type var value.
|
| |
| | get_required_javascript () |
| | Allows the block to load any JS it requires into the page.
|
| |
| | get_title () |
| | Returns the class $title var value.
|
| |
| | has_config () |
| | allow the block to have a configuration page
|
| |
| | hide_header () |
| | Default return is false - header will be shown.
|
| |
| | html_attributes () |
| | Return any HTML attributes that you want added to the outer.
|
| |
|
| init () |
| | block initializations
|
| |
| | instance_allow_config () |
| | allow instances to have their own configuration
|
| |
| | instance_allow_multiple () |
| | allow more than one instance of the block on a page
|
| |
| | instance_can_be_collapsed () |
| | If overridden and set to false by the block it will not be collapsible.
|
| |
| | instance_can_be_docked () |
| | Can be overridden by the block to prevent the block from being dockable.
|
| |
| | instance_can_be_edited () |
| | If overridden and set to false by the block it will not be editable.
|
| |
| | instance_can_be_hidden () |
| | If overridden and set to false by the block it will not be hidable when editing is turned on.
|
| |
| | instance_config_commit ($nolongerused=false) |
| | Replace the instance's configuration data with those currently in $this->config;.
|
| |
| | instance_config_save ($data, $nolongerused=false) |
| | Serialize and store config data.
|
| |
| | instance_copy ($fromid) |
| | Copy any block-specific data when copying to a new block instance.
|
| |
| | instance_create () |
| | Do any additional initialization you may need at the time a new block instance is created.
|
| |
| | instance_delete () |
| | Delete everything related to this instance if you have been using persistent storage other than the configdata field.
|
| |
| | 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.
|
| |
| | name () |
| | Returns the block name, as present in the class name, the database, the block directory, etc etc.
|
| |
| | 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.
|
| |
| | specialization () |
| | instance specialisations (must have instance allow config true)
|
| |
| | user_can_addto ($page) |
| | Allows the block class to have a say in the user's ability to create new instances of this block.
|
| |
| | 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.
|
| |
|
| string | $arialabel = NULL |
| | The name of the block to be displayed in the block title area if the title is empty.
|
| |
| stdClass | $config = NULL |
| | An object containing the instance configuration information for the current instance of this block.
|
| |
| stdClass null | $content = NULL |
| | An object to contain the information to be displayed in the block.
|
| |
| int | $content_type = BLOCK_TYPE_TEXT |
| | The type of content that this block creates.
|
| |
|
context | $context = NULL |
| | This block's context.
|
| |
| int | $cron = NULL |
| | How often the cronjob should run, 0 if not at all.
|
| |
| stdClass | $instance = NULL |
| | The initialized instance of this block object.
|
| |
|
moodle_page | $page = NULL |
| | The page that this block is appearing on.
|
| |
|
string | $str |
| | Internal var for storing/caching translated strings $str.
|
| |
| string | $title = NULL |
| | The title of the block to be displayed in the block title area.
|
| |
Displays the current user's profile information.
- Copyright
- 2010 Remote-Learner.net
- Author
- Olav Jordan olav..nosp@m.jord.nosp@m.an@re.nosp@m.mote.nosp@m.-lear.nosp@m.ner..nosp@m.ca
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
This method can be overriden to add some extra checks to decide whether the block can be added or not to a page.
It doesn't need to do the standard capability checks as they will be performed by has_add_block_capability(). This method is user agnostic. If you want to check if a user can add a block or not, you should use user_can_addto().
- Parameters
-
| moodle_page | $page | The page where this block will be added. |
- Return values
-
| bool | Whether the block can be added or not to the given page. |
Reimplemented in block_accessreview, block_badges, block_blog_menu, block_blog_recent, block_blog_tags, block_comments, block_completionstatus, block_globalsearch, block_glossary_random, block_lp, and block_tags.
| block_base::formatted_contents |
( |
| $output | ) |
|
|
protectedinherited |
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.
- Parameters
-
| $output | The core_renderer to use when generating the output. |
- Return values
-
| string | the HTML that should appearn in the body of the block. |
- Since
- Moodle 2.0.
Reimplemented in block_list, and block_tree.
| block_base::get_aria_role |
( |
| ) |
|
|
inherited |
Returns the aria role attribute that best describes this block.
Region is the default, but this should be overridden by a block is there is a region child, or even better a landmark child.
Options are as follows:
Please do not use top-level landmark roles such as 'banner', 'complementary', 'contentinfo', or 'main'. Read more at ARIA Authoring Practices Guide - Landmark Regions
- Return values
-
Reimplemented in block_activity_modules, block_admin_bookmarks, block_blog_menu, block_course_list, block_navigation, block_search_forums, and block_settings.
| block_base::html_attributes |
( |
| ) |
|
|
inherited |
Return any HTML attributes that you want added to the outer.
that of the block when it is output.
Because of the way certain JS events are wired it is a good idea to ensure that the default values here still get set. I found the easiest way to do this and still set anything you want is to override it within your block in the following way
function html_attributes() { $attributes = parent::html_attributes(); $attributes['class'] .= ' mynewclass'; return $attributes; }
- Return values
-
| array | attribute name => value. |
Reimplemented in block_html, block_list, and block_navigation.