Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Public Member Functions | |
__construct (\context $thiscontext) | |
Constructor. | |
all () | |
Get all the contexts. | |
have_cap ($cap) | |
Has at least one parent context got the cap $cap? | |
have_one_cap ($caps) | |
Has at least one parent context got one of the caps $caps? | |
have_one_edit_tab_cap ($tabname) | |
Has at least one parent context got one of the caps for actions on $tabname. | |
having_add_and_use () | |
Contexts for adding question and also using it. | |
having_cap ($cap) | |
Get the contexts having cap. | |
having_one_cap ($caps) | |
Get the contexts having at least one cap. | |
having_one_edit_tab_cap ($tabname) | |
Context having at least one cap. | |
lowest () | |
Get the lowest context. | |
require_cap ($cap) | |
Throw error if at least one parent context hasn't got the cap $cap. | |
require_one_cap ($caps) | |
Throw error if at least one parent context hasn't got one of the caps $caps. | |
require_one_edit_tab_cap ($tabname) | |
Throw error if at least one parent context hasn't got one of the caps $caps. | |
Static Public Attributes | |
static string[][] | $caps |
array of the capabilities. | |
Protected Attributes | |
array | $allcontexts |
of contexts. | |
core_question\local\bank\question_edit_contexts::__construct | ( | \context | $thiscontext | ) |
Constructor.
context | $thiscontext | the current context. |
core_question\local\bank\question_edit_contexts::all | ( | ) |
Get all the contexts.
context[] | all parent contexts |
core_question\local\bank\question_edit_contexts::have_cap | ( | $cap | ) |
Has at least one parent context got the cap $cap?
string | $cap | capability |
boolean |
core_question\local\bank\question_edit_contexts::have_one_cap | ( | $caps | ) |
Has at least one parent context got one of the caps $caps?
array | $caps | capability |
boolean |
core_question\local\bank\question_edit_contexts::have_one_edit_tab_cap | ( | $tabname | ) |
Has at least one parent context got one of the caps for actions on $tabname.
string | $tabname | edit tab name |
boolean |
core_question\local\bank\question_edit_contexts::having_add_and_use | ( | ) |
Contexts for adding question and also using it.
context[] | those contexts where a user can add a question and then use it. |
core_question\local\bank\question_edit_contexts::having_cap | ( | $cap | ) |
Get the contexts having cap.
string | $cap | capability |
context[] | parent contexts having capability, zero based index |
core_question\local\bank\question_edit_contexts::having_one_cap | ( | $caps | ) |
Get the contexts having at least one cap.
array | $caps | capabilities |
context[] | parent contexts having at least one of $caps, zero based index |
core_question\local\bank\question_edit_contexts::having_one_edit_tab_cap | ( | $tabname | ) |
Context having at least one cap.
string | $tabname | edit tab name |
context[] | parent contexts having at least one of $caps, zero based index |
core_question\local\bank\question_edit_contexts::lowest | ( | ) |
Get the lowest context.
context | lowest context which must be either the module or course context |
core_question\local\bank\question_edit_contexts::require_cap | ( | $cap | ) |
Throw error if at least one parent context hasn't got the cap $cap.
string | $cap | capability |
core_question\local\bank\question_edit_contexts::require_one_cap | ( | $caps | ) |
Throw error if at least one parent context hasn't got one of the caps $caps.
array | $caps | capabilities |
core_question\local\bank\question_edit_contexts::require_one_edit_tab_cap | ( | $tabname | ) |
Throw error if at least one parent context hasn't got one of the caps $caps.
string | $tabname | edit tab name |
|
static |
array of the capabilities.