Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
qbank_columnsortorder\column_manager Class Reference
Inheritance diagram for qbank_columnsortorder\column_manager:
core_question\local\bank\column_manager_base

Public Member Functions

 __construct (bool $globalsettings=false)
 Constructor for column_manager class.
 
 create_column_objects (array $columnsnames)
 Returns an array of column objects.
 
 disable_columns (string $plugin)
 Disables columns.
 
 enable_columns (string $plugin)
 Enables columns.
 
 get_colsize_map ()
 Return $this->colsize mapped as an array of column name => width, excluding empty sizes.
 
 get_column_actions (view $qbank)
 Return a list of actions to display in an action menu for each column.
 
 get_column_width (column_base $column)
 Given a column, return a value for its width CSS property.
 
 get_columns ()
 Get enabled columns.
 
 get_disabled_columns ()
 Get disabled columns.
 
 get_hidden_columns ()
 Return an array of hidden columns as an array of class => column name.
 
 get_questionbank ()
 Get qbank.
 
 get_sorted_columns (array $unsortedcolumns)
 Sort the list of columns.
 
 get_sorted_columns ($ordertosort)
 Orders columns in the question bank view according to config_plugins table 'qbank_columnsortorder' config.
 
 set_columns_visibility (array $columns)
 Given an array of columns, set the isvisible attribute according to $this->hiddencolumns and $this->disabledcolumns.
 

Static Public Member Functions

static set_column_order (?array $columns, bool $global=false)
 Sets column order in the qbank_columnsortorder plugin config.
 
static set_column_size (?string $sizes, bool $global=false)
 Column size.
 
static set_hidden_columns (?array $columns, bool $global=false)
 Hidden Columns.
 

Public Attributes

array $colsize
 columns with size.
 
array $columnorder
 Column order as set in config_plugins 'class' => 'position', ie: question_type_column => 3.
 
array $disabledcolumns
 Disabled columns in config_plugins table.
 
array $hiddencolumns
 hidden columns.
 

Protected Member Functions

 update_config ($enabledcolumns, $disabledcolumns)
 Updates enabled and disabled config for 'qbank_columnsortorder' plugin.
 

Constructor & Destructor Documentation

◆ __construct()

qbank_columnsortorder\column_manager::__construct ( bool $globalsettings = false)

Constructor for column_manager class.

Parameters
bool$globalsettingsOnly use the global default settings, ignoring user preferences?

Member Function Documentation

◆ create_column_objects()

qbank_columnsortorder\column_manager::create_column_objects ( array $columnsnames)

Returns an array of column objects.

Parameters
array$columnsnamesArray of columns.
Return values
column_base[]Array of $columnsname => $columnobject

◆ disable_columns()

qbank_columnsortorder\column_manager::disable_columns ( string $plugin)

Disables columns.

Parameters
string$pluginPlugin type and name ie: qbank_viewcreator.

◆ enable_columns()

qbank_columnsortorder\column_manager::enable_columns ( string $plugin)

Enables columns.

Parameters
string$pluginPlugin type and name ie: qbank_viewcreator.

◆ get_colsize_map()

qbank_columnsortorder\column_manager::get_colsize_map ( )

Return $this->colsize mapped as an array of column name => width, excluding empty sizes.

Return values
array

◆ get_column_actions()

qbank_columnsortorder\column_manager::get_column_actions ( view $qbank)

Return a list of actions to display in an action menu for each column.

Parameters
view$qbankQuestion bank view.
Return values
column_action_base[]A list of column actions.

Reimplemented from core_question\local\bank\column_manager_base.

◆ get_column_width()

qbank_columnsortorder\column_manager::get_column_width ( column_base $column)

Given a column, return a value for its width CSS property.

Parameters
column_base$column
Return values
stringCSS width property value.

Reimplemented from core_question\local\bank\column_manager_base.

◆ get_columns()

qbank_columnsortorder\column_manager::get_columns ( )

Get enabled columns.

Return values
array

◆ get_disabled_columns()

qbank_columnsortorder\column_manager::get_disabled_columns ( )

Get disabled columns.

Return values
array

◆ get_hidden_columns()

qbank_columnsortorder\column_manager::get_hidden_columns ( )

Return an array of hidden columns as an array of class => column name.

Return values
array

◆ get_questionbank()

qbank_columnsortorder\column_manager::get_questionbank ( )

Get qbank.

Return values
view

◆ get_sorted_columns() [1/2]

core_question\local\bank\column_manager_base::get_sorted_columns ( array $unsortedcolumns)
inherited

Sort the list of columns.

Sort the provided list of columns into the order implemented in this column manager.

Parameters
array$unsortedcolumnsUnordered array of columns
Return values
arrayColumns in the desired order.

◆ get_sorted_columns() [2/2]

qbank_columnsortorder\column_manager::get_sorted_columns ( $ordertosort)

Orders columns in the question bank view according to config_plugins table 'qbank_columnsortorder' config.

Parameters
array$ordertosortUnordered array of columns, [columnname => class]
Return values
array\$properorder,|$ordertosortReturns array ordered if 'qbank_columnsortorder' config exists.

◆ set_column_order()

static qbank_columnsortorder\column_manager::set_column_order ( ?array $columns,
bool $global = false )
static

Sets column order in the qbank_columnsortorder plugin config.

Parameters
?array$columnsColumn order to set. Null value clears the setting.
bool$globalsave this as a global default, rather than a user preference?

◆ set_column_size()

static qbank_columnsortorder\column_manager::set_column_size ( ?string $sizes,
bool $global = false )
static

Column size.

Parameters
?string$sizescolumns with width. Null value clears the setting.
bool$globalsave this as a global default, rather than a user preference?

◆ set_columns_visibility()

qbank_columnsortorder\column_manager::set_columns_visibility ( array $columns)

Given an array of columns, set the isvisible attribute according to $this->hiddencolumns and $this->disabledcolumns.

Parameters
column_base[]$columns
Return values
array

Reimplemented from core_question\local\bank\column_manager_base.

◆ set_hidden_columns()

static qbank_columnsortorder\column_manager::set_hidden_columns ( ?array $columns,
bool $global = false )
static

Hidden Columns.

Parameters
?array$columnsList of hidden columns. Null value clears the setting.
bool$globalsave this as a global default, rather than a user preference?

◆ update_config()

qbank_columnsortorder\column_manager::update_config ( $enabledcolumns,
$disabledcolumns )
protected

Updates enabled and disabled config for 'qbank_columnsortorder' plugin.

Parameters
array$enabledcolumnsEnabled columns to set.
array$disabledcolumnsDisabled columns to set.

The documentation for this class was generated from the following file: