Moodle  2.2.1
http://www.collinsharper.com
question_edit_contexts Class Reference

Public Member Functions

 __construct (context $thiscontext)
 all ()
 lowest ()
 having_cap ($cap)
 having_one_cap ($caps)
 having_one_edit_tab_cap ($tabname)
 have_cap ($cap)
 have_one_cap ($caps)
 have_one_edit_tab_cap ($tabname)
 require_cap ($cap)
 require_one_cap ($caps)
 require_one_edit_tab_cap ($tabname)

Static Public Attributes

static $caps

Protected Attributes

 $allcontexts

Detailed Description

Tracks all the contexts related to the one where we are currently editing questions, and provides helper methods to check permissions.

Definition at line 1492 of file questionlib.php.


Constructor & Destructor Documentation

__construct ( context thiscontext)

Constructor

Parameters:
contextthe current context.

Definition at line 1521 of file questionlib.php.

Here is the call graph for this function:


Member Function Documentation

all ( )
Returns:
array all parent contexts

Definition at line 1528 of file questionlib.php.

have_cap ( cap)

Has at least one parent context got the cap $cap?

Parameters:
string$capcapability
Returns:
boolean

Definition at line 1584 of file questionlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

have_one_cap ( caps)

Has at least one parent context got one of the caps $caps?

Parameters:
array$capscapability
Returns:
boolean

Definition at line 1594 of file questionlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

have_one_edit_tab_cap ( tabname)

Has at least one parent context got one of the caps for actions on $tabname

Parameters:
string$tabnameedit tab name
Returns:
boolean

Definition at line 1609 of file questionlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

having_cap ( cap)
Parameters:
string$capcapability
Returns:
array parent contexts having capability, zero based index

Definition at line 1543 of file questionlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

having_one_cap ( caps)
Parameters:
array$capscapabilities
Returns:
array parent contexts having at least one of $caps, zero based index

Definition at line 1557 of file questionlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

having_one_edit_tab_cap ( tabname)
Parameters:
string$tabnameedit tab name
Returns:
array parent contexts having at least one of $caps, zero based index

Definition at line 1574 of file questionlib.php.

Here is the call graph for this function:

lowest ( )
Returns:
object lowest context which must be either the module or course context

Definition at line 1535 of file questionlib.php.

require_cap ( cap)

Throw error if at least one parent context hasn't got the cap $cap

Parameters:
string$capcapability

Definition at line 1618 of file questionlib.php.

Here is the call graph for this function:

require_one_cap ( caps)

Throw error if at least one parent context hasn't got one of the caps $caps

Parameters:
array$capcapabilities

Definition at line 1629 of file questionlib.php.

Here is the call graph for this function:

require_one_edit_tab_cap ( tabname)

Throw error if at least one parent context hasn't got one of the caps $caps

Parameters:
string$tabnameedit tab name

Definition at line 1641 of file questionlib.php.

Here is the call graph for this function:


Field Documentation

$allcontexts [protected]

Definition at line 1515 of file questionlib.php.

$caps [static]
Initial value:
 array(
        'editq' => array('moodle/question:add',
            'moodle/question:editmine',
            'moodle/question:editall',
            'moodle/question:viewmine',
            'moodle/question:viewall',
            'moodle/question:usemine',
            'moodle/question:useall',
            'moodle/question:movemine',
            'moodle/question:moveall'),
        'questions'=>array('moodle/question:add',
            'moodle/question:editmine',
            'moodle/question:editall',
            'moodle/question:viewmine',
            'moodle/question:viewall',
            'moodle/question:movemine',
            'moodle/question:moveall'),
        'categories'=>array('moodle/question:managecategory'),
        'import'=>array('moodle/question:add'),
        'export'=>array('moodle/question:viewall', 'moodle/question:viewmine'))

Definition at line 1494 of file questionlib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations