Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
block_navigation

Namespaces

namespace  block_navigation\privacy
  
 

Classes

class  block_navigation
 The global navigation tree block class. More...
 
class  block_navigation\privacy\provider
 Privacy Subsystem for block_navigation implementing null_provider. More...
 
class  block_navigation_edit_form
 Form for editing global navigation instances. More...
 
class  block_navigation_renderer
 Renderer for block navigation. More...
 

Functions

 xmldb_block_navigation_upgrade ($oldversion, $block)
 As of the implementation of this block and the general navigation code in Moodle 2.0 the body of immediate upgrade work for this block and settings is done in core upgrade {.
 

Variables

 $capabilities
 
 $plugin = 2023041800
 
$plugin component = 'block_navigation'
 
$plugin version = 2023042400
 

Detailed Description

Function Documentation

◆ xmldb_block_navigation_upgrade()

xmldb_block_navigation_upgrade ( $oldversion,
$block )

As of the implementation of this block and the general navigation code in Moodle 2.0 the body of immediate upgrade work for this block and settings is done in core upgrade {.

See also
lib/db/upgrade.php}

There were several reasons that they were put there and not here, both becuase the process for the two blocks was very similar and because the upgrade process was complex due to us wanting to remvoe the outmoded blocks that this block was going to replace.

Parameters
int$oldversion
object$block

Variable Documentation

◆ $capabilities

$capabilities
Initial value:
= array(
'block/navigation:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/my:manageblocks'
),
'block/navigation:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:manageblocks'
),
)
const CONTEXT_SYSTEM
System context level - only one instance in every system.
Definition accesslib.php:122
const RISK_SPAM
Capability allows users to add content others may see - see
Definition accesslib.php:147
const CAP_ALLOW
Allow permission, overrides CAP_PREVENT defined in parent contexts.
Definition accesslib.php:115
const RISK_XSS
Capability allows user to add scripted content - see
Definition accesslib.php:143
const CONTEXT_BLOCK
Block context level - one instance for each block, sticky blocks are tricky because ppl think they sh...
Definition accesslib.php:136