Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Classes | Functions | Variables
blocklib.php File Reference

Block Class and Functions. More...

Classes

class  block_manager
 This class keeps track of the block that should appear on a moodle_page. More...
 
class  block_not_on_page_exception
 Exception thrown when someone tried to do something with a block that does not exist on a page. More...
 

Functions

 block_add_block_ui ($page, $output)
 Functions update the blocks if required by the request parameters ==========. More...
 
 block_instance ($blockname, $instance=NULL, $page=NULL)
 Creates a new instance of the specified block class. More...
 
 block_instance_by_id ($blockinstanceid)
 Returns a new instance of the specified block instance id. More...
 
 block_load_class ($blockname)
 Load the block class for a particular type of block. More...
 
 block_method_result ($blockname, $method, $param=NULL)
 Helper functions for working with block classes ============================. More...
 
 blocks_add_default_course_blocks ($course)
 Add the default blocks to a course. More...
 
 blocks_add_default_system_blocks ()
 Add the default system-context blocks. More...
 
 blocks_delete_all_for_context ($contextid)
 Delete all the blocks that belong to a particular context. More...
 
 blocks_delete_instance ($instance, $nolongerused=false, $skipblockstables=false)
 Delete a block, and associated data. More...
 
 blocks_delete_instances ($instanceids)
 Delete multiple blocks at once. More...
 
 blocks_find_block ($blockid, $blocksarray)
 Find a given block by its blockid within a provide array. More...
 
 blocks_get_default_site_course_blocks ()
 
 blocks_get_record ($blockid=NULL, $notusedanymore=false)
 Get the block record for a particular blockid - that is, a particular type os block. More...
 
 blocks_name_allowed_in_format ($name, $pageformat)
 Check that a given name is in a permittable format. More...
 
 blocks_parse_default_blocks_list ($blocksstr)
 Parse a list of default blocks. More...
 
 blocks_remove_inappropriate ($course)
 Actually delete from the database any blocks that are currently on this page, but which should not be there according to blocks_name_allowed_in_format. More...
 
 blocks_set_visibility ($instance, $page, $newvisibility)
 Set a block to be visible or hidden on a particular page. More...
 
 default_page_type_list ($pagetype, $parentcontext=null, $currentcontext=null)
 Generates a default page type list when a more appropriate callback cannot be decided upon. More...
 
 generate_page_type_patterns ($pagetype, $parentcontext=null, $currentcontext=null)
 Given a specific page type, parent context and currect context, return all the page type patterns that might be used by this block. More...
 
 matching_page_type_patterns ($pagetype)
 Given a specific page type, return all the page type patterns that might match it. More...
 
 matching_page_type_patterns_from_pattern ($pattern)
 Give an specific pattern, return all the page type patterns that would also match it. More...
 
 mod_page_type_list ($pagetype, $parentcontext=null, $currentcontext=null)
 Generates the page type list for a module by either locating and using the modules callback or by generating a default list. More...
 
 my_page_type_list ($pagetype, $parentcontext=null, $currentcontext=null)
 Generates the page type list for the my moodle page. More...
 

Variables

const BLOCK_ADDBLOCK_POSITION_CUSTOM -1
 
const BLOCK_ADDBLOCK_POSITION_DEFAULT 0
 
const BLOCK_ADDBLOCK_POSITION_FLATNAV 1
 
const BLOCK_POS_LEFT 'side-pre'
 #+ Default names for the block regions in the standard theme.
 
const BLOCK_POS_RIGHT 'side-post'
 
const BUI_CONTEXTS_CURRENT 0
 
const BUI_CONTEXTS_CURRENT_SUBS 1
 
const BUI_CONTEXTS_ENTIRE_SITE 2
 
const BUI_CONTEXTS_FRONTPAGE_ONLY 0
 #-
 
const BUI_CONTEXTS_FRONTPAGE_SUBS 1
 

Detailed Description

Block Class and Functions.

This file defines the block_manager class,

@subpackage block

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later